Last active
July 8, 2018 21:29
-
-
Save Varriount/2b1f0c02db5bdd03574c967924bacd75 to your computer and use it in GitHub Desktop.
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
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