For the complete documentation index, see llms.txt. This page is also available as Markdown.

Parser syntax errors (GPC2xxx)

All parser diagnostics are Errors. Most messages follow the pattern Expected X after Y got '{token}'., where {token} is the actual token found. The parser recovers and keeps going after most of these, so one real mistake can produce several follow-on diagnostics — fix the first reported error first.

GPC2100 — Syntax Error

Representative messages:

Expected function name
Expected string value.

Severity: Error

General/unclassified syntax error used where no more specific code applies: a call target that isn't a name, or a const string initializer that isn't a string literal.


GPC2101 — Trailing Comma

Trailing comma in array initializer.
Trailing comma in data initializer.
Trailing comma in enum.

Severity: Error

A comma with nothing after it in a data(...) section, const array initializer, or enum body.

const int8 vals[] = { 1, 2, 3, };   // GPC2101 — remove the last comma

GPC2102 — Expected Expression

Severity: Error

The parser needed an expression (after an operator, as a call argument, as a define value, in a constant-expression context, etc.) but found something else — often a misplaced ;, ), or keyword.


GPC2103 — Expected Statement

Severity: Error

A token appears where a statement or declaration must start. At the top level of a script this usually means executable code was written outside of main, init, a combo, or a function.


GPC2104 — Missing )

Also: after arguments, after data values, after while condition, after else if condition, after for clauses, after (.

Severity: Error

A closing parenthesis is missing in an expression, call, or statement header. Count your parentheses on the reported line.


GPC2105 — Missing ]

Severity: Error

A closing bracket is missing in an array access or array declaration.


GPC2106 — Missing }

And similar.

Severity: Error

A closing brace is missing at the end of a const array initializer, enum body, or switch body.


GPC2108 — Unexpected ;

Severity: Error

A stray extra semicolon, either at the top level of the script or doubled after a statement.


GPC2109 — Expected ; Got )

Severity: Error

An expression statement is terminated by ) instead of ; — usually one closing parenthesis too many. The parser consumes the ) and continues.


GPC2110 — Expected ; Got ]

Severity: Error

Same as GPC2109 but with a stray ] — usually one closing bracket too many.


GPC2111 — Missing (

Also: after addr, sizeof, switch, else if, while, after a function name.

Severity: Error

An opening parenthesis is missing after a keyword or function name that requires one.


GPC2112 — Missing [

Severity: Error

An opening bracket is missing in an array declaration — e.g. const int8 table = { ... } instead of const int8 table[] = { ... }, or int arr 5];.


GPC2113 — Missing {

Also: before init statements, combo statements, fcombo body, function body, const array values/rows, switch body, values, after enum.

Severity: Error

An opening brace is missing where a block must start. GPC requires braces around main, init, combo, and function bodies.


GPC2114 — Missing =

Severity: Error

An = is missing in a define, const array, const string, or variable initializer.


GPC2115 — Missing Identifier

Severity: Error

A name is missing right after a declaration keyword (define, combo, function, const, enum, ...). Often caused by using a reserved keyword as a name.


GPC2116 — Missing ,

Severity: Error

Two items in a list (const array values, enum members, 2D array rows) are not separated by a comma. The parser inserts a virtual separator and keeps parsing.


GPC2117 — Conditional Missing :

Severity: Error

A conditional expression condition ? true_value : false_value is missing its :. Both branches are required — the operator has no two-part form.


GPC2120 — Block Missing }

Severity: Error

A statement block ({ ... }) is not closed before the file or enclosing construct ends. Almost always an unbalanced brace somewhere above the reported location.


GPC2130 — Const Array Size Not Allowed

Severity: Error

Const arrays derive their size from the initializer; an explicit size in the brackets is rejected.


GPC2131 — Invalid Const Array Type

Severity: Error

The keyword after const is not a valid const array element type. Valid types include int8, uint8, int16, uint16, int24, uint24, int32, string, image, and ps5adt.


GPC2140 — Invalid data Brace Syntax

Severity: Error

The data section was written with braces (data { ... } or data(...) { ... }) instead of the required parenthesized value list. The parser skips the brace block and continues.


GPC2141 — Empty data()

Severity: Error

A data() section with no values. Unlike const arrays, the data section may not be declared empty — add at least one value or remove the section.


GPC2150 — Expected Variable Name

Severity: Error

A type keyword (int, int8, ...) in a variable declaration is not followed by a valid identifier — e.g. int 5x; or int if;.


GPC2180 — Function Missing )

Severity: Error

The parameter list of a function declaration is not closed with ) — either the parameter list ran into the end of file, or an unexpected token appears where a parameter or ) should be.


GPC2181 — Expected Parameter Name

Severity: Error

Something other than an identifier appears in a function's parameter list. GPC parameters are plain names (an optional int keyword before a name is tolerated).


GPC2200 — if Missing (

Severity: Error

The condition of an if statement must be parenthesized.


GPC2201 — if Missing )

Severity: Error

The closing parenthesis after an if condition is missing — check for unbalanced parentheses inside the condition itself.


GPC2202 — if Missing {

Severity: Error

An extra ) appears after an if condition where the body should start — one closing parenthesis too many, e.g. if (a == 1)) {.


GPC2212 — else if Missing {

Severity: Error

Same as GPC2202, for an else if condition: a surplus ) before the branch body.


GPC2232 — while Missing {

Severity: Error

Same pattern for while: an extra ) after the loop condition where the body should start.


GPC2240 — Missing while in do-while

Severity: Error

A do { ... } block is not followed by the while keyword.


GPC2241 — do-while Missing ;

Severity: Error

An extra ) appears after the closing parenthesis of a do-while condition, where the terminating ; belongs: do { ... } while (x));.


GPC2250 — for Missing (

Severity: Error

The header of a for loop must be parenthesized: for (init; condition; increment).


GPC2251 — for Missing ; After Initializer

Severity: Error

The first ; inside the for header is missing.


GPC2252 — for Missing ; After Condition

Severity: Error

The second ; inside the for header is missing.


GPC2254 — for Missing {

Severity: Error

An extra ) appears after the for header where the loop body should start.


GPC2255 — Nesting Too Deep

Severity: Error

A single expression or nested block of statements is nested more than 200 levels deep (parentheses, nested if/while/for, deeply chained operators, and similar). The limit exists to keep compilation safe — 200 levels is far beyond anything hand-written, so hitting it almost always means generated or accidentally pathological code. Reported once per compile.

The practical fix is to restructure rather than shave off a level or two: move deeply nested inner blocks into user-defined functions (each function body starts its nesting count fresh), and split huge expressions into a few intermediate variable assignments instead of one giant formula.

Last updated