Basic examples not working
Hello,
Taking several of the basic examples and trying to run them on the online editor produces errors. For example:
syntax let = function (ctx) {
let ident = ctx.next().value;
ctx.next(); // eat `=`
let init = ctx.expand('expr').value;
return #`
(function (${ident}) {
${ctx} // <2>
}(${init}))
`
};
let bb8 = new Droid('BB-8', 'orange');
console.log(bb8.beep());
yields the following error:
Goto Error: Unknown object: {"value":{"token":{"type":{"klass":{"name":"String"},"name":""},"typeCode":4,"str":"BB-8","octal":null,"slice":{"text":"'BB-8'","start":229,"startLocation":{"line":12,"column":21,"filename":"","position":229},"end":235}},"bindings":{"_map":{}},"scopesets":{"all":[{"name":"outsideEdge_35"}],"phase":{"0":[{"name":"insideEdge0_36"}]}}},"type":"RawSyntax","loc":null}
Same thing happens if I install sweet from npm and try to compile it. I also tried to build a basic macro, but I'm only getting errors related to unknow objects to JSON.parse and that stuff.
The project seems to be a great potential, but I think it does not play well with the latest JS features like spread operator and template literals.
Regards