add some features
This commit is contained in:
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user