GithubHelp home page GithubHelp logo

azganoth / tree-sitter-lua Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 18.0 1.77 MB

Lua grammar for tree-sitter.

License: MIT License

Python 1.59% JavaScript 49.94% Rust 9.91% C 34.40% Swift 4.15%
lua parser tree-sitter

tree-sitter-lua's Introduction

Hi there ๐Ÿ‘‹

tree-sitter-lua's People

Contributors

azganoth avatar logancollins avatar mattmassicotte avatar vigoux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tree-sitter-lua's Issues

Multiple concurrent Lua parsers can conflict from global variables in scanner

There appears to be an issue with the lexical scanner (in scanner.c) when used from an application that:

  1. Compiles the grammar to native code from C
  2. Runs multiple concurrent parsers

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!

Update to 1.6.0 fails: No prebuilt binaries found

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.

Adding this repo to the Tree-sitter docs

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.

Add escape_sequence node inside string

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?

version 12

tree-sitter ver13ใ€‚lua ver12ใ€‚build fail

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.