diff --git a/Makefile/Makefile.sublime-syntax b/Makefile/Makefile.sublime-syntax index 3cc3a97ef66..7093cea0ed6 100644 --- a/Makefile/Makefile.sublime-syntax +++ b/Makefile/Makefile.sublime-syntax @@ -325,17 +325,19 @@ contexts: set: # I don't like putting the string "source.shell" here, as the delegation # seeps into this syntax now. But I don't see a cleaner way right now. - - meta_scope: source.shell comment.line.number-sign.shell + - meta_scope: source.shell.embedded comment.line.number-sign.shell - include: comments-pop-on-line-end # Otherwise, delegate to the shell syntax (with various extra prototypes). - - match: "" - set: scope:source.shell + - match: '' + set: shell-body with_prototype: - - include: pop-on-line-end - - include: scope:source.shell#prototype - - include: line-continuation - include: variable-substitutions + shell-body: + - meta_scope: source.shell.embedded + - include: embedded-shell + - include: pop-on-line-end + line-continuation: - match: (\\)([ ]*)$\n? captures: @@ -523,7 +525,7 @@ contexts: scope: keyword.other.block.end.makefile pop: true - match: '' - push: scope:source.shell + push: shell-body with_prototype: - match: (?=\)) pop: true @@ -563,10 +565,9 @@ contexts: set: - match: '!=' scope: keyword.operator.assignment.makefile - set: scope:source.shell + set: shell-body with_prototype: - include: variable-substitutions - - include: pop-on-line-end - include: textual-parenthesis-balancer - match: (?=\s*(!|\?|\+|::?)?=) set: @@ -592,14 +593,18 @@ contexts: captures: 1: meta.string.makefile string.unquoted.makefile 2: meta.string.makefile meta.interpolation.makefile punctuation.section.interpolation.begin.makefile - embed: scope:source.shell - embed_scope: meta.string.makefile meta.interpolation.makefile + embed: embedded-shell + embed_scope: meta.string.makefile meta.interpolation.makefile source.shell.embedded escape: (?!<\\)\2 escape_captures: 0: meta.string.makefile meta.interpolation.makefile punctuation.section.interpolation.end.makefile - match: '' set: value-to-be-defined + embedded-shell: + - include: scope:source.shell + apply_prototype: true + value-to-be-defined: - meta_content_scope: meta.string.makefile string.unquoted.makefile - include: escape-literals diff --git a/Makefile/syntax_test_makefile.mak b/Makefile/syntax_test_makefile.mak index 95104595915..879874ec19a 100644 --- a/Makefile/syntax_test_makefile.mak +++ b/Makefile/syntax_test_makefile.mak @@ -289,6 +289,12 @@ sources := $($(a1)_objects:.o=.c) # ^^ string variable # ^ string variable keyword.other.block.end +.build/vernum: ../meta/version + sed -i.bak 's/.*automatically updated.*/version = "$(VER)" # automatically updated/' setup.py +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.body.makefile source.shell.embedded meta.function-call +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.single - comment +# ^^^^^^ variable.parameter.makefile + CC=g++ #<- variable.other # ^ keyword.operator.assignment @@ -924,11 +930,11 @@ TESTTOOL = sh -c '\ # ^^^ meta.string.makefile meta.interpolation.makefile # ^^^^^^ string.unquoted.makefile # ^ punctuation.section.interpolation.begin.makefile -# ^ source.shell punctuation.separator.continuation.line.shell +# ^ source.shell.embedded punctuation.separator.continuation.line.shell - source.shell source.shell if something; then build_thisway $$1 $$2; fi' TESTTOOL # ^^^ meta.string.makefile meta.interpolation.makefile # ^^^^^^^^^ meta.string.makefile string.unquoted.makefile - meta.interpolation -# ^^ source.shell keyword.control.conditional.end.shell +# ^^ source.shell.embedded keyword.control.conditional.end.shell - source.shell source.shell # ^ punctuation.section.interpolation.end.makefile