diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-10-31 15:05:17 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-10-31 15:05:17 -0700 |
| commit | 7a35e38d8778670fe0662f203e82638355db3bba (patch) | |
| tree | cc9f813d1350f23d2b81a81b18f4f127668bfec9 /nomnom/source.nom | |
| parent | f43d8c58f755a7f208d84b43071490ab356c5ac8 (diff) | |
Renamed (action %) -> (%'s meaning)
Diffstat (limited to 'nomnom/source.nom')
| -rw-r--r-- | nomnom/source.nom | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/nomnom/source.nom b/nomnom/source.nom index e05b314..c36216f 100644 --- a/nomnom/source.nom +++ b/nomnom/source.nom @@ -1,24 +1,28 @@ +#!/usr/bin/env nomsu -V4.8.10 use "lib/object.nom" object (Source): - action [Source from text %text]: + externally (Source from text %text) means: %match = (%text::matching groups "^@(.-)%[(%d+):(%d+)%]$") set {%filename:%match.1, %start:%match.2, %stop:%match.3} unless %filename: %match = (%text::matching groups "^@(.-)%[(%d+)%]$") set {%filename:%match.1, %start:%match.2} - return (Source {filename:%filename, start:(%start or 1) as number, stop: %stop as number}) - + + return (..) + Source {filename:%filename, start:(%start or 1) as number, stop:%stop as number} + my action [as text] "\ ..@\(%me.filename)[\(%me.start)\(":\(%me.stop)" if %me.stop else "")]" - my action [as lua] "\ - ..Source{filename=\(%me.filename::as lua), start=\(%me.start)\ - ..\(", stop=\(%me.stop)" if %stop else "")}" - + ..Source{filename=\(%me.filename::as lua), start=\(%me.start)\(..) + ", stop=\(%me.stop)" if %stop else "" + ..}" + my action [as nomsu] "\ - ..(Source {filename:\(%me.filename::as nomsu), start:\(%me.start)\ - ..\(", stop:\(%me.stop)" if %stop else "")})" + ..(Source {filename:\(%me.filename::as nomsu), start:\(%me.start)\(..) + ", stop:\(%me.stop)" if %stop else "" + ..})" my action [== %other] (..) all of [..] @@ -26,24 +30,25 @@ object (Source): %me.filename == %other.filename %me.start == %other.start %me.stop == %other.stop - + my action [< %other]: assume %me.filename == %other.filename if (%start == %other.start): return ((%me.stop or %me.start) < (%other.stop or %other.start)) ..else: return (%me.start < %other.start) - + my action [<= %other]: assume %me.filename == %other.filename if (%start == %other.start): return ((%me.stop or %me.start) <= (%other.stop or %other.start)) ..else: return (%me.start <= %other.start) - + my action [+ %offset]: if ((type of %me) == "number"): set {%me:%offset, %offset:%me} ..else: assume (type of %offset) == "number" + return (Source {filename:%me.filename, start:%me.start + %offset, stop:%me.stop}) |
