tree-sitter-dust/grammar.js

24 lines
393 B
JavaScript
Raw Normal View History

2023-08-22 21:02:40 +00:00
module.exports = grammar({
name: 'Dust',
rules: {
source_file: $ => repeat(choice($.comment, $.expression)),
comment: $ => /(#)(.+?)([\n\r])/,
expression: $ => choice(
$.identifier
// TODO: other kinds of definitions
),
identifier: $ => /[a-zA-Z]+(_[a-zA-Z]+)*/,
operator: $ => choice(
'=',
"+",
),
integer: $ => /\d/,
}
});