manoelcampos / xml2lua

XML Parser written entirely in Lua that works for Lua 5.1+. Convert XML to and from Lua Tables 🌖💱
MIT License
290 stars 74 forks source link

Broken Function #16

Closed RussDragon closed 6 years ago

RussDragon commented 6 years ago

One more issue from me: https://github.com/manoelcampos/xml2lua/blob/master/XmlParser.lua#L364 It seems that this function is broken. parseXmlProcessingInstructions doesn't exist in scope of XmlParser. Tag is global here and it isn't returned/used. I would assume that it should be (?) local and should be (?) returned at the end.

I just need to understand how it should work to move tag from global scope. Thank you again. I am just trying to fix all problems with scopes/variables because of strict-mode checking.

RussDragon commented 6 years ago

Any thoughts on that?

manoelcampos commented 6 years ago

In fact, just the name of the function is incorrect. It's parseXmlProcessingInstruction instead of parseXmlProcessingInstructions.

About the tag variable inside the parseTagType function, it isn't being used. Other functions such as the parseXmlDeclaration use a tag table returned from functions such as the parseTag, but the parseTagType doesn't use it, so the variable is safe to remove.