summaryrefslogtreecommitdiffstats
path: root/tests/015/awk-rng.expected
Commit message (Collapse)AuthorAgeFilesLines
* awk: implement ranges right using functions.Kaz Kylheku2017-10-291-13/+13
| | | | | | | | | | | | | | | | | | | | * share/txr/stdlib/awk.tl (sys:awk%--rng, sys:awk%--rng-, sys:awk%rng+, sys:awk%-rng+, sys:awk%--rng+): New functions. (sys:awk-mac-let): Rewritten range expander. The four basic ranges rng, rng-, -rng and -rng- are handled with in-line expansion, because by doing that we avoid unnecessarily evaluating the from-expression. The remaining cases expand to function calls to the new functions, which receive the flag vector, the index position in that vector and the values of the from and to expressions. The behavior change is that that the -- forms now do the right thing: they hide all leading records that satisfy the from-expression, right to the last record of the range if necessary. * tests/015/awk-rng.expected: Updated. * txr.1: Revise semantic description the -- range types, plus minor fixes.
* awk: more range test cases.Kaz Kylheku2017-10-271-0/+4
| | | | | | * tests/015/awk-rng.tl: More rows of data. * tests/015/awk-rng.expected: Updated.
* awk: five new range operators.Kaz Kylheku2017-10-251-0/+25
* share/txr/stdlib/awk.tl (sys;awk-mac-let): Provide the implementation for the local macros --rng, --rng-, rng+, -rng+ and --rng+. * tests/015/awk-rng.tl: New file. * tests/015/awk-rng.expected: New file. * txr.1: Documented.