Skip to content

Commit e6ebb9d

Browse files
tausbnCopilot
andcommitted
yeast: Add yeast test suite
12 tests covering parsing, queries, tree building, desugaring rules, cursor navigation, and the shorthand rule! syntax. Tests use a custom output node-types.yml with named fields for all children (parameter, stmt, index), loaded via schema_from_yaml_with_language. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3119f07 commit e6ebb9d

2 files changed

Lines changed: 454 additions & 0 deletions

File tree

shared/yeast/tests/node-types.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Output node types for yeast test rules.
2+
# Inspired by tree-sitter-ruby, but with all children in named fields
3+
# (no unnamed children). This represents the desugared output schema.
4+
5+
named:
6+
program:
7+
stmt*: [assignment, call, identifier, for]
8+
9+
assignment:
10+
left: [identifier, left_assignment_list]
11+
right: [identifier, integer, call, element_reference]
12+
13+
left_assignment_list:
14+
item*: identifier
15+
16+
element_reference:
17+
object: identifier
18+
index: [integer, identifier]
19+
20+
for:
21+
pattern: [identifier, left_assignment_list]
22+
value: in
23+
body: do
24+
25+
in:
26+
value: [identifier, call]
27+
28+
do:
29+
stmt*: [assignment, identifier, call]
30+
31+
call:
32+
receiver: [identifier, call]
33+
method: identifier
34+
arguments?: argument_list
35+
block?: block
36+
37+
argument_list:
38+
argument*: [identifier, integer, call]
39+
40+
block:
41+
parameters: block_parameters
42+
body: block_body
43+
44+
block_parameters:
45+
parameter*: identifier
46+
47+
block_body:
48+
stmt*: [assignment, identifier, call]
49+
50+
identifier:
51+
integer:
52+
53+
unnamed:
54+
- "="
55+
- ","
56+
- "("
57+
- ")"
58+
- "for"
59+
- "in"
60+
- "do"
61+
- "end"
62+
- "|"
63+
- "."

0 commit comments

Comments
 (0)