diff options
Diffstat (limited to 'tools/autoformat.nom')
| -rwxr-xr-x | tools/autoformat.nom | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/autoformat.nom b/tools/autoformat.nom index f236ca4..b15f4ce 100755 --- a/tools/autoformat.nom +++ b/tools/autoformat.nom @@ -1,7 +1,7 @@ #!/usr/bin/env nomsu -V4.10.12.7 # Auto-format Nomsu code. Usage: - nomsu tools/autoformat.nom [-i] file1 file2 directory1 ... + nomsu tools/autoformat.nom [-i] file1 file2 directory1 ... If the first argument is "-i", modifications will be performed in-place. Otherwise, the formatted code will be printed. @@ -18,10 +18,10 @@ if (%args.1 is "-i"): for %path in %args: for file %filename in %path: unless (%filename::matches "%.nom$"): do next %filename - %formatted = "\ - ..#!/usr/bin/env nomsu -V\(Nomsu version) - \((parse (read file %filename) from %filename) as nomsu)" - + %contents = (read file %filename) + %code = (%NomsuCode::from (Source %filename 1 (size of %contents)) %contents) + %tree = (%code parsed) + %formatted = ((%tree as nomsu)::text) if %inplace: write %formatted to file %filename ..else: |
