Giter Site home page Giter Site logo

nimtreesitter's People

Contributors

genotrance avatar prestonknopp 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

Watchers

 avatar  avatar  avatar  avatar

nimtreesitter's Issues

Simple ruby parser fails to build

Hi,

I tried this small example, but it fails to build, it seems it fails to link binary.

import treesitter/api
import treesitter_ruby/ruby

var p = tsParserNew()

assert p.tsParserSetLanguage(treeSitterruby()) == true

let code = """
puts "Hello"
"""

let tree = p.tsParserParseString(nil, code.cstring, code.len.uint32)

p.tsParserDelete()

Error:

nim c ruby_parser.nim
...........................................................................
/home/lz/snippets/nim/ruby_parser.nim(12, 5) Hint: 'tree' is declared but not used [XDeclaredButNotUsed]
CC: ruby_parser.nim
Hint:  [Link]
/bin/ld: /home/lz/.cache/nim/ruby_parser_d/scannerruby.o: in function `(anonymous namespace)::Heredoc::Heredoc()':
scanner.cc:(.text+0x14): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
/bin/ld: /home/lz/.cache/nim/ruby_parser_d/scannerruby.o: in function `(anonymous namespace)::Scanner::serialize(char*)':
scanner.cc:(.text+0x323): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
...

/bin/ld: /home/lz/.cache/nim/ruby_parser_d/scannerruby.o:(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
collect2: error: ld returned 1 exit status
Error: execution of an external program failed: 'gcc   -o /home/lz/snippets/nim/ruby_parser  /home/lz/.cache/nim/ruby_parser_d/lib.c.o /home/lz/.cache/nim/ruby_parser_d/parserruby.o /home/lz/.cache/nim/ruby_parser_d/scannerruby.o /home/lz/.cache/nim/ruby_parser_d/stdlib_digitsutils.nim.c.o /home/lz/.cache/nim/ruby_parser_d/stdlib_assertions.nim.c.o /home/lz/.cache/nim/ruby_parser_d/stdlib_dollars.nim.c.o /home/lz/.cache/nim/ruby_parser_d/stdlib_system.nim.c.o /home/lz/.cache/nim/ruby_parser_d/@mruby_parser.nim.c.o  -lm -lm   -ldl'

Nimble install fails

nimble install treesitter_typescript

Downloading https://github.com/genotrance/nimtreesitter using git (subdir is 'treesitter_typescript')
Setting up Git repo: https://github.com/tree-sitter/tree-sitter-typescript
Pulling repository
Creating treesitter_typescript/typescript/typescript/src/parser.h
Creating treesitter_typescript/typescript.nim
  Verifying dependencies for [email protected]
   Warning: No .nimble or .nimble-link file found for /home/g/.nimble/pkgs/treesitter_typescript-0.1.1
      Info: Dependency on nimgen@>= 0.5.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on c2nim@>= 0.9.14 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on regex@>= 0.10.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.7.2 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodeplus@>= 0.5.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.7 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on treesitter@>= 0.1.1 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on nimgen@>= 0.5.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on c2nim@>= 0.9.14 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on regex@>= 0.10.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.7.2 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodeplus@>= 0.5.0 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on unicodedb@>= 0.7 already satisfied
  Verifying dependencies for [email protected]
 Installing [email protected]
oserr.nim(94)            raiseOSError
Error: unhandled exception: File exists
Additional info: "/tmp/nimble_10505/githubcom_genotrancenimtreesitter/treesitter_typescript/treesitter_typescript/typescript/tsx/corpus/common" [OSError]

Not sure where exactly this error is coming from, any tips to debug?

error: Sparse checkout leaves no entry on working directory

It looks like tree-sitter repo has changed it's file structure so the sparse checkout globs need to be updated.

Output:

nimble install treesitter
Downloading https://github.com/genotrance/nimtreesitter using git (subdir is 'treesitter')
Setting up Git repo: https://github.com/tree-sitter/tree-sitter/
Pulling repository
Command failed: 1
git pull --depth=1 origin master
From https://github.com/tree-sitter/tree-sitter
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
error: Sparse checkout leaves no entry on working directory

stack trace: (most recent call last)
/private/tmp/nimblecache/nimscriptapi.nim(176, 29)
/private/tmp/nimble_4854/githubcom_genotrancenimtreesitter/treesitter/treesitter_4854.nims(34, 12) installBefore
/private/tmp/nimble_4854/githubcom_genotrancenimtreesitter/treesitter/treesitter_4854.nims(31, 8) setupTask
/Users/prestonknopp/.choosenim/toolchains/nim-0.20.0/lib/system/nimscript.nim(242, 7) exec
/Users/prestonknopp/.choosenim/toolchains/nim-0.20.0/lib/system/nimscript.nim(242, 7) Error: unhandled exception: FAILED: nimgen treesitter.cfg
       Tip: 2 messages have been suppressed, use --verbose to show them.
     Error: Exception raised during nimble script execution

error: Sparse checkout leaves no entry on working directory

Trying to install using nimble install treesitter --verbose

    Reading official package list
Downloading https://github.com/genotrance/nimtreesitter using git (subdir is 'treesitter')
    Cloning latest tagged version: v0.1.0
 Attempting to execute hook installBefore in /tmp/nimble_22065/githubcom_genotrancenimtreesitter/treesitter/treesitter.nimble
Setting up Git repo: https://github.com/tree-sitter/tree-sitter/
Pulling repository
Command failed: 1
git pull --depth=1 origin master
From https://github.com/tree-sitter/tree-sitter
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
error: Sparse checkout leaves no entry on working directory

stack trace: (most recent call last)
/tmp/nimblecache/nimscriptapi.nim(177, 29)
/tmp/nimble_22065/githubcom_genotrancenimtreesitter/treesitter/treesitter_22065.nims(34, 12) installBefore
/tmp/nimble_22065/githubcom_genotrancenimtreesitter/treesitter/treesitter_22065.nims(31, 8) setupTask
/home/sokil/.choosenim/toolchains/nim-1.0.2/lib/system/nimscript.nim(252, 7) exec
/home/sokil/.choosenim/toolchains/nim-1.0.2/lib/system/nimscript.nim(252, 7) Error: unhandled exception: FAILED: nimgen treesitter.cfg [OSError]
     Error: Exception raised during nimble script execution

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.