From 17dbe5d9e8fcbe2c5f2f494658868b28857a25ca Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 10 May 2021 23:46:46 -0700 Subject: Added {word} feature and cleaned up the code some. --- grammars/python.bp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'grammars/python.bp') diff --git a/grammars/python.bp b/grammars/python.bp index 13c9251..daab6a5 100644 --- a/grammars/python.bp +++ b/grammars/python.bp @@ -14,7 +14,7 @@ keyword: |("and" / "as" / "assert" / "break" / "class" / "continue" / "def" / "not" / "or" / "pass" / "raise" / "return" / "try" / "while" / "with" / "yield")| class: class-def +(\N ..$) -class-def: ^_|"class"|_id[_parens]_`: +class-def: ^_{class}_id[_parens]_`: function: function-def +(\N ..$) -function-def: ^_|"def"|_id parens `: -import: ^_["from"| ..%parens >(|"import"|)] |"import"| ..%parens $ +function-def: ^_{def}_id parens `: +import: ^_[{from} ..%parens >{import}] {import} ..%parens $ -- cgit v1.2.3