| Evaluation: {{.Title}} | |
| Constants and functions: {{printf "%g: %#3X" 1.2+2i 123}} | |
| Control structures {{range $s.Text}} {{.}} {{end}} | |
| // One iteration: | |
| switch state { | |
| case state1: | |
| state = action1() | |
| case state2: | |
| state = action2() | |
| case state3: | |
| state = action3() | |
| } | |
| // run lexes the input by executing state functions | |
| // until the state is nil. | |
| func run() { | |
| for state := startState; state != nil; { | |
| state = state(lexer) | |
| } | |
| } |