BVB Source Codes

reactide Show index.js Source code

Return Download reactide: download index.js Source code - Download reactide Source code - Type:.js
  1. // Acorn is a tiny, fast JavaScript parser written in JavaScript.
  2. //
  3. // Acorn was written by Marijn Haverbeke, Ingvar Stepanyan, and
  4. // various contributors and released under an MIT license.
  5. //
  6. // Git repositories for Acorn are available at
  7. //
  8. //     http://marijnhaverbeke.nl/git/acorn
  9. //     https://github.com/ternjs/acorn.git
  10. //
  11. // Please use the [github bug tracker][ghbt] to report issues.
  12. //
  13. // [ghbt]: https://github.com/ternjs/acorn/issues
  14. //
  15. // This file defines the main parser interface. The library also comes
  16. // with a [error-tolerant parser][dammit] and an
  17. // [abstract syntax tree walker][walk], defined in other files.
  18. //
  19. // [dammit]: acorn_loose.js
  20. // [walk]: util/walk.js
  21.  
  22. import {Parser} from "./state"
  23. import "./parseutil"
  24. import "./statement"
  25. import "./lval"
  26. import "./expression"
  27. import "./location"
  28.  
  29. export {Parser, plugins} from "./state"
  30. export {defaultOptions} from "./options"
  31. export {Position, SourceLocation, getLineInfo} from "./locutil"
  32. export {Node} from "./node"
  33. export {TokenType, types as tokTypes} from "./tokentype"
  34. export {TokContext, types as tokContexts} from "./tokencontext"
  35. export {isIdentifierChar, isIdentifierStart} from "./identifier"
  36. export {Token} from "./tokenize"
  37. export {isNewLine, lineBreak, lineBreakG} from "./whitespace"
  38.  
  39. export const version = "3.3.0"
  40.  
  41. // The main exported interface (under `self.acorn` when in the
  42. // browser) is a `parse` function that takes a code string and
  43. // returns an abstract syntax tree as specified by [Mozilla parser
  44. // API][api].
  45. //
  46. // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
  47.  
  48. export function parse(input, options) {
  49.   return new Parser(options, input).parse()
  50. }
  51.  
  52. // This function tries to parse a single expression at a given
  53. // offset in a string. Useful for parsing mixed-language formats
  54. // that embed JavaScript expressions.
  55.  
  56. export function parseExpressionAt(input, pos, options) {
  57.   let p = new Parser(options, input, pos)
  58.   p.nextToken()
  59.   return p.parseExpression()
  60. }
  61.  
  62. // Acorn is organized as a tokenizer and a recursive-descent parser.
  63. // The `tokenizer` export provides an interface to the tokenizer.
  64.  
  65. export function tokenizer(input, options) {
  66.   return new Parser(options, input)
  67. }
  68.  
downloadindex.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