tree-sitter-integerbasic
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Parser for Integer BASIC

This is the node binding for tree-sitter-integerbasic. See the main README here.

Here is a sample package.json:

{
  "name": "parsing-example",
  "version": "1.0.0",
  "description": "integer basic parsing example",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "node-gyp": "^10.1.0",
    "tree-sitter": "^0.21.1",
    "tree-sitter-integerbasic": "^1.1.1"
  }
}

With an example index.js as follows:

const Parser = require('tree-sitter');
const Integer = require('tree-sitter-integerbasic');

const code = '10 print "HELLO WORLD!"\n';
const parser = new Parser();
parser.setLanguage(Integer);
tree = parser.parse(code);
console.log(tree.rootNode.toString());

This should print the syntax tree

(source_file (line (linenum) (statement (statement_print_str) (string (quote) (unquote)))))

For more on parsing with node, see the general guidance here.

Readme

Keywords

Package Sidebar

Install

npm i tree-sitter-integerbasic

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

1.03 MB

Total Files

15

Last publish

Collaborators

  • dfxgordon