diff options
-rw-r--r-- | language/statements/assignment.rst | 15 | ||||
-rw-r--r-- | language/statements/index.rst | 1 | ||||
-rw-r--r-- | syntax.md | 13 |
3 files changed, 16 insertions, 13 deletions
diff --git a/language/statements/assignment.rst b/language/statements/assignment.rst new file mode 100644 index 0000000..f8c1600 --- /dev/null +++ b/language/statements/assignment.rst @@ -0,0 +1,15 @@ +Assignments +^^^^^^^^^^^ + +.. crowbar:element:: AssignmentStatement <- AssignmentBody ';' + AssignmentBody <- DirectAssignmentBody / UpdateAssignmentBody / CrementAssignmentBody + +.. crowbar:element:: DirectAssignmentBody <- AssignmentTarget '=' Expression + + .. todo:: define direct assignment + +.. crowbar:element:: UpdateAssignmentBody <- AssignmentTarget ('+=' / '-=' / '*=' / '/=' / '%=' / '&=' / '^=' / '|=') Expression + +.. crowbar:element:: CrementAssignmentBody <- AssignmentTarget ('++' / '--') + +.. todo:: define other assignments relative to direct diff --git a/language/statements/index.rst b/language/statements/index.rst index ac76f3b..623eb23 100644 --- a/language/statements/index.rst +++ b/language/statements/index.rst @@ -32,3 +32,4 @@ Statements variables structure flow-control + assignment @@ -3,19 +3,6 @@ ### Statements ```PEG -AssignmentStatement ← AssignmentStatementBody ';' -AssignmentStatementBody ← AssignmentTargetExpression '=' Expression / - AssignmentTargetExpression '+=' Expression / - AssignmentTargetExpression '-=' Expression / - AssignmentTargetExpression '*=' Expression / - AssignmentTargetExpression '/=' Expression / - AssignmentTargetExpression '%=' Expression / - AssignmentTargetExpression '&=' Expression / - AssignmentTargetExpression '^=' Expression / - AssignmentTargetExpression '|=' Expression / - AssignmentTargetExpression '++' / - AssignmentTargetExpression '--' - ExpressionStatement ← Expression ';' ``` |