Created
October 9, 2011 13:27
-
-
Save zah/1273686 to your computer and use it in GitHub Desktop.
Text blocks (for embedded languages)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| x = xml :: | |
| <item> | |
| <field> | |
| </field> | |
| </item> | |
| scanner = ragel :: | |
| action dgt { printf("DGT: %c\n", fc); } | |
| action dec { printf("DEC: .\n"); } | |
| action exp { printf("EXP: %c\n", fc); } | |
| action exp_sign { printf("SGN: %c\n", fc); } | |
| action number { /*NUMBER*/ } | |
| number = ( | |
| [0-9]+ $dgt ( '.' @dec [0-9]+ $dgt )? | |
| ( [eE] ( [+\-] $exp_sign )? [0-9]+ $exp )? | |
| ) %number; | |
| main := ( number '\n' )*; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment