aboutsummaryrefslogtreecommitdiff
path: root/tools/find_action.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-09-26 12:45:08 -0700
committerBruce Hill <bruce@bruce-hill.com>2018-09-26 12:45:19 -0700
commit692fae5416ce1f2702b599ffb27b2e3d2235eba7 (patch)
tree12ae256ef5606251bc013935390fdef7e737d79d /tools/find_action.nom
parent28d0792e69bbb9c467c616eb3dc89a60085c35f2 (diff)
Incremental fixes and more nomnom ports.
Diffstat (limited to 'tools/find_action.nom')
-rwxr-xr-xtools/find_action.nom11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/find_action.nom b/tools/find_action.nom
index e6fe90a..8381855 100755
--- a/tools/find_action.nom
+++ b/tools/find_action.nom
@@ -15,12 +15,19 @@ for %path in %files:
unless (%filename::matches "%.nom$") (do next %filename)
%file = (read file %filename)
%tree = (parse %file from %filename)
+ %results = []
for %t in recursive %tree:
if (%t is "Action" syntax tree):
if (%t.stub is %stub):
%line_num = (line number of %t.source.start in %file)
- say (blue "\%filename:\%line_num:")
- say (yellow (source lines of %t))
+ %results::add {..}
+ line: %line_num
+ text: "\
+ ..\(blue "\%filename:\%line_num:")
+ \(yellow (source lines of %t))"
if (%t is syntax tree):
for %sub in %t: recurse %t on %sub
+ sort %results by % -> %.line
+ for % in %results:
+ say %.text