diff options
Diffstat (limited to 'Grammar')
-rw-r--r-- | Grammar/Grammar | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar index df4faa7..4df0623 100644 --- a/Grammar/Grammar +++ b/Grammar/Grammar @@ -37,9 +37,10 @@ fplist: fpdef (',' fpdef)* [','] stmt: simple_stmt | compound_stmt simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE #small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | access_stmt | exec_stmt -small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt -expr_stmt: testlist ('=' testlist)* -# For assignments, additional restrictions enforced by the interpreter +small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt +expr_stmt: testlist (augassign testlist | ('=' testlist)*) +augassign: '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' +# For normal assignments, additional restrictions enforced by the interpreter print_stmt: 'print' ( [ test (',' test)* [','] ] | '>>' test [ (',' test)+ [','] ] ) del_stmt: 'del' exprlist pass_stmt: 'pass' |