aboutsummaryrefslogtreecommitdiff
path: root/lib/tools/replace.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-03-27 15:22:46 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-03-27 15:22:46 -0700
commita1849da175765350e013bdeecfa4e0ad3c066937 (patch)
tree616a115790271757148044e2b3228fb715c00726 /lib/tools/replace.nom
parentbb07e6724118c431c3beed4060776678128905a1 (diff)
Autoformat (mostly just to do with the new
blank-line-after-end-of-multi-indent-block rule
Diffstat (limited to 'lib/tools/replace.nom')
-rwxr-xr-xlib/tools/replace.nom5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/tools/replace.nom b/lib/tools/replace.nom
index aea1b03..fe07140 100755
--- a/lib/tools/replace.nom
+++ b/lib/tools/replace.nom
@@ -1,5 +1,4 @@
#!/usr/bin/env nomsu -V7.0.0
-
###
This is a tool to replace syntax trees with something new.
@@ -63,6 +62,7 @@ command line program with $args:
..else:
$substitution_values.($patt.1) = $tree
return $substitution_values
+
($tree.type != $patt.type): return (nil)
($tree.type == "Action"):
if (($tree, get stub) != ($patt, get stub)): return (nil)
@@ -135,6 +135,7 @@ command line program with $args:
if ($user_answers.$t == "n"): return (nil)
$replaced.$t = (yes)
return $ret
+
$tree2 = ($tree with replacements)
if $args.i:
if (#$user_answers > 0): say ""
@@ -145,4 +146,4 @@ command line program with $args:
if (#$replaced > 0):
write "\($tree2 as nomsu)" to file $filename
..else:
- say ($tree2 as nomsu)
+ say ($tree2 as nomsu) \ No newline at end of file