detect c-ism token better

This commit is contained in:
AcerecA 2025-01-20 15:23:57 +01:00
parent 12e1611754
commit 5b17ea9ab7
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ class SkillLanguageServer(LanguageServer):
for col, char in enumerate(line): for col, char in enumerate(line):
if col > 0: if col > 0:
if fullmatch("\\w", line[col - 1]) and char == "(": if fullmatch("\\w", line[col - 1]) and char == "(":
if m := re.match(r"\W+(\w+)$", line[:col]): if m := re.match(r"\W+([a-zA-Z_][a-zA-Z_0-9]*)$", line[:col]):
tok = m.group(1) tok = m.group(1)
else: else:
tok = line[col - 1] tok = line[col - 1]