From 711fe47a7f651f38e090c9a20ecef11feba6f705 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 19 Jul 2021 19:40:43 -0700 Subject: Overhaul of word boundaries/edges. Now they use \b, which is implemented in C, and the C code understands UTF8 id chars. --- 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 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 $ -- cgit v1.2.3