Giter VIP home page Giter VIP logo

tree-sitter-torque's Introduction

tree-sitter-typescript

Build Status Build status

TypeScript and TSX grammars for tree-sitter.

Because TSX and TypeScript are actually two different dialects, this module defines two grammars. Require them as follows:

require('tree-sitter-typescript').typescript; // TypeScript grammar
require('tree-sitter-typescript').tsx; // TSX grammar

For Javascript files with flow type annotations you can use the the tsx parser.

References

开始

centos下

yum install nodejs
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
cargo install tree-sitter-cli

然后去掉package.json中关于tree-sitter-cli的安装。

npm install
npm run build
npm run test
npm run test-load

Linux下安装(舍弃,tree-sitter 提示 glibc版本过低)

若报错error lto1: fatal error: bytecode stream in file ‘Release/obj.target/tree_sitter_javascript_binding/src/parser.o’ generated with LTO version 2.2 instead of the expected 7.3,则将binding.gyp中的编译指令更改如下:

# 添加"-fno-lto"
      "cflags_c": [
        "-std=c99",
        "-fno-lto",
      ]

可能tree-sitter-typescript以及tree-sitter-javascript都需要对应的更改。

windows下安装(舍弃,npm run奇怪错误)

先安装vs2022,并确保选上了Desktop development with C++

然后设置如下:

npm config set msvs_version 2022

若Python也需要设置,可以使用npm config set python python3.10.

然后遇到报错VCINSTALLDIR not set, not running in VS Command Prompt, 可以参考 https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md#windows

tree-sitter学习

  1. 有关precedences

  2. 有关dynamic precedence

tree-sitter-torque's People

Contributors

314eter avatar ahlinc avatar aryx avatar buschco avatar darangi avatar daviwil avatar dcreager avatar hendrikvanantwerpen avatar iwanabethatguy avatar joshvera avatar kevinsawicki avatar kraftwerk28 avatar luni-4 avatar maxbrunsfeld avatar mjambon avatar msftenhanceprovenance avatar nbrahms avatar nmote avatar nullvoxpopuli avatar patrickt avatar rattrayalex avatar resolritter avatar rewinfrey avatar rmagatti avatar rtsao avatar ruricolist avatar shraymonks avatar tclem avatar tom95 avatar zdaiot avatar

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.