Giter VIP home page Giter VIP logo

Comments (4)

mathiasbynens avatar mathiasbynens commented on September 17, 2024

Related issue (I think, as it uses inline block comments as well): this should throw an error:

$ lua
Lua 5.2.1  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> x=2--[[42--]]1; print(x)
stdin:1: unexpected symbol near '1'
>

But luaparse still parses it:

$ ./luaparse 'x=2--[[42--]]1; print(x)'
{"type":"Chunk","body":[{"type":"AssignmentStatement","variables":[{"type":"Identifier","name":"x"}],"init":[{"type":"NumericLiteral","value":2,"raw":"2"}]},{"type":"CallStatement","expression":{"type":"CallExpression","base":{"type":"Identifier","name":"print"},"arguments":[{"type":"Identifier","name":"x"}]}}],"comments":[{"type":"Comment","value":"42--","raw":"--[[42--]]1;"}]}

Note that luaparse incorrectly appends the trailing 1 to the comment’s raw value.

from luaparse.

oxyc avatar oxyc commented on September 17, 2024

Keep them coming! I think this would have been obvious if I had ever written a line of lua, except for my tests hehe. Maybe it's about time to try it out

from luaparse.

mathiasbynens avatar mathiasbynens commented on September 17, 2024

I can’t seem to find any more bugs :) In total I tested over 20k lines of random Lua code found on the intertubes, and the HEAD version of luaparse handles it all likes a boss. \o/

from luaparse.

oxyc avatar oxyc commented on September 17, 2024

Awesome! There might be some though... so far I haven't been able to do any validity tests, but now thanks to luamin that's made possible. During the weekend I plan to test it properly.

from luaparse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.