Closed theHamsta closed 2 years ago
FWIW this doesn't seem right to me. The function
in (function(int): int)
is part of a type hint, so I wouldn't expect function
to be treated as a keyword here. The other syntax highlighters for Hack don't treat it as a keyword.
I guess it makes sense to parse function
as a separate token here, but I'd highlight it differently to function
in global function or method declarations.
Summary
Regexes don't appear in the AST, so in lambdas
"function"
and"("
can not be highlighted properly.Solution: replace regex by equivalent tokens.
Requirements (place an
x
in each[ ]
)