From f3c0eb146e91ffc3e9f592e350a3b948e2d57250 Mon Sep 17 00:00:00 2001 From: laniakea64 Date: Tue, 26 Dec 2023 08:52:55 -0500 Subject: [PATCH] Remove `justBuiltInFunctionsError` --- justfile | 5 ++++- syntax/just.vim | 20 ++++++++------------ tests/cases/invalid.html | 22 +++++----------------- tests/cases/invalid.just | 16 ++-------------- 4 files changed, 19 insertions(+), 44 deletions(-) diff --git a/justfile b/justfile index 9debb7d..5d0243b 100644 --- a/justfile +++ b/justfile @@ -69,7 +69,6 @@ update-last-changed *force: # Some functions are intentionally omitted from these lists because they're handled as special cases: # - error -# - replace_regex functionsWithArgs := ''' absolute_path capitalize @@ -88,6 +87,7 @@ functionsWithArgs := ''' path_exists quote replace + replace_regex semver_matches sha256 sha256_file @@ -120,6 +120,9 @@ zeroArgFunctions := ''' ''' allFunctions := functionsWithArgs + zeroArgFunctions +@functions: + echo $({{justq}} --evaluate allFunctions | sort) + # generate an optimized Vim-style "very magic" regex snippet from a list of literal strings to match optrx +strings: #!/usr/bin/env python3 diff --git a/syntax/just.vim b/syntax/just.vim index f062086..4d4f033 100644 --- a/syntax/just.vim +++ b/syntax/just.vim @@ -159,7 +159,7 @@ syn region justConditionalBraces start="\v\{\{@!" end="\v\}@=" transparent conta syn region justConditionalBracesInInterp start="\v\{\{@!" end="\v\}@=" transparent contained contains=@justExprInInterp syn match justLineLeadingSymbol "\v^%(\\\n)@3:= arch(foo) + os(foo) + os_family(foo) - -badfunc2 := invocation_directory(bar) / invocation_directory_native(bar) -badfunc3 := justfile_directory(bar) / justfile(bar, foo) - -badfunc4 := justfile ( - abc def -) - -badfunc5 := num_cpus(\) +badfunc5 := num_cpus(\) not_a_recipe_name #comment: not a recipe body -nonexistant_func := blahuuid() -nonexistant_func2 := blah_replace_regex('foo', '([^o])', '$1') - -not_a_recipe_start - not a recipe body -badfunc_in_interpolation: - {{just_executable(this)}} {{quote( uuid(random, foo) )}} +nonexistant_func := blahuuid() +nonexistant_func2 := blah_replace_regex('foo', '([^o])', '$1') invalid_recipe_body: echo 'My indentation mixes spaces and tabs!' @@ -50,6 +36,8 @@ echo 'valid again not valid' +not_a_recipe_start + not a recipe body bad_but_not_mixed_indentation: echo 'tab indent' echo 'space indent' diff --git a/tests/cases/invalid.just b/tests/cases/invalid.just index f618cab..46f0724 100644 --- a/tests/cases/invalid.just +++ b/tests/cases/invalid.just @@ -13,15 +13,6 @@ export FOO (the next line is not a recipe body)... this text should not be highlighted -badfunc1 := arch(foo) + os(foo) + os_family(foo) - -badfunc2 := invocation_directory(bar) / invocation_directory_native(bar) -badfunc3 := justfile_directory(bar) / justfile(bar, foo) - -badfunc4 := justfile ( - abc def -) - badfunc5 := num_cpus(\) not_a_recipe_name #comment: @@ -30,11 +21,6 @@ not_a_recipe_name #comment: nonexistant_func := blahuuid() nonexistant_func2 := blah_replace_regex('foo', '([^o])', '$1') -not_a_recipe_start - not a recipe body -badfunc_in_interpolation: - {{just_executable(this)}} {{quote( uuid(random, foo) )}} - invalid_recipe_body: echo 'My indentation mixes spaces and tabs!' echo 'My indentation mixes tabs and spaces!' @@ -50,6 +36,8 @@ invalid_recipe_body4: echo 'valid again not valid' +not_a_recipe_start + not a recipe body bad_but_not_mixed_indentation: echo 'tab indent' echo 'space indent'