From ed4022fbca92f5c2dc4bc5a6a7e58db9f040c07d Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 25 Jul 2018 00:04:27 +0100 Subject: grammar: support all assignment stataments in inline assembly --- docs/grammar.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/grammar.txt b/docs/grammar.txt index 7b29fc62..082ba525 100644 --- a/docs/grammar.txt +++ b/docs/grammar.txt @@ -156,6 +156,6 @@ InlineAssemblyBlock = '{' AssemblyItem* '}' AssemblyItem = Identifier | FunctionalAssemblyExpression | InlineAssemblyBlock | AssemblyLocalBinding | AssemblyAssignment | AssemblyLabel | NumberLiteral | StringLiteral | HexLiteral AssemblyLocalBinding = 'let' Identifier ':=' FunctionalAssemblyExpression -AssemblyAssignment = ( Identifier ':=' FunctionalAssemblyExpression ) | ( '=:' Identifier ) +AssemblyAssignment = ( Identifier ':=' ( Identifier | FunctionalAssemblyExpression ) ) | ( '=:' Identifier ) AssemblyLabel = Identifier ':' FunctionalAssemblyExpression = Identifier '(' AssemblyItem? ( ',' AssemblyItem )* ')' -- cgit v1.2.3 From 258e8caa59d1aed5913c73bc49af957e9dd3a5ec Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 25 Jul 2018 00:08:08 +0100 Subject: grammar: introduce AssemblyExpression and use it in Assignment/LocalBinding --- docs/grammar.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/grammar.txt b/docs/grammar.txt index 082ba525..42467b6f 100644 --- a/docs/grammar.txt +++ b/docs/grammar.txt @@ -155,7 +155,8 @@ Ufixed = 'ufixed' | ( 'ufixed' [0-9]+ 'x' [0-9]+ ) InlineAssemblyBlock = '{' AssemblyItem* '}' AssemblyItem = Identifier | FunctionalAssemblyExpression | InlineAssemblyBlock | AssemblyLocalBinding | AssemblyAssignment | AssemblyLabel | NumberLiteral | StringLiteral | HexLiteral -AssemblyLocalBinding = 'let' Identifier ':=' FunctionalAssemblyExpression -AssemblyAssignment = ( Identifier ':=' ( Identifier | FunctionalAssemblyExpression ) ) | ( '=:' Identifier ) +AssemblyExpression = Identifier | FunctionalAssemblyExpression | NumberLiteral | StringLiteral | HexLiteral +AssemblyLocalBinding = 'let' Identifier ':=' AssemblyExpression +AssemblyAssignment = ( Identifier ':=' AssemblyExpression ) | ( '=:' Identifier ) AssemblyLabel = Identifier ':' FunctionalAssemblyExpression = Identifier '(' AssemblyItem? ( ',' AssemblyItem )* ')' -- cgit v1.2.3 From 582ab4eab453cd658d4904aacfad597d44573e6b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 25 Jul 2018 00:08:42 +0100 Subject: grammar: rename AssemblyLocalBinding to AssemblyVariableDeclaration --- docs/grammar.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/grammar.txt b/docs/grammar.txt index 42467b6f..8e91a7d6 100644 --- a/docs/grammar.txt +++ b/docs/grammar.txt @@ -154,9 +154,9 @@ Ufixed = 'ufixed' | ( 'ufixed' [0-9]+ 'x' [0-9]+ ) InlineAssemblyBlock = '{' AssemblyItem* '}' -AssemblyItem = Identifier | FunctionalAssemblyExpression | InlineAssemblyBlock | AssemblyLocalBinding | AssemblyAssignment | AssemblyLabel | NumberLiteral | StringLiteral | HexLiteral +AssemblyItem = Identifier | FunctionalAssemblyExpression | InlineAssemblyBlock | AssemblyVariableDeclaration | AssemblyAssignment | AssemblyLabel | NumberLiteral | StringLiteral | HexLiteral AssemblyExpression = Identifier | FunctionalAssemblyExpression | NumberLiteral | StringLiteral | HexLiteral -AssemblyLocalBinding = 'let' Identifier ':=' AssemblyExpression +AssemblyVariableDeclaration = 'let' Identifier ':=' AssemblyExpression AssemblyAssignment = ( Identifier ':=' AssemblyExpression ) | ( '=:' Identifier ) AssemblyLabel = Identifier ':' FunctionalAssemblyExpression = Identifier '(' AssemblyItem? ( ',' AssemblyItem )* ')' -- cgit v1.2.3