MCPcopy Index your code
hub / github.com/jquery/esprima / isStartOfExpression

Method isStartOfExpression

src/parser.ts:3114–3139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3112 // https://tc39.github.io/ecma262/#sec-generator-function-definitions
3113
3114 isStartOfExpression(): boolean {
3115 let start = true;
3116
3117 const value = this.lookahead.value;
3118 switch (this.lookahead.type) {
3119 case Token.Punctuator:
3120 start = (value === '[') || (value === '(') || (value === '{') ||
3121 (value === '+') || (value === '-') ||
3122 (value === '!') || (value === '~') ||
3123 (value === '++') || (value === '--') ||
3124 (value === '/') || (value === '/='); // regular expression literal
3125 break;
3126
3127 case Token.Keyword:
3128 start = (value === 'class') || (value === 'delete') ||
3129 (value === 'function') || (value === 'let') || (value === 'new') ||
3130 (value === 'super') || (value === 'this') || (value === 'typeof') ||
3131 (value === 'void') || (value === 'yield');
3132 break;
3133
3134 default:
3135 break;
3136 }
3137
3138 return start;
3139 }
3140
3141 parseYieldExpression(): Node.YieldExpression {
3142 const node = this.createNode();

Callers 1

parseYieldExpressionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected