VBC00001 — Syntax error
Note
This page will be refined as RDCore.Parsing narrows this fallback into more specific
VBC000xx codes.
Severity: Error · Family: VBC (parser / concrete syntax tree) ·
Source metadata: VBSyntaxErrorInfo
A token was reached that the RD-VBA grammar cannot place in the current context. This is the parser's
general fallback: when input has clearly gone wrong but no more specific code applies, it reports
VBC00001. Recurring shapes are promoted to their own code in the VBC00042–VBC00999 range over
time, so the set of situations below shrinks as the platform matures.
The diagnostic's verbose detail carries the parser's account of the failure — the token it found and what it expected in its place. Anchor a squiggle on the reported range; read the verbose detail for the specifics.
How it is raised
| Situation | What the verbose detail says | Resolution |
|---|---|---|
A keyword, operator, or delimiter appears where the grammar expects something else — a misplaced Then, a doubled operator, an unbalanced bracket. |
expecting <token>, found <token> |
Put the tokens in a legal order. |
| A construct RD-VBA does not accept in this position — a declaration inside a procedure body, an expression used as a statement. | the offending token and the rule that rejected it | Move or remove the construct. |
A conditional-compilation directive (#If / #Else / #End If) splits a single statement across branches — e.g. a procedure header whose return type differs per branch. RD-VBA, like the legacy Rubberduck parser, does not parse this. |
the token after the directive that could not be joined to the statement | Rewrite so each branch holds whole statements: duplicate the header in each branch, or move the #If inside the body. |
| A stray or unterminated token — an unclosed string, an unexpected line continuation, a character outside any token. | the unexpected character or the unterminated token | Remove or complete the token. |
Notes
The RD-VBA grammar is deliberately permissive at the token level and defers meaning to the semantic
layers, so a VBC00001 is always a structural problem — the text could not be assembled into a
syntax tree at all. Conditions that need symbol information (an undefined name, a duplicate
declaration) are not syntax errors; they are reported later as
semantic compilation errors.
See also
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca