Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tree-sitter

Package Overview
Dependencies
Maintainers
1
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-sitter - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

vendor/tree-sitter/src/runtime/string_input.c

2

lib/document.js

@@ -5,3 +5,3 @@ var Document = require("./binding").Document,

Document.prototype.setInputString = function(string) {
this.setInput(new StringInput(string));
return this.setInput(new StringInput(string));
};

@@ -8,0 +8,0 @@

@@ -15,6 +15,7 @@ {

"main": "index.js",
"version": "0.0.10",
"version": "0.0.11",
"dependencies": {
"bindings": "1.2.x"
"bindings": "1.2.x",
"nan": "1.3.x"
}
}
tree-sitter
===========
[![Build Status](https://travis-ci.org/maxbrunsfeld/node-tree-sitter.svg?branch=master)](https://travis-ci.org/maxbrunsfeld/node-tree-sitter)
Incremental parsers for node
[![Build Status](https://travis-ci.org/maxbrunsfeld/node-tree-sitter.svg?branch=master)](https://travis-ci.org/maxbrunsfeld/node-tree-sitter)
### Installation
```
npm install tree-sitter
```
### Usage
Make a document:
```javascript
var treeSitter = require("tree-sitter");
var document = new treeSitter.Document();
```
Create a language module using [tree-sitter-compiler](http://github.com/maxbrunsfeld/node-tree-sitter-compiler). See [the javascript module](http://github.com/maxbrunsfeld/node-tree-sitter-javascript) for an example.
Set the document's language:
```javascript
document.setLanguage(require("tree-sitter-javascript"));
```
Set the document's text:
```javascript
document.setInputString("var inc = function(n) { return n + 1; }; inc(5);");
```
Access the document's AST:
```javascript
document.toString()
/*
* (DOCUMENT
* (program
* (var_declaration
* (identifier)
* (function (formal_parameters (identifier)) (statement_block
* (return_statement (math_op (identifier) (number))))))
* (expression_statement (function_call
* (identifier) (number)))))
*/
var program = document.children[0];
program.children[0];
/*
* { name: 'var_declaration',
* size: 40,
* position: 0,
* children: { length: 2 } }
*/
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc