azganoth / tree-sitter-lua Goto Github PK
View Code? Open in Web Editor NEWLua grammar for tree-sitter.
License: MIT License
Lua grammar for tree-sitter.
License: MIT License
There appears to be an issue with the lexical scanner (in scanner.c
) when used from an application that:
Due to the scanner's use of global variables (started
and depth
), multiple parsers can overwrite each others' variable state, leading to incorrect parsing.
I think the best option would be to move those two variables into the payload
pointer that can be allocated when the scanner is created.
I have a pull request with some tweaks ready, and will be opening it soon!
Updating to the latest version of language-lua-plus (1.6.0) fails with the following error log:
> [email protected] install %LocalAppData%\Temp\apm-install-dir-119712-19064-1donkpp.b1t6\node_modules\language-lua-plus\node_modules\tree-sitter-lua
> prebuild-install || node-gyp rebuild
%LocalAppData%\Temp\apm-install-dir-119712-19064-1donkpp.b1t6\node_modules\language-lua-plus\node_modules\tree-sitter-lua>if not defined npm_config_node_gyp (node "%LocalAppData%\atom\app-1.39.1\resources\app\apm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "%LocalAppData%\atom\app-1.39.1\resources\app\apm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
prebuild-install WARN install No prebuilt binaries found (target=3.1.10 runtime=electron arch=x64 libc= platform=win32)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (%LocalAppData%\atom\app-1.39.1\resources\app\apm\node_modules\npm\node_modules\node-gyp\lib\configure.js:492:19)
gyp ERR! stack at PythonFinder.<anonymous> (%LocalAppData%\atom\app-1.39.1\resources\app\apm\node_modules\npm\node_modules\node-gyp\lib\configure.js:517:16)
gyp ERR! stack at %LocalAppData%\atom\app-1.39.1\resources\app\apm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "%LocalAppData%\\atom\\app-1.39.1\\resources\\app\\apm\\bin\\node.exe" "%LocalAppData%\\atom\\app-1.39.1\\resources\\app\\apm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd %LocalAppData%\Temp\apm-install-dir-119712-19064-1donkpp.b1t6\node_modules\language-lua-plus\node_modules\tree-sitter-lua
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '%LocalAppData%\Temp\apm-install-dir-119712-19064-1donkpp.b1t6\package.json'
npm WARN apm-install-dir-119712-19064-1donkpp.b1t6 No description
npm WARN apm-install-dir-119712-19064-1donkpp.b1t6 No repository field.
npm WARN apm-install-dir-119712-19064-1donkpp.b1t6 No README data
npm WARN apm-install-dir-119712-19064-1donkpp.b1t6 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Using Atom 1.39.1 on Win10 64 bit.
Installing language-lua-plus
(1.6.0) in Atom 1.40 fails because of missing prebuild binaries.
Really nice work on this parser; thanks for creating it!
I'm just opening this issue as a heads up that I'm adding a link to this repository in the Tree-sitter docs. If for any reason you'd prefer that I not have this link, I'll take it down.
Hello, The c tree sitter seems to declare escape_sequence in string
https://github.com/tree-sitter/tree-sitter-c/blob/f35789006ccbe5be8db21d1a2dd4cc0b5a1286f2/src/grammar.json#L6317
Which make it possible to add specific highlight for escaped sequence
https://github.com/nvim-treesitter/nvim-treesitter/blob/411e771d511442ab81670701f5c830f6c74aadd7/queries/c/highlights.scm#L109
I don't really understand how string are declared for the tree sitter lua parser, so is it possible to do the same thing as the c grammar with the current state of the lua grammar?
tree-sitter ver13ใlua ver12ใbuild fail
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.