mirror of
https://github.com/hanzoai/ast.git
synced 2026-11-02 19:28:21 +00:00
16 lines
291 B
JavaScript
16 lines
291 B
JavaScript
// This grammar has an "extra" rule, `comment`, that is a non-terminal.
|
|
|
|
module.exports = grammar({
|
|
name: "extra_non_terminals",
|
|
|
|
extras: $ => [
|
|
/\s/,
|
|
$.comment,
|
|
],
|
|
|
|
rules: {
|
|
module: $ => seq('a', 'b', 'c', 'd'),
|
|
comment: $ => seq('(', repeat(/[a-z]+/), ')'),
|
|
}
|
|
})
|