BVB Source Codes

reactide Show node.js Source code

Return Download reactide: download node.js Source code - Download reactide Source code - Type:.js
  1. import {Parser} from "./state"
  2. import {SourceLocation} from "./locutil"
  3.  
  4. export class Node {
  5.   constructor(parser, pos, loc) {
  6.     this.type = ""
  7.     this.start = pos
  8.     this.end = 0
  9.     if (parser.options.locations)
  10.       this.loc = new SourceLocation(parser, loc)
  11.     if (parser.options.directSourceFile)
  12.       this.sourceFile = parser.options.directSourceFile
  13.     if (parser.options.ranges)
  14.       this.range = [pos, 0]
  15.   }
  16. }
  17.  
  18. // Start an AST node, attaching a start offset.
  19.  
  20. const pp = Parser.prototype
  21.  
  22. pp.startNode = function() {
  23.   return new Node(this, this.start, this.startLoc)
  24. }
  25.  
  26. pp.startNodeAt = function(pos, loc) {
  27.   return new Node(this, pos, loc)
  28. }
  29.  
  30. // Finish an AST node, adding `type` and `end` properties.
  31.  
  32. function finishNodeAt(node, type, pos, loc) {
  33.   node.type = type
  34.   node.end = pos
  35.   if (this.options.locations)
  36.     node.loc.end = loc
  37.   if (this.options.ranges)
  38.     node.range[1] = pos
  39.   return node
  40. }
  41.  
  42. pp.finishNode = function(node, type) {
  43.   return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
  44. }
  45.  
  46. // Finish node at given position
  47.  
  48. pp.finishNodeAt = function(node, type, pos, loc) {
  49.   return finishNodeAt.call(this, node, type, pos, loc)
  50. }
  51.  
downloadnode.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top