Skip to content

Commit

Permalink
Fix complex recipe dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nk9 committed Dec 26, 2022
1 parent 0a31151 commit 01c66d2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Just.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,23 @@ contexts:
- include: else-pop

recipe-dependency-with-args:
- match: \(
scope: punctuation.section.group.begin.just
push: recipe-dependency-with-args-body

recipe-dependency-with-args-body:
- meta_scope: meta.group.just
- match: '\b{{valid_name}}'
scope: entity.name.function.just
push:
- include: just-expressions
- include: else-pop
- include: recipe-dependency-group-end

recipe-dependency-group-end:
- match: \)
scope: punctuation.section.group.end.just
pop: 1
- match: '(\()\s*({{valid_name}})\b'
captures:
1: punctuation.section.group.begin.just
2: entity.name.function.just
- include: just-expressions
- include: else-pop
pop: 2 # End dependency group


###[ RECIPE CONTENTS ]#########################################################
Expand Down
15 changes: 15 additions & 0 deletions tests/syntax_test_just.recipe_declaration.just
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,18 @@ alias-name:
export-name:
# <- meta.function.just entity.name.function.just
#^^^^^^^^^^ meta.function.just entity.name.function.just

build platform host *args:

hostname := 'host'

_build-toplevel platform *args: (
# ^ punctuation.section.group.begin.just
build (platform) (hostname + '.config.system.build.toplevel') (args)
# ^^^^^ entity.name.function.just
# ^^^^^^^^^^ meta.group.just
# ^^^^^^^^ variable.other.just
)
# <- punctuation.section.group.end.just
follow-function:
# <- meta.function.just entity.name.function.just

0 comments on commit 01c66d2

Please sign in to comment.