diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-29 15:59:30 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-29 16:00:04 -0700 |
| commit | 811fdd685670d2eb8c6bcb9e6e103e57bf402ca8 (patch) | |
| tree | c599fd7a609159c2ec50a30f1131000070e8eb03 /tools | |
| parent | 22495c7d708b4950b83c5bc9b97806e19cd1fcfa (diff) | |
Tweaked version 3.6 to include deprecating list append/removal functions
in favor of using a method call style.
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/autoformat.nom | 2 | ||||
| -rwxr-xr-x | tools/replace.nom | 9 | ||||
| -rwxr-xr-x | tools/test.nom | 4 | ||||
| -rwxr-xr-x | tools/upgrade.nom | 4 |
4 files changed, 10 insertions, 9 deletions
diff --git a/tools/autoformat.nom b/tools/autoformat.nom index 6c4420a..719b826 100755 --- a/tools/autoformat.nom +++ b/tools/autoformat.nom @@ -11,7 +11,7 @@ use "lib/os.nom" %inplace = (no) if (%args.1 is "-i"): %inplace = (yes) - remove index 1 from %args + %args::remove index 1 for %path in %args: for file %filename in %path: diff --git a/tools/replace.nom b/tools/replace.nom index 4557c2c..3140675 100755 --- a/tools/replace.nom +++ b/tools/replace.nom @@ -11,14 +11,14 @@ use "lib/os.nom" %inplace = (no) if (%args.1 is "-i"): %inplace = (yes) - remove index 1 from %args + %args::remove index 1 if ((length of %args) < 3): say "Usage: nomsu tools/replace.nom [-i] tree_to_replace replacement files..." lua> "os.exit(1)" -%pattern = (parse (remove index 1 from %args)) -%replacement = (parse (remove index 1 from %args)) +%pattern = (parse (%args::remove index 1)) +%replacement = (parse (%args::remove index 1)) for %path in %args: for file %filename in %path: unless (any [%filename matches "%.nom$", %filename == "-", %filename == "stdin"]): @@ -28,7 +28,7 @@ for %path in %args: if (%tree2 == %tree): say "No changes in \%filename" do next %filename - + %text = ".." #!/usr/bin/env nomsu -V\(%tree.version or (Nomsu version)) \(%tree2 as nomsu) @@ -37,4 +37,5 @@ for %path in %args: %inplace: say "Replaced in \%filename" write %text to file %filename + else: say %text diff --git a/tools/test.nom b/tools/test.nom index 7a1ee1e..2446069 100755 --- a/tools/test.nom +++ b/tools/test.nom @@ -8,7 +8,7 @@ use "lib/consolecolor.nom" %args = (command line args) if (%args.1 == "-v"): - remove index 1 from %args + %args::remove index 1 %verbose = (yes) # Make sure all the files get run @@ -24,7 +24,7 @@ for %path in (command line args): %file_tests = [] for %src = %test in %tests: if (%src.filename == %filename): - add {test:%test, source:%src} to %file_tests + %file_tests::add {test:%test, source:%src} unless (%file_tests is empty): sort %file_tests by % -> %.source diff --git a/tools/upgrade.nom b/tools/upgrade.nom index c74b8e7..4676f77 100755 --- a/tools/upgrade.nom +++ b/tools/upgrade.nom @@ -12,12 +12,12 @@ use "lib/os.nom" %inplace = (no) if (%args.1 is "-i"): %inplace = (yes) - remove index 1 from %args + %args::remove index 1 if (%args.1 is "-t"): use "lib/consolecolor.nom" %test = (yes) - remove index 1 from %args + %args::remove index 1 for %path in %args: for file %filename in %path: |
