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

Function parse_decllist

MathBox/mathbox-bundle.js:79951–79983  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79949 }
79950
79951 function parse_decllist() {
79952 // grab ident
79953
79954 if(token.type === 'ident') {
79955 var name = token.data
79956 state.unshift(ident())
79957 state.scope.define(name)
79958 return
79959 }
79960
79961 if(token.type === 'operator') {
79962
79963 if(token.data === ',') {
79964 // multi-decl!
79965 if(!(state[1].flags & DECL_ALLOW_COMMA)) {
79966 return state.shift()
79967 }
79968
79969 return tokens.shift()
79970 } else if(token.data === '=') {
79971 if(!(state[1].flags & DECL_ALLOW_ASSIGN)) return unexpected('`=` is not allowed here.')
79972
79973 tokens.shift()
79974
79975 state.unshift(expr(',', ';'))
79976 return
79977 } else if(token.data === '[') {
79978 state.unshift(quantifier())
79979 return
79980 }
79981 }
79982 return state.shift()
79983 }
79984
79985 function parse_keyword_or_ident() {
79986 if(token.type === 'keyword') {

Callers 1

writeFunction · 0.70

Calls 2

unexpectedFunction · 0.70
exprFunction · 0.70

Tested by

no test coverage detected