Closed bzy-debug closed 1 year ago
I found the definition of terminator
:
newline = '\n',
terminator = choice(newline, ';', '\0')
It seems that this rule simulates the behavior of automatic semicolon insertion.
If so, does this simulation achieve the same effect as ASI in go?
Yeah because JS (and presumably scala) have edge-cases where a newline cannot handle automatic semicolon insertion, but Go is just fine.
I checkout the tree-sitter grammar repos of both javascript and scala, both of them have
scanner.c
to handle automatic semicolon. But tree-sitter-go seems not to have an external scanner, how do you handle automatic semicolon insertion then?