BNF:3: PARAMLIST ::= '(' ('void' | (TYPE TYPEMOD ('...' | IDENTIFIER? ('=' EXPR)?) (',' TYPE TYPEMOD ('...' | IDENTIFIER? ('=' EXPR)?))*))? ')'
| 782 | |
| 783 | // BNF:3: PARAMLIST ::= '(' ('void' | (TYPE TYPEMOD ('...' | IDENTIFIER? ('=' EXPR)?) (',' TYPE TYPEMOD ('...' | IDENTIFIER? ('=' EXPR)?))*))? ')' |
| 784 | asCScriptNode *asCParser::ParseParameterList() |
| 785 | { |
| 786 | asCScriptNode *node = CreateNode(snParameterList); |
| 787 | if( node == 0 ) return 0; |
| 788 | |
| 789 | sToken t1; |
| 790 | GetToken(&t1); |
| 791 | if( t1.type != ttOpenParenthesis) |
| 792 | { |
| 793 | Error(ExpectedToken("("), &t1); |
| 794 | Error(InsteadFound(t1), &t1); |
| 795 | return node; |
| 796 | } |
| 797 | |
| 798 | node->UpdateSourcePos(t1.pos, t1.length); |
| 799 | |
| 800 | GetToken(&t1); |
| 801 | if( t1.type == ttCloseParenthesis ) |
| 802 | { |
| 803 | node->UpdateSourcePos(t1.pos, t1.length); |
| 804 | |
| 805 | // Statement block is finished |
| 806 | return node; |
| 807 | } |
| 808 | else |
| 809 | { |
| 810 | // If the parameter list is just (void) then the void token should be ignored |
| 811 | if( t1.type == ttVoid ) |
| 812 | { |
| 813 | sToken t2; |
| 814 | GetToken(&t2); |
| 815 | if( t2.type == ttCloseParenthesis) |
| 816 | { |
| 817 | node->UpdateSourcePos(t2.pos, t2.length); |
| 818 | return node; |
| 819 | } |
| 820 | } |
| 821 | |
| 822 | RewindTo(&t1); |
| 823 | |
| 824 | for(;;) |
| 825 | { |
| 826 | // Parse data type |
| 827 | node->AddChildLast(ParseType(true, isParsingAppInterface)); |
| 828 | if( isSyntaxError ) return node; |
| 829 | |
| 830 | node->AddChildLast(ParseTypeMod(true)); |
| 831 | if( isSyntaxError ) return node; |
| 832 | |
| 833 | GetToken(&t1); |
| 834 | |
| 835 | // Variadic |
| 836 | if (t1.type == ttVariadic) |
| 837 | { |
| 838 | node->AddChildLast(CreateNode(snVariadic)); |
| 839 | |
| 840 | sToken t2; |
| 841 | GetToken(&t2); |
nothing calls this directly
no test coverage detected