How to use the TokenType function from acorn

Find comprehensive JavaScript acorn.TokenType code examples handpicked from public code repositorys.

131
132
133
134
135
136
137
138
139
140
141
const beforeExpr = {beforeExpr: true};


// new tokens (only valid within specific context)
const proc_tok = {
  parrow: new TokenType('->', beforeExpr),
  tail: new TokenType('-<', beforeExpr),
  tailUnit: new TokenType('-<|', beforeExpr),
  bind: new TokenType('<-', beforeExpr),
  form_start: new TokenType('(|', beforeExpr),
  form_end: new TokenType('|)'),
fork icon0
star icon0
watch icon4

+ 5 other calls in file

4
5
6
7
8
9
10
11
12
13
14
var acorn = require("acorn")
if (false) {
  throw new Error(("acorn-private-class-elements requires acorn@^6.1.0, not " + (acorn.version)))
}
var tt = acorn.tokTypes
var TokenType = acorn.TokenType


module.exports = function(Parser) {
  // Only load this plugin once.
  if (Parser.prototype.parsePrivateName) {
fork icon0
star icon0
watch icon0

-2
fork icon0
star icon0
watch icon1

+ 3 other calls in file