Created
September 5, 2017 23:54
-
-
Save Skrylar/2b3c52373482d0701746a1a0acdabec6 to your computer and use it in GitHub Desktop.
This file contains 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
proc parse(input: string) = | |
var i = 0 | |
template getch(): char = | |
if i > input.high: | |
break | |
inc i | |
input[i-1] | |
block command: | |
if getch != 'b': break | |
if getch != '3': break | |
if getch != '5': break | |
echo "b35!" | |
echo "done" | |
parse("b3") | |
parse("b35") | |
# Raziel% ./parse | |
# done | |
# b35! | |
# done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment