| 25 | |
| 26 | |
| 27 | class Python37Parser(Python37BaseParser): |
| 28 | def __init__(self, debug_parser=PARSER_DEFAULT_DEBUG): |
| 29 | super(Python37Parser, self).__init__(debug_parser) |
| 30 | self.customized = {} |
| 31 | |
| 32 | ############################################### |
| 33 | # Python 3.7 grammar rules |
| 34 | ############################################### |
| 35 | def p_start(self, args): |
| 36 | """ |
| 37 | # The start or goal symbol |
| 38 | stmts ::= sstmt+ |
| 39 | """ |
| 40 | |
| 41 | def p_call_stmt(self, args): |
| 42 | """ |
| 43 | # eval-mode compilation. Single-mode interactive compilation |
| 44 | # adds another rule. |
| 45 | call_stmt ::= expr POP_TOP |
| 46 | """ |
| 47 | |
| 48 | def p_eval_mode(self, args): |
| 49 | """ |
| 50 | # eval-mode compilation. Single-mode interactive compilation |
| 51 | # adds another rule. |
| 52 | expr_stmt ::= expr POP_TOP |
| 53 | """ |
| 54 | |
| 55 | def p_stmt(self, args): |
| 56 | """ |
| 57 | pass ::= |
| 58 | |
| 59 | _stmts ::= stmt+ |
| 60 | |
| 61 | # statements with continue and break |
| 62 | c_stmts ::= _stmts |
| 63 | c_stmts ::= _stmts lastc_stmt |
| 64 | c_stmts ::= lastc_stmt |
| 65 | c_stmts ::= continues |
| 66 | |
| 67 | ending_return ::= RETURN_VALUE RETURN_LAST |
| 68 | ending_return ::= RETURN_VALUE_LAMBDA LAMBDA_MARKER |
| 69 | |
| 70 | lastc_stmt ::= iflaststmt |
| 71 | lastc_stmt ::= forelselaststmt |
| 72 | lastc_stmt ::= ifelsestmtc |
| 73 | |
| 74 | # Statements in a loop |
| 75 | lstmt ::= stmt |
| 76 | l_stmts ::= lstmt+ |
| 77 | |
| 78 | c_stmts_opt ::= c_stmts |
| 79 | c_stmts_opt ::= pass |
| 80 | |
| 81 | # statements inside a loop |
| 82 | l_stmts ::= _stmts |
| 83 | l_stmts ::= returns |
| 84 | l_stmts ::= continues |
no outgoing calls
no test coverage detected