Skip to content

Commit fa90ab1

Browse files
committed
py: Simplify grammar for stmt rule (this is also how CPython has it).
1 parent d8837ce commit fa90ab1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

py/grammar.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* The MIT License (MIT)
55
*
6-
* Copyright (c) 2013, 2014 Damien P. George
6+
* Copyright (c) 2013-2015 Damien P. George
77
*
88
* Permission is hereby granted, free of charge, to any person obtaining a copy
99
* of this software and associated documentation files (the "Software"), to deal
@@ -79,9 +79,9 @@ DEF_RULE(varargslist_dbl_star, nc, and(2), tok(OP_DBL_STAR), tok(NAME))
7979
DEF_RULE(varargslist_equal, nc, and(2), tok(DEL_EQUAL), rule(test))
8080
DEF_RULE(vfpdef, nc, ident | and(1), tok(NAME))
8181

82-
// stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | simple_stmt
82+
// stmt: compound_stmt | simple_stmt
8383

84-
DEF_RULE(stmt, nc, or(9), rule(if_stmt), rule(while_stmt), rule(for_stmt), rule(try_stmt), rule(with_stmt), rule(funcdef), rule(classdef), rule(decorated), rule(simple_stmt))
84+
DEF_RULE(stmt, nc, or(2), rule(compound_stmt), rule(simple_stmt))
8585

8686
// simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
8787

0 commit comments

Comments
 (0)