Skip to content

About

A tree-sitter grammar for gnuplot

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

 

History

245 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tree-sitter-gnuplot

CI codecov npm crates.io PyPI License: MIT PRs Welcome

A tree-sitter grammar for gnuplot 6.x.

Supports .gnuplot, .gp, .plt, .plot, .gnu files. Built with an external scanner for command disambiguation, comprehensive syntax highlighting queries, and 275 corpus tests.

This project is the next evolution of gnuplot.vim, designed for accuracy to gnuplot 6 syntax and long-term maintainability.

Node and field stability

Node type names and field names are the query API: highlights.scm, editor plugins and language servers match on them, and a change that leaves the schema valid can still make an existing query match nothing. Such changes are released as breaking.

Function plots bind their expression to the function field of plot_element. Earlier releases bound it to data, which is now used only for datafile and datablock sources, so a query written as (plot_element data: (function ...)) must become (plot_element function: (function ...)). Both fields already existed, so node-types.json remains backward compatible — only which field the parser populates changed.

The ! shell form now stores the whole logical line in (cmd_system (shell_command)), replacing its former expression children (identifier, string_literal, etc.). This requires a breaking release for consumers of that tree shape. The system <expression> form keeps its tree.

Backquotes are opaque command_substitution nodes in expressions and double-quoted strings; single-quoted strings keep them literal. Both these substitutions and shell_command inject their shell text as Bash. The parser does not expand shell output into generated commands or keywords.

Computed expressions (sin(x)*exp(-x), numbers, ternaries, sums, parenthesized forms) moved from data to function as well. data keeps string literals, datablocks, bare variable references and top-level . string concatenation.

About

A tree-sitter grammar for gnuplot

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages