add some features

This commit is contained in:
2025-08-03 21:04:14 +02:00
parent 5e2e85830b
commit 0318532308
8 changed files with 374 additions and 305 deletions
+15 -1
View File
@@ -13,6 +13,7 @@ class TokenModifier(enum.IntFlag):
defaultLibrary = enum.auto()
definition = enum.auto()
declaration = enum.auto()
builtin = enum.auto()
@attrs.define
@@ -63,6 +64,20 @@ class _Highlighter(Visitor):
def visit_command(self, command: Command):
routine = command.routine
if routine.contents == "puts":
line, col = routine.contents_pos
self._tokens.append(
(
(
(line - 1, col - 1),
len(routine.contents),
"function",
[TokenModifier.builtin],
)
)
)
pass
if routine.contents == "set" and command.args:
first_arg = command.args[0]
if hasattr(first_arg, "pos") and hasattr(first_arg, "value"):
@@ -135,7 +150,6 @@ class _Highlighter(Visitor):
)
def visit_var_sub(self, var_sub):
self.log_to_output(str(var_sub))
pass
def tokens(self) -> list[Token]: