Skip to content

Instantly share code, notes, and snippets.

@Varriount
Last active July 8, 2018 21:29
Show Gist options
  • Save Varriount/2b1f0c02db5bdd03574c967924bacd75 to your computer and use it in GitHub Desktop.
Save Varriount/2b1f0c02db5bdd03574c967924bacd75 to your computer and use it in GitHub Desktop.
import parseutils, strutils
template emitErrorIf(condition, errorString) =
if condition:
echo(errorString)
return 1
proc execDefine(input: string): int =
var position, newPosition = 0
position = skipWhile(input, Whitespace, position)
emitErrorIf(newPosition == position):
"Error: Expected \"(\" after function name."
else:
position = newPosition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment