From 9d82d522c17493ad3016ca0678a951485067408f Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 11 Nov 2018 16:26:38 -0800 Subject: Fixed some autoformatting stuff, and prepping to deprecate some math shorthand. --- tools/autoformat.nom | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/autoformat.nom') 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: -- cgit v1.2.3