indents added new language highlights added (#5777)

This commit is contained in:
r001 2023-12-10 11:16:24 +04:00 committed by GitHub
parent 7958ff9ec7
commit b6b9ca448b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 1 deletions

View file

@ -336,7 +336,7 @@
"revision": "8a841fb20ce683bfbb3469e6ba67f2851cfdf94a"
},
"leo": {
"revision": "23a9534d09d523d0dcee7dbf89e7c819e6835f6f"
"revision": "304611b5eaf53aca07459a0a03803b83b6dfd3b3"
},
"linkerscript": {
"revision": "f99011a3554213b654985a4b0a65b3b032ec4621"

View file

@ -131,6 +131,7 @@
[
(block_height)
(self_caller)
(self_signer)
] @constant.builtin
(free_function_call
@ -172,6 +173,7 @@
[
(address_literal)
(signature_literal)
((affine_group_literal) (#set! "priority" 101))
(field_literal)
(product_group_literal)

33
queries/leo/indents.scm Normal file
View file

@ -0,0 +1,33 @@
[
(record_declaration)
(struct_declaration)
(mapping_declaration)
(constant_declaration)
(return_statement)
(expression_statement)
(variable_declaration)
(loop_statement)
(assignment_statement)
(assert_statement)
(struct_expression)
(array_expression)
(tuple_expression)
(parenthesized_expression)
(items_block)
(block)
] @indent.begin
; if "if" statement and conditional statement are in separate lines
; conditional should be indented and when the conditional block
; starts dedented
(branch
(block "{" @indent.end)) @indent.begin
((function_parameters) @indent.align
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")"))
[
(comment)
(ERROR)
] @indent.auto