tree-sitter-hit

0.4.0 • Public • Published

tree-sitter-hit

Badge: npm version badge for package tree-sitter-hit Build Status

Grammar for incrementally parsing the MOOSE HIT (hierarchical input text) file format.

HIT is being developed by the Idaho National Laboratory as part of the MOOSE finite element framework to provide an open-source LGPL licensed alternative to the getpot library.

HIT syntax

HIT is a key value pairs in nested blocks syntax.

[Parent]
  [Child]
     key = value
  []
[]

Blocks are opened by specifying a block name in square brackets ([Parent]). An opened block is closed with a pair of empty square brackets ([]). Blocks can be nested. A given file can have an arbitrary number of top-level blocks.

Key / value pairs are separated by an = sign. Values can be single- or double-quoted strings that can span multiple lines. For values that do not contain any white space the quotes can be omitted. Key / value pairs can appear at any level in the block hierarchy including the top-level.

This module parses the HIT syntax at a coarse level, no type checking of values is performed and every value is captures as a string.

Applications that utilize HIT (such as the MOOSE framework) may choose to assign special meaning to block names. MOOSE interprets block names and parameter keys as paths that are appended through the hierarchy. This is outside the scope of this parser.

Package Sidebar

Install

npm i tree-sitter-hit

Weekly Downloads

5

Version

0.4.0

License

LGPL

Unpacked Size

77.4 kB

Total Files

16

Last publish

Collaborators

  • dschwen