Compare commits
8 commits
e4653b2535
...
295e3956a3
| Author | SHA1 | Date | |
|---|---|---|---|
| 295e3956a3 | |||
| ee37351e81 | |||
| 4da69807ad | |||
| 9049b4f4b9 | |||
| e0aa749e1b | |||
| f6e1266493 | |||
| be1e3f07d3 | |||
| 73b0797891 |
8 changed files with 32 additions and 21 deletions
|
|
@ -19,7 +19,7 @@ module.exports = grammar({
|
|||
$.module,
|
||||
),
|
||||
|
||||
line_comment: (_) => seq("//", /.*/),
|
||||
line_comment: (_) => seq("//", /[^\n]*/),
|
||||
|
||||
block_comment: (_) => seq("/*", /[^*]*\*+([^/*][^*]*\*+)*/, '/'),
|
||||
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@
|
|||
(identifier) @variable
|
||||
|
||||
(module
|
||||
type: (identifier) @module)
|
||||
type: (identifier) @function.call)
|
||||
|
||||
(module
|
||||
(property
|
||||
field: (identifier) @variable.member))
|
||||
field: (identifier) @variable.parameter))
|
||||
; }}}
|
||||
|
||||
; Built-ins {{{
|
||||
|
|
|
|||
2
src/grammar.json
generated
2
src/grammar.json
generated
|
|
@ -30,7 +30,7 @@
|
|||
},
|
||||
{
|
||||
"type": "PATTERN",
|
||||
"value": ".*"
|
||||
"value": "[^\\n]*"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -85,6 +85,23 @@ Block comment with asterisks
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(block_comment))
|
||||
|
||||
================================================================================
|
||||
Block comment (multiline)
|
||||
================================================================================
|
||||
|
||||
/*
|
||||
This
|
||||
is
|
||||
a
|
||||
long
|
||||
comment
|
||||
*/
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(block_comment))
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,7 @@ foo = select(soong_config_variable("my_namespace", "my_var"), {
|
|||
// ^ function.builtin
|
||||
"foo": unset,
|
||||
// ^ variable.builtin
|
||||
default: select(variant("VARIANT") {}),
|
||||
default: select(variant("VARIANT"), {}),
|
||||
// <- variable.builtin
|
||||
// ^ function.builtin
|
||||
})
|
||||
|
||||
/* Assigning to builtins is conveniently not allowed at runtime */
|
||||
unset = 12
|
||||
// <- variable.builtin
|
||||
default = 27
|
||||
// <- variable.builtin
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
foo {}
|
||||
// <- module
|
||||
// <- function.call
|
||||
|
||||
foo ()
|
||||
// <- module
|
||||
// <- function.call
|
||||
|
||||
foo {
|
||||
// <- module
|
||||
// <- function.call
|
||||
field: 12,
|
||||
// <- variable.member
|
||||
// <- variable.parameter
|
||||
another_field: 27,
|
||||
// <- variable.member
|
||||
// <- variable.parameter
|
||||
}
|
||||
|
||||
foo (
|
||||
// <- module
|
||||
// <- function.call
|
||||
field = 42,
|
||||
// <- variable.member
|
||||
// <- variable.parameter
|
||||
done = false,
|
||||
// <- variable.member
|
||||
// <- variable.parameter
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
foo {
|
||||
field: {
|
||||
// <- variable.member
|
||||
// <- variable.parameter
|
||||
key: 42,
|
||||
// <- property
|
||||
},
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@ select = 42
|
|||
// Or module property
|
||||
foo {
|
||||
select: 42,
|
||||
// <- variable.member
|
||||
// <- variable.parameter
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue