aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-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