boolangery / py-lua-parser

A Lua parser and AST builder written in Python.
MIT License
117 stars 36 forks source link

is ULengthOP Operator precedence Incorrected? #38

Open ctemple opened 1 year ago

ctemple commented 1 year ago

-- test.lua local table3 = {} table3[#table3 + 1] = 100

run luaparser ./test.lua

output

{
    ...
    "ULengthOp": {
        "operand": {
            "AddOp": {
                "left": {
                    "Name": {
                        "id": "table3",
                        "start_char": 26,
                        "stop_char": 31,
                        "line": 2
                    }
                },
                "right": {
                    "Number": {
                        "n": 1,
                        "start_char": 35,
                        "stop_char": 35,
                        "line": 2
                    }
                },
            }
        }
    }
   ...
}

expected:

AddOp
{
    left: ULengthOp {}
    right: {...}
}