diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-07-19 19:40:43 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-07-19 19:40:43 -0700 |
| commit | 711fe47a7f651f38e090c9a20ecef11feba6f705 (patch) | |
| tree | 98a3283e7c630919a08f8bd95326ceeb1a93da9e /grammars/python.bp | |
| parent | 62e7d654bd70db89cb38e5d9efeb9a9b0e9cf202 (diff) | |
Overhaul of word boundaries/edges. Now they use \b, which is implemented
in C, and the C code understands UTF8 id chars.
Diffstat (limited to 'grammars/python.bp')
| -rw-r--r-- | grammars/python.bp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/grammars/python.bp b/grammars/python.bp index cb5d047..aab9a42 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"\b_id[_parens]_`: function: function-def +(\N ..$) -function-def: ^_{def}_id parens `: -import: ^_[{from} ..%parens >{import}] {import} ..%parens $ +function-def: ^_"def"\b_id parens `: +import: ^_["from"\b ..%parens >(\b"import"\b)] \b"import"\b ..%parens $ |
