MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / parse_decllist

Function parse_decllist

MathBox/mathbox-core.js:33266–33298  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33264 }
33265
33266 function parse_decllist() {
33267 // grab ident
33268
33269 if(token.type === 'ident') {
33270 var name = token.data
33271 state.unshift(ident())
33272 state.scope.define(name)
33273 return
33274 }
33275
33276 if(token.type === 'operator') {
33277
33278 if(token.data === ',') {
33279 // multi-decl!
33280 if(!(state[1].flags & DECL_ALLOW_COMMA)) {
33281 return state.shift()
33282 }
33283
33284 return tokens.shift()
33285 } else if(token.data === '=') {
33286 if(!(state[1].flags & DECL_ALLOW_ASSIGN)) return unexpected('`=` is not allowed here.')
33287
33288 tokens.shift()
33289
33290 state.unshift(expr(',', ';'))
33291 return
33292 } else if(token.data === '[') {
33293 state.unshift(quantifier())
33294 return
33295 }
33296 }
33297 return state.shift()
33298 }
33299
33300 function parse_keyword_or_ident() {
33301 if(token.type === 'keyword') {

Callers 1

writeFunction · 0.70

Calls 2

unexpectedFunction · 0.70
exprFunction · 0.70

Tested by

no test coverage detected