boolangery / py-lua-parser

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

Failure to reject incorrect inputs: name token #49

Open bendrissou opened 10 months ago

bendrissou commented 10 months ago

Hi,

The parser doesn't reject some of the incorrect and incomplete Lua inputs.

As a short example, consider the following Lua string:

var_name

The parser parses and labels the input as Name, without raising any error!

In comparison to the official Lua grammar, and official Lua implementation, the input is invalid. This is because Name is not a statement. So, it can only be part of a statement, and is only allowed in certain contexts.

So my question is : is this behaviour intended? Or is it a parsing error?

Thank you.