Skip to content

Instantly share code, notes, and snippets.

@Skrylar
Created September 5, 2017 23:54
Show Gist options
  • Save Skrylar/2b3c52373482d0701746a1a0acdabec6 to your computer and use it in GitHub Desktop.
Save Skrylar/2b3c52373482d0701746a1a0acdabec6 to your computer and use it in GitHub Desktop.
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