Skip to content

Instantly share code, notes, and snippets.

@taotetek
Created June 13, 2015 15:06
Show Gist options
  • Save taotetek/45ef889ce71f4e8924b0 to your computer and use it in GitHub Desktop.
Save taotetek/45ef889ce71f4e8924b0 to your computer and use it in GitHub Desktop.
error.nim
import os, streams, parsexml, strutils, macros
macro readModelAndBuildAST(filename: string): stmt =
let
inputString = slurp(filename.strVal)
var s = newStringStream(inputString)
var x: XmlParser
open(x, s, $filename)
next(x)
while true:
case x.kind
of xmlEof: break
of xmlElementOpen, xmlElementStart:
case x.elementName
of "constant":
x.next
echo x.attrKey
echo x.attrValue
x.next
echo x.attrKey
echo x.attrValue
else: discard
else: discard
next(x)
readModelAndBuildAST("./api/zframe.xml")
shit.nim(28, 21) Info: template/generic instantiation from here
lib/pure/lexbase.nim(149, 11) Error: VM is not allowed to 'cast'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment