Compare commits

..

6 commits

Author SHA1 Message Date
e4653b2535 WIP
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2024-04-09 13:12:10 +01:00
4727086526 WIP: Merge 'select_case' and 'default_case'
Not sure whether I like this change or not... IMO this might be too lax.
2024-04-09 13:11:53 +01:00
41d50aca38 Alias 'default_case' to 'select_case'
There's not much use in the node being a different name.
2024-04-09 13:09:48 +01:00
5082de5c7f Add 'default' alias
This makes it appear in the tree as a named node.
2024-04-09 13:08:02 +01:00
e711defc41 Hide 'select_cases' rule
It doesn't provide any more information to expose it.
2024-04-09 12:49:36 +01:00
ba2022d3c8 Add builtins highlighting
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2024-04-09 12:28:28 +01:00
8 changed files with 21 additions and 32 deletions

View file

@ -19,7 +19,7 @@ module.exports = grammar({
$.module,
),
line_comment: (_) => seq("//", /[^\n]*/),
line_comment: (_) => seq("//", /.*/),
block_comment: (_) => seq("/*", /[^*]*\*+([^/*][^*]*\*+)*/, '/'),

View file

@ -42,11 +42,11 @@
(identifier) @variable
(module
type: (identifier) @function.call)
type: (identifier) @module)
(module
(property
field: (identifier) @variable.parameter))
field: (identifier) @variable.member))
; }}}
; Built-ins {{{

2
src/grammar.json generated
View file

@ -30,7 +30,7 @@
},
{
"type": "PATTERN",
"value": "[^\\n]*"
"value": ".*"
}
]
},

View file

@ -85,23 +85,6 @@ Block comment with asterisks
--------------------------------------------------------------------------------
(source_file
(block_comment))
================================================================================
Block comment (multiline)
================================================================================
/*
This
is
a
long
comment
*/
--------------------------------------------------------------------------------
(source_file
(block_comment))

View file

@ -2,7 +2,13 @@ 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

View file

@ -1,21 +1,21 @@
foo {}
// <- function.call
// <- module
foo ()
// <- function.call
// <- module
foo {
// <- function.call
// <- module
field: 12,
// <- variable.parameter
// <- variable.member
another_field: 27,
// <- variable.parameter
// <- variable.member
}
foo (
// <- function.call
// <- module
field = 42,
// <- variable.parameter
// <- variable.member
done = false,
// <- variable.parameter
// <- variable.member
)

View file

@ -1,6 +1,6 @@
foo {
field: {
// <- variable.parameter
// <- variable.member
key: 42,
// <- property
},

View file

@ -11,5 +11,5 @@ select = 42
// Or module property
foo {
select: 42,
// <- variable.parameter
// <- variable.member
}