Dhall grammar for tree-sitter
This parser is designed for syntax highlighting and does not strictly follow the Dhall language semantics. My goal is for all valid Dhall expressions to parse to something sensible. An invalid expression parsing is fine, except when it is obviously wrong. To help with this, the output of the parser is checked with hand-written syntax trees for every Dhall successful parse test (current with dhall-lang commit 4fecb49) except:
- unit/ShebangA.dhall, unit/ShebangNixA.dhall: Handled by the text editor.
- unit/TrailingLineCommentWithoutNewlineA.dhall: Unclear how to test with tree-sitter.
These tests also serve as a reference for what syntax trees various Dhall expressions produce. A shell script (tests.sh) is used to check that all tests are included. There may be extra test cases besides the Dhall ones. Ideally, those would eventually get upstreamed.
- The Dhall Syntax Grammar - Dhall syntax is specified as an ABNF grammar based on RFC 5234.
- The Dhall Acceptance Tests - Tests provided by the Dhall authors to verify implementation correctness. The binary format parsing tests evaluate to is described here.
- Dhall Semantics - The complete specification of the dhall language, which all implementations are based on.
Copyright (C) jae beller, 2022.
Released under the MIT License. Test scenarios in test/corpus/ are copyright the Dhall authors and reproduced under the BSD-3-Clause License.