From be470f107eac284ff599dd5b0632f396d86dd025 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 21 Apr 2017 17:04:27 +0100 Subject: [PATCH] Support types in grammar --- docs/julia.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/julia.rst b/docs/julia.rst index a1b1e6784..988f19802 100644 --- a/docs/julia.rst +++ b/docs/julia.rst @@ -78,12 +78,12 @@ Grammar:: BreakContinue | SubAssembly FunctionDefinition = - 'function' Identifier '(' IdentifierList? ')' - ( '->' IdentifierList )? Block + 'function' Identifier '(' TypedIdentifierList? ')' + ( '->' TypedIdentifierList )? Block VariableDeclaration = - 'let' IdentifierOrList ( ':=' Expression )? + 'let' TypedIdentifierList ( ':=' Expression )? Assignment = - IdentifierOrList ':=' Expression + IdentifierList ':=' Expression Expression = FunctionCall | Identifier | Literal Switch = @@ -98,11 +98,11 @@ Grammar:: 'assembly' Identifier Block FunctionCall = Identifier '(' ( Expression ( ',' Expression )* )? ')' - IdentifierOrList = Identifier | '(' IdentifierList ')' Identifier = [a-zA-Z_$] [a-zA-Z_0-9]* IdentifierList = Identifier ( ',' Identifier)* + TypedIdentifierList = Identifier ':' Identifier ( ',' Identifier ':' Identifier )* Literal = - NumberLiteral | StringLiteral | HexLiteral + (NumberLiteral | StringLiteral | HexLiteral) ':' Identifier NumberLiteral = HexNumber | DecimalNumber HexLiteral = 'hex' ('"' ([0-9a-fA-F]{2})* '"' | '\'' ([0-9a-fA-F]{2})* '\'') StringLiteral = '"' ([^"\r\n\\] | '\\' .)* '"'