Go to file
Ika 752419c33d
fix: trailing whitespaces are allowed for local_time (#3)
Input:

(each `·` indicates a whitespace)

```toml
valid·=·1979-05-27·
```

Output:

```
# before

(file
  (ERROR
    (key)))

# after

(file
  (pair
    (key) (local_date)))
```
2019-08-21 09:13:14 +08:00
corpus fix: trailing whitespaces are allowed for local_time (#3) 2019-08-21 09:13:14 +08:00
examples feat: initial implementation 2019-08-18 18:30:34 +08:00
src fix: trailing whitespaces are allowed for local_time (#3) 2019-08-21 09:13:14 +08:00
.editorconfig fix: trailing whitespaces are allowed for local_time (#3) 2019-08-21 09:13:14 +08:00
.gitattributes chore: update gitattributes and add prepack script 2019-08-18 21:13:19 +08:00
.gitignore feat: initial implementation 2019-08-18 18:30:34 +08:00
.npmignore feat: initial implementation 2019-08-18 18:30:34 +08:00
.prettierrc feat: initial implementation 2019-08-18 18:30:34 +08:00
.travis.yml feat: initial implementation 2019-08-18 18:30:34 +08:00
binding.gyp feat: initial implementation 2019-08-18 18:30:34 +08:00
CHANGELOG.md chore(release): 0.1.2 2019-08-20 15:03:41 +08:00
grammar.js fix: trailing whitespaces are allowed for local_time (#3) 2019-08-21 09:13:14 +08:00
index.js feat: initial implementation 2019-08-18 18:30:34 +08:00
LICENSE feat: initial implementation 2019-08-18 18:30:34 +08:00
package.json chore(release): 0.1.2 2019-08-20 15:03:41 +08:00
README.md docs(readme): prettify example output 2019-08-18 21:21:14 +08:00
yarn.lock refactor: replace external tokens with internal ones 2019-08-19 23:58:20 +08:00

tree-sitter-toml

npm build

TOML (spec v0.5.0) grammar for tree-sitter

Changelog

Install

npm install tree-sitter-toml tree-sitter

Usage

const Parser = require("tree-sitter");
const TOML = require("tree-sitter-toml");

const parser = new Parser();
parser.setLanguage(TOML);

const sourceCode = `
  [hello]
  world = true
`;

const tree = parser.parse(sourceCode);
console.log(tree.rootNode.toString());
// (root
//   (table
//     (key)
//     (pair (key) (boolean))))

License

MIT © Ika