Range expansion: Difference between revisions
Content deleted Content added
→{{header|TXR}}: Revised to show how the grammar-driven extraction stops at non-matching junk. |
→{{header|TXR}}: Fix botched output paste. |
||
Line 2,122: | Line 2,122: | ||
Run: |
Run: |
||
<pre>$ txr range-expansion.txr |
<pre>$ txr range-expansion.txr - |
||
1,2,3-5,-3--1 |
1,2,3-5,-3--1 |
||
raw syntax: 1 2 (3 5) (-3 -1) |
raw syntax: 1 2 (3 5) (-3 -1) |
||
expansion: (-3 -2 -1 1 2 3 4 5) |
expansion: (-3 -2 -1 1 2 3 4 5) |
||
your junk: |
|||
-6,-3--1,3-5,7-11,14,15,17-20 |
-6,-3--1,3-5,7-11,14,15,17-20 |
||
raw syntax: -6 (-3 -1) (3 5) (7 11) 14 15 (17 20) |
raw syntax: -6 (-3 -1) (3 5) (7 11) 14 15 (17 20) |
||
expansion: (-6 -3 -2 -1 3 4 5 7 8 9 10 11 14 15 17 18 19 20) |
expansion: (-6 -3 -2 -1 3 4 5 7 8 9 10 11 14 15 17 18 19 20) |
||
your junk: |
|||
-6,-3--1,3-5,7-11,14,15,17-20,cg@foo |
-6,-3--1,3-5,7-11,14,15,17-20,cg@foo |
||
raw syntax: -6 (-3 -1) (3 5) (7 11) 14 15 (17 20) |
raw syntax: -6 (-3 -1) (3 5) (7 11) 14 15 (17 20) |