From ec69ee6f62016a2edcc13e3183cbe4cadd75717f Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 30 Dec 2018 23:56:28 -0800 Subject: Fixes for: indented strings ending in ", peeking at code object text before modifying them, and major upgrades to the nomsu codegen, including support for indented inline arguments (instead of using "\n..") and just generally better line wrapping, including finally good rules for when to use indented text (for almost all cases). --- tools/format.nom | 2 +- tools/upgrade.nom | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/format.nom b/tools/format.nom index 76c4981..7d9d1d4 100755 --- a/tools/format.nom +++ b/tools/format.nom @@ -19,7 +19,7 @@ for $filename in $filenames: $file = (read file $filename) unless $file: barf "File does not exist: \$filename" - $leading_indent = ($file, matching "[\n]*([ ]*)") + $leading_indent = ($file, matching "\n*([ ]*)") $code = (NomsuCode from ($Source $filename 1 (size of $file)) $file) try: $tree = ($code parsed) diff --git a/tools/upgrade.nom b/tools/upgrade.nom index f335dc0..23716a2 100755 --- a/tools/upgrade.nom +++ b/tools/upgrade.nom @@ -19,7 +19,7 @@ for $filename in $(COMMAND LINE ARGS).extras: $file = (read file $filename) unless $file: barf "File does not exist: \$filename" - $leading_indent = ($file, matching "[\n]*([ ]*)") + $leading_indent = ($file, matching "\n*([ ]*)") $code = (NomsuCode from (Source $filename 1 (size of $file)) $file) $tree = ($code parsed $start_version) $uptree = -- cgit v1.2.3