Add some cmake grammars
This commit is contained in:
parent
ed551214e2
commit
a2efc82ccd
20
grammar.js
20
grammar.js
|
@ -2,6 +2,24 @@ module.exports = grammar({
|
|||
name: 'CMake',
|
||||
|
||||
rules: {
|
||||
source_file: $ => 'hello'
|
||||
source_file: $ => repeat($.command_invocation),
|
||||
|
||||
line_ending: $ => $.newline,
|
||||
space: $ => /[ \t]+/,
|
||||
newline: $ => /\n/,
|
||||
identifier: $ => /[A-Za-z_][A-Za-z0-9_]*/,
|
||||
argument: $ => /[^ ()#\"\\]+/,
|
||||
|
||||
command_invocation: $ => seq(
|
||||
repeat($.space),
|
||||
$.identifier,
|
||||
repeat($.space),
|
||||
$.parameter_list,
|
||||
),
|
||||
parameter_list: $ => seq(
|
||||
'(',
|
||||
repeat($.argument),
|
||||
')'
|
||||
)
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue