Comments (4)
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.
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.
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.
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)
- Semicolons after break statement unrecognized HOT 3
- StringLiteral.value is sometimes null HOT 1
- Add an event/notification when a function definition begins
- How to parse json back to lua? HOT 1
- Lua floor division operator not recognised HOT 1
- lua fails to parse with custom type definitions HOT 1
- How to pass the ast to escodegen.generate to make js code? HOT 1
- Incorrect parsing for return statements HOT 1
- do luaparse support bit opratation? HOT 1
- Incorrect parsing parens indiscriminately removed
- Incorrect parsing: semicolon indiscriminately removed
- Syntax error though code is valid HOT 2
- Fail to reject an invalid literal string
- The string literal's value is not passed properly. HOT 1
- Issue with unicode characters
- support for ?. operator data?.files
- onLocalDeclaration not being called HOT 1
- Any chance for bundled TypeScript definitions? HOT 3
- Support LuaJIT syntax extensions HOT 1
- Bitwize brackets disappears HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luaparse.