From d77886e9e237bb89bcae1360a16166bac9ace617 Mon Sep 17 00:00:00 2001 From: laniakea64 Date: Thu, 21 Dec 2023 13:08:09 -0500 Subject: [PATCH] Add `import` statement --- syntax/just.vim | 3 +++ tests/cases/import.html | 7 +++++++ tests/cases/import.just | 7 +++++++ tests/cases/tricky.html | 4 ++-- tests/cases/tricky.just | 4 ++-- 5 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 tests/cases/import.html create mode 100644 tests/cases/import.just diff --git a/syntax/just.vim b/syntax/just.vim index 3a5163b..aba0c05 100644 --- a/syntax/just.vim +++ b/syntax/just.vim @@ -242,6 +242,8 @@ syn match justOperator "\v\=[=~]|!\=|[+/]" syn cluster justExprBase contains=@justAllStrings,justConditional,justConditionalBraces,justOperator syn cluster justExpr contains=@justExprBase,@justBuiltInFunctions,justBuiltInFunctionArgs,justReplaceRegex +syn match justImport /\v^import\ze%(\s|\\\n)+['"]@=/ + syn match justOldInclude "^!include\s.*$" contains=justOldIncludeDirective syn match justOldIncludeDirective "^!include" contained @@ -258,6 +260,7 @@ hi def link justConditional Conditional hi def link justCurlyBraces Special hi def link justExport Statement hi def link justFunction Function +hi def link justImport Include hi def link justIndentError Error hi def link justInterpolation Normal hi def link justInterpolationDelim Delimiter diff --git a/tests/cases/import.html b/tests/cases/import.html new file mode 100644 index 0000000..210c500 --- /dev/null +++ b/tests/cases/import.html @@ -0,0 +1,7 @@ +import 'recipes-simple.just' + +import\ +'line-continuations.just' + +import """ + tricky.just""" diff --git a/tests/cases/import.just b/tests/cases/import.just new file mode 100644 index 0000000..3ebc3d2 --- /dev/null +++ b/tests/cases/import.just @@ -0,0 +1,7 @@ +import 'recipes-simple.just' + +import\ +'line-continuations.just' + +import """ + tricky.just""" diff --git a/tests/cases/tricky.html b/tests/cases/tricky.html index 5a40e61..36e5929 100644 --- a/tests/cases/tricky.html +++ b/tests/cases/tricky.html @@ -33,10 +33,10 @@ valid_uuid + testing } else { '' } -test: +back2back_interpolations: echo {{something}}{{testing}} -test2: +interp_immediately_after_string: #!/usr/bin/env python3 print(''{{quote(something)}}''.split("T")) diff --git a/tests/cases/tricky.just b/tests/cases/tricky.just index 0e05e8a..67d9847 100644 --- a/tests/cases/tricky.just +++ b/tests/cases/tricky.just @@ -33,10 +33,10 @@ conditional_without_indent := if env('SHELL') == '/bin/bash' { valid_uuid + testing } else { '' } -test: +back2back_interpolations: echo {{something}}{{testing}} -test2: +interp_immediately_after_string: #!/usr/bin/env python3 print(''{{quote(something)}}''.split("T"))