0

I'm new to sweet.js. I'm able to run example in official tutorial, but not in this tutorial because it uses macro definition:

macro foo {
  rule { $x } => { $x + 'rule1' }
}

I'm not sure whether this code is supposed to be processed by sjs or some other tools. sjs gave me:

Error: not a valid expression
__=>__ $x + rule1

What am I doing wrong?

sweet.js v2.2.1 on node v6.9.4

Jack Lu
  • 139
  • 2
  • 12

1 Answers1

0

Got it myself. It's the method in v0.7. From v1.0 it only allows definition using syntax.

Jack Lu
  • 139
  • 2
  • 12