boolangery / py-lua-parser

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

Comments with Chinese characters are discarded #39

Open tony-song opened 1 year ago

tony-song commented 1 year ago

Dear maintainers,

When using the parser, I find that sometimes comments with Chinese characters are silently discarded. Below is Lua code which can be used to reproduce the error:

   function setupRichText()
        richText.fitArea = false    -- 是否根据内容自适应高度
        richText.fitPerHeight = nil -- 自适应的单行高度
        return richText
    end

After parsing the code above using ast.parse(), the 2nd comment ('-- 自适应的单行高度') cannot be found anywhere in the returned AST. However the 1st comment can be found in the AST as expected.

Would you please check if there is something wrong when processing comments in Chinese?