OpenModelica / tree-sitter-modelica

A tree-sitter parser for Modelica
Other
3 stars 5 forks source link

Add tests for all rules #1

Closed AnHeuermann closed 1 year ago

AnHeuermann commented 1 year ago

Add tests for all grammar features defined in grammar.js to test/corpus, see https://tree-sitter.github.io/tree-sitter/creating-parsers#command-test.

For example test/corpus/records_01.txt

====================
Record definition 01
====================

record RECORD_A
  Real x;
  Integer y;
end RECORD_A;

---

(source_file
  record: (record_definition
    (record_statement
      name: (identifier))
    (type_declaration
      (real_type)
      (identifier))
    (type_declaration
      (integer_type)
      (identifier))
    (_end_of_statement
      (identifier))))

(Or however the resulting tree should look like)