These tests are easier to write and maintain if the grammars are just JS, like grammars normally are. It doesn't slow the tests down significantly to shell out to `node` for each of these grammars.
18 lines
No EOL
335 B
JavaScript
18 lines
No EOL
335 B
JavaScript
module.exports = grammar({
|
|
name: 'associativity_missing',
|
|
|
|
rules: {
|
|
expression: $ => choice(
|
|
$.math_operation,
|
|
$.identifier
|
|
),
|
|
|
|
math_operation: $ => seq(
|
|
$.expression,
|
|
'+',
|
|
$.expression,
|
|
),
|
|
|
|
identifier: $ => /[a-z]+/,
|
|
}
|
|
}); |