Skip to content

Commit

Permalink
Add source_file() and source_directory()
Browse files Browse the repository at this point in the history
  • Loading branch information
laniakea64 committed May 25, 2024
1 parent 65f66b0 commit 3f35b20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syntax/just.vim
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ syn match justFunctionCall "\v\w+%(\s|\\\n)*\(@=" transparent contains=justBuilt

" error() is intentionally not included in this list
syn keyword justBuiltInFunction
\ absolute_path append arch blake3 blake3_file cache_directory canonicalize capitalize choose clean config_directory config_local_directory data_directory data_local_directory encode_uri_component env env_var env_var_or_default executable_directory extension file_name file_stem home_directory invocation_directory invocation_directory_native join just_executable justfile justfile_directory just_pid kebabcase lowercamelcase lowercase num_cpus os os_family parent_directory path_exists prepend quote replace replace_regex semver_matches sha256 sha256_file shell shoutykebabcase shoutysnakecase snakecase titlecase trim trim_end trim_end_match trim_end_matches trim_start trim_start_match trim_start_matches uppercamelcase uppercase uuid without_extension
\ absolute_path append arch blake3 blake3_file cache_directory canonicalize capitalize choose clean config_directory config_local_directory data_directory data_local_directory encode_uri_component env env_var env_var_or_default executable_directory extension file_name file_stem home_directory invocation_directory invocation_directory_native join just_executable justfile justfile_directory just_pid kebabcase lowercamelcase lowercase num_cpus os os_family parent_directory path_exists prepend quote replace replace_regex semver_matches sha256 sha256_file shell shoutykebabcase shoutysnakecase snakecase source_directory source_file titlecase trim trim_end trim_end_match trim_end_matches trim_start trim_start_match trim_start_matches uppercamelcase uppercase uuid without_extension
\ contained

syn match justUserDefinedError "\v%(assert|error)%(%(\s|\\\n)*\()@="
Expand Down
2 changes: 2 additions & 0 deletions tests/cases/expressions.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@
_true <span class="Operator">:=</span> <span class="Exception">assert</span>(<span class="String">'1'</span> <span class="Operator">!=</span> <span class="String">'0'</span>, <span class="String">'1 is not 0'</span>)

shell_command <span class="Operator">:=</span> <span class="Function">shell</span>(<span class="String">'echo "$@"'</span>, _true, random1)

this_source <span class="Operator">:=</span> <span class="Function">source_directory</span>() <span class="Operator">+</span> <span class="String">"</span><span class="Special">\n</span><span class="String"> -&gt; "</span> <span class="Operator">+</span> <span class="Function">source_file</span>()
2 changes: 2 additions & 0 deletions tests/cases/expressions.just
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ shell_expanded5 := x'''
_true := assert('1' != '0', '1 is not 0')

shell_command := shell('echo "$@"', _true, random1)

this_source := source_directory() + "\n -> " + source_file()

0 comments on commit 3f35b20

Please sign in to comment.