Skip to content

anistark/tree-sitter-csv

Repository files navigation

tree-sitter-csv

The CSV grammar used by Blue CSV.

Nodes

  • file — top-level.
  • row — one record.
  • field_1 .. field_10 — positional wrappers for the first ten cells in a row. Each wraps a quoted_field or unquoted_field. Positional nodes drive rainbow-column highlighting.
  • field_overflow — every cell past the tenth in a row, same wrapper shape.
  • quoted_field — double-quoted, supports escaped quotes ("") and embedded newlines.
  • unquoted_field — everything else up to the next ,, \r, or \n.

Build

npm install
npm run generate
npm test

Prior art

tree-sitter-grammars/tree-sitter-csv is a generic CSV grammar with a single field node type. This one diverges by emitting field_1..field_10 / field_overflow so rainbow-column highlighting works through tree-sitter queries alone, without runtime column counting.

License

MIT. See the LICENSE in the repo root.

About

CSV grammar for tree-sitter

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors