Skip to content

Commit

Permalink
lark file keywords word boundry added
Browse files Browse the repository at this point in the history
  • Loading branch information
ThakeeNathees committed Oct 31, 2024
1 parent de3c755 commit a51499e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion jac/jaclang/compiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def generate_static_parser(force: bool = False) -> None:
contextlib.suppress(ModuleNotFoundError)

TOKEN_MAP = {
x.name: x.pattern.value
x.name: (
x.pattern.value[2:-2]
if x.pattern.value.startswith("\\b") and x.pattern.value.endswith("\\b")
else x.pattern.value
)
for x in jac_lark.Lark_StandAlone().parser.lexer_conf.terminals
}

Expand Down
2 changes: 1 addition & 1 deletion jac/jaclang/compiler/jac.lark
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ KW_TRY: "try"
KW_EXCEPT: "except"
KW_FINALLY: "finally"
KW_RAISE: "raise"
KW_IN: "in"
KW_IN: /\bin\b/
KW_IS: "is"
KW_PRIV: "priv"
KW_PUB: "pub"
Expand Down

0 comments on commit a51499e

Please sign in to comment.