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

Function parse_decl

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

Source from the content-addressed store, hash-verified

79810 }
79811
79812 function parse_decl() {
79813 var stmt = state[0]
79814
79815 return stative(
79816 invariant_or_not,
79817 storage_or_not,
79818 parameter_or_not,
79819 precision_or_not,
79820 struct_or_type,
79821 maybe_name,
79822 maybe_lparen, // lparen means we're a function
79823 is_decllist,
79824 done
79825 )()
79826
79827 function invariant_or_not() {
79828 if(token.data === 'invariant') {
79829 if(stmt.flags & DECL_ALLOW_INVARIANT) {
79830 state.unshift(keyword())
79831 return Advance
79832 } else {
79833 return unexpected('`invariant` is not allowed here')
79834 }
79835 } else {
79836 state.fake(mknode(PLACEHOLDER, {data: '', position: token.position}))
79837 return Advance
79838 }
79839 }
79840
79841 function storage_or_not() {
79842 if(is_storage(token)) {
79843 if(stmt.flags & DECL_ALLOW_STORAGE) {
79844 state.unshift(keyword())
79845 return Advance
79846 } else {
79847 return unexpected('storage is not allowed here')
79848 }
79849 } else {
79850 state.fake(mknode(PLACEHOLDER, {data: '', position: token.position}))
79851 return Advance
79852 }
79853 }
79854
79855 function parameter_or_not() {
79856 if(is_parameter(token)) {
79857 if(!(stmt.flags & DECL_NO_INOUT)) {
79858 state.unshift(keyword())
79859 return Advance
79860 } else {
79861 return unexpected('parameter is not allowed here')
79862 }
79863 } else {
79864 state.fake(mknode(PLACEHOLDER, {data: '', position: token.position}))
79865 return Advance
79866 }
79867 }
79868
79869 function precision_or_not() {

Callers 1

writeFunction · 0.70

Calls 1

stativeFunction · 0.70

Tested by

no test coverage detected