@@ -19,15 +19,94 @@ file_extensions:
1919variables :
2020 valid_name : ' [a-zA-Z_][a-zA-Z0-9_-]*'
2121 built_in_functions : |-
22- (?x: absolute_path | arch | capitalize | clean | env_var_or_default | env_var
23- | error | extension | file_name | file_stem | invocation_directory_native
24- | invocation_directory | join | just_executable | justfile_directory | justfile
25- | kebabcase | lowercamelcase | lowercase | os_family | os | parent_directory
26- | path_exists | quote | replace_regex | replace | sha256_file | sha256
27- | shoutykebabcase | shoutysnakecase | snakecase | titlecase
28- | trim_end_matches | trim_end_match | trim_end | trim_start_matches
29- | trim_start_match | trim_start | trim | uppercase | uppercamelcase
30- | uuid | without_extension )
22+ (?x:
23+ absolute_path
24+ | append
25+ | arch
26+ | blake3
27+ | blake3_file
28+ | cache_dir
29+ | cache_directory
30+ | canonicalize
31+ | capitalize
32+ | choose
33+ | clean
34+ | config_dir
35+ | config_directory
36+ | config_local_dir
37+ | config_local_directory
38+ | data_dir
39+ | data_directory
40+ | data_local_dir
41+ | data_local_directory
42+ | datetime
43+ | datetime_utc
44+ | encode_uri_component
45+ | env
46+ | env_var
47+ | env_var_or_default
48+ | error
49+ | executable_dir
50+ | executable_directory
51+ | extension
52+ | file_name
53+ | file_stem
54+ | home_dir
55+ | home_directory
56+ | invocation_dir
57+ | invocation_dir_native
58+ | invocation_directory
59+ | invocation_directory_native
60+ | is_dependency
61+ | join
62+ | just_executable
63+ | just_pid
64+ | justfile
65+ | justfile_dir
66+ | justfile_directory
67+ | kebabcase
68+ | lowercamelcase
69+ | lowercase
70+ | module_dir
71+ | module_directory
72+ | module_file
73+ | num_cpus
74+ | os
75+ | os_family
76+ | parent_dir
77+ | parent_directory
78+ | path_exists
79+ | prepend
80+ | quote
81+ | read
82+ | replace
83+ | replace_regex
84+ | require
85+ | semver_matches
86+ | sha256
87+ | sha256_file
88+ | shell
89+ | shoutykebabcase
90+ | shoutysnakecase
91+ | snakecase
92+ | source_dir
93+ | source_directory
94+ | source_file
95+ | style
96+ | titlecase
97+ | trim
98+ | trim_end
99+ | trim_end_match
100+ | trim_end_matches
101+ | trim_start
102+ | trim_start_match
103+ | trim_start_matches
104+ | uppercamelcase
105+ | uppercase
106+ | uuid
107+ | which
108+ | without_extension
109+ )
31110 boolean_settings : |-
32111 (?x: allow-duplicate-recipes | dotenv-load | export | fallback | ignore-comments
33112 | positional-arguments | windows-powershell )
@@ -49,7 +128,7 @@ contexts:
49128 - include : aliases
50129 - include : comments
51130 - include : assignment
52- - include : recipe-attribute
131+ - include : recipe-attributes
53132 - include : recipe-definition
54133 - include : recipe-generic-line
55134
@@ -301,9 +380,32 @@ contexts:
301380# ##[ RECIPE DEFINITION ]#######################################################
302381# Recipe definition lines, including attributes, arguments and dependencies
303382
304- recipe-attribute :
305- - match : ^\[\s*({{recipe_attributes}})\s*\]\s*$ # Only one attribute allowed per line
383+ recipe-attributes :
384+ - match : ^\[
306385 scope : meta.annotation.just variable.annotation.just
386+ push :
387+ - recipe-attributes-body
388+ - expect-recipe-attribute-name
389+ - include : eol-pop
390+
391+ recipe-attributes-body :
392+ - meta_scope : meta.sequence.list.just meta.annotation.just
393+ - match : \]
394+ scope : variable.annotation.just
395+ pop : 1
396+ - match : ' ,'
397+ scope : punctuation.separator.parameters.just
398+ push : expect-recipe-attribute-name
399+ - include : eol-pop
400+
401+ expect-recipe-attribute-name :
402+ - match : ({{recipe_attributes}})
403+ scope : variable.annotation.just
404+ pop : 1
405+ - match : \]
406+ scope : invalid.illegal.just
407+ pop : 2
408+ - include : else-pop
307409
308410 recipe-definition :
309411 - match : (?=^@?{{valid_name}}(?![^:]*:=)) # Matches '^recipeName' but not '^varName :='
@@ -508,6 +610,7 @@ contexts:
508610 push : settings-name
509611
510612 settings-name :
613+ - meta_scope : meta.setting-name.just
511614 - include : settings-boolean-name
512615 - include : settings-shell-name
513616 - include : settings-string-name
0 commit comments