Operator.js 482 B

123456789101112131415161718192021
  1. // '/' | '*' | ',' | ':' | '+' | '-'
  2. module.exports = {
  3. name: 'Operator',
  4. structure: {
  5. value: String
  6. },
  7. parse: function() {
  8. var start = this.scanner.tokenStart;
  9. this.scanner.next();
  10. return {
  11. type: 'Operator',
  12. loc: this.getLocation(start, this.scanner.tokenStart),
  13. value: this.scanner.substrToCursor(start)
  14. };
  15. },
  16. generate: function(node) {
  17. this.chunk(node.value);
  18. }
  19. };