Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S sweet-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • sweet-js
  • sweet-core
  • Issues
  • #750
Closed
Open
Issue created Jun 14, 2018 by Daniel Rodríguez Rivero@danielo515

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

Assignee
Assign to
Time tracking