From 29502f9d4476dc8c8b9ee66bfb9309cf209acbce Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 21 Apr 2017 17:35:44 +0100 Subject: Include type names in grammar --- docs/julia.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/julia.rst') diff --git a/docs/julia.rst b/docs/julia.rst index 054f8627..a441b38b 100644 --- a/docs/julia.rst +++ b/docs/julia.rst @@ -97,9 +97,11 @@ Grammar:: Identifier '(' ( Expression ( ',' Expression )* )? ')' Identifier = [a-zA-Z_$] [a-zA-Z_0-9]* IdentifierList = Identifier ( ',' Identifier)* - TypedIdentifierList = Identifier ':' Identifier ( ',' Identifier ':' Identifier )* + TypeName = Identifier | BuiltinTypeName + BuiltinTypeName = 'bool' | [us] ( '8' | '32' | '64' | '128' | '256' ) + TypedIdentifierList = Identifier ':' TypeName ( ',' Identifier ':' TypeName )* Literal = - (NumberLiteral | StringLiteral | HexLiteral) ':' Identifier + (NumberLiteral | StringLiteral | HexLiteral) ':' TypeName NumberLiteral = HexNumber | DecimalNumber HexLiteral = 'hex' ('"' ([0-9a-fA-F]{2})* '"' | '\'' ([0-9a-fA-F]{2})* '\'') StringLiteral = '"' ([^"\r\n\\] | '\\' .)* '"' -- cgit