Parse input into returned array of expressions (SExpr).
const text = ";;a comment\n(instance AttrFn BinaryFunction);;another comment\0"; auto parser = LispParser(text); assert(!parser.empty); assert(parser.front.token.tok == TOK.symbol); assert(parser.front.token.src == `instance`); assert(parser.front.subs[0].token.tok == TOK.functionName); assert(parser.front.subs[0].token.src == "AttrFn"); assert(parser.front.subs[1].token.tok == TOK.symbol); assert(parser.front.subs[1].token.src == "BinaryFunction"); parser.popFront(); assert(parser.empty);
const text = ";;a comment\n(instance AttrFn BinaryFunction);;another comment\0"; auto parser = LispParser(text); import std.conv : to; assert(parser.front.to!string == `(instance AttrFn BinaryFunction)`); assert(!parser.empty);
https://forum.dlang.org/post/okqdldjnoyrtuizevqeo@forum.dlang.org
Parse from input into lazy range over top-level expressions (SExpr).