topLevelDefinition method

Parser topLevelDefinition()

Implementation

Parser topLevelDefinition() =>
    ref0(classDefinition) |
    ref0(functionTypeAlias) |
    ref0(functionDeclaration) & ref0(functionBodyOrNative) |
    ref0(returnType).optional() &
        ref0(getOrSet) &
        ref0(identifier) &
        ref0(formalParameterList) &
        ref0(functionBodyOrNative) |
    ref0(finalToken) &
        ref0(type).optional() &
        ref0(staticFinalDeclarationList) &
        ref1(token, ';') |
    ref0(constToken) &
        ref0(type).optional() &
        ref0(staticFinalDeclarationList) &
        ref1(token, ';') |
    ref0(constInitializedVariableDeclaration) & ref1(token, ';');