Just add some notes.
Cat's Eye Technologies
11 years ago
723 | 723 | | main = ("c" & "a" & "t" & " ") with raw & "dog". |
724 | 724 | + cat dog |
725 | 725 | = dog |
726 | ||
727 | But you need to be careful with `with`! You should not put `with` inside | |
728 | a rule that can fail, i.e. the LHS of `|` or inside a `{}`. Because if it | |
729 | does fail and the interpreter reverts the scanner to its previous state, | |
730 | its previous state may have been a different scanner. The result may well | |
731 | be eurr. I could make this a static error, but... for now, just remember | |
732 | this and be careful. | |
726 | 733 | |
727 | 734 | Aside #2 |
728 | 735 | -------- |
801 | 808 | = . |
802 | 809 | |
803 | 810 | Indeed we can. |
811 | ||
812 | The next logical step would be to be able to say | |
813 | ||
814 | main = program with scanner. | |
815 | scanner = scan with raw. | |
816 | scan = {" "} & (...) | |
817 | program = "token" & ";" & "token" & ... | |
818 | ||
819 | But we're not there yet. |