BVB Source Codes

reactide Show location.js Source code

Return Download reactide: download location.js Source code - Download reactide Source code - Type:.js
  1. import {Parser} from "./state"
  2. import {Position, getLineInfo} from "./locutil"
  3.  
  4. const pp = Parser.prototype
  5.  
  6. // This function is used to raise exceptions on parse errors. It
  7. // takes an offset integer (into the current `input`) to indicate
  8. // the location of the error, attaches the position to the end
  9. // of the error message, and then raises a `SyntaxError` with that
  10. // message.
  11.  
  12. pp.raise = function(pos, message) {
  13.   let loc = getLineInfo(this.input, pos)
  14.   message += " (" + loc.line + ":" + loc.column + ")"
  15.   let err = new SyntaxError(message)
  16.   err.pos = pos; err.loc = loc; err.raisedAt = this.pos
  17.   throw err
  18. }
  19.  
  20. pp.raiseRecoverable = pp.raise
  21.  
  22. pp.curPosition = function() {
  23.   if (this.options.locations) {
  24.     return new Position(this.curLine, this.pos - this.lineStart)
  25.   }
  26. }
  27.  
downloadlocation.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