usagi-coffee / tree-sitter-abl

OpenEdge ABL grammar for tree-sitter
MIT License
7 stars 1 forks source link

Variable of two keywords got splited during parsing #53

Open PauliusKu opened 2 months ago

PauliusKu commented 2 months ago

Variable outputStream in VAR statement was recognized as identifier, but later parsed as two separate keywords, which brings up error and rest of the file is not being formatted.

Example:

method public void WriteJson(filePath as char, inputJson as Object):
    var JsonSerializer jsonSerializer = new JsonSerializer(true).
    var FileOutputStream outputStream = new FileOutputStream(filePath).

    jsonSerializer:Serialize(inputJson, outputStream).
    outputStream:Close().
end method.

image image image image

Same happened with inputTable. And then after this it even thought that "def" in word "default" is DEFINE. Example: This:

if inputTable:default-buffer-handle:available = false then
      undo, throw new AppException(ErrorCode:RECORD_NOT_FOUND, inputTable:name).
PauliusKu commented 2 months ago

Similarly, there are issues with variable names containing other keywords like for, def and probably more.

image

jkbz64 commented 2 months ago

I didn't know such syntax existed, looks like 12.8 thing, this should resolve with #52.

Similarly, there are issues with variable names containing other keywords like for, def and probably more.

Well.. it's a known issue... I've bumped into it myself too and don't really know how to properly fix that yet...