On this page
B0101: unexpected token
Catalog status: active. Default severity: error. Stable name: unexpected-token. Family: Syntax and source text.
The parser found a token that cannot appear at this point. Where the surrounding syntax makes the likely mistake clear, the message explains that context. Otherwise it gives a short list of expected tokens or grammatical categories, such as an operator or separator. The underlined token marks where parsing stopped; the mistake can be immediately before it.
Vada and Varc recover at statement or construct boundaries so later errors can still be reported. Vibe stops at the first syntax error.
Example (Vibe)
print "hello"error[B0101]: unexpected value after `print`
If this is a call, use parentheses:
print("hello")This guidance applies to other names and qualified names too. The parser does not yet know whether a name denotes a callable: a missing operator or separator is another possibility. For a standalone name followed by a literal, an Add parentheses for a call quick-fix is available when the complete edited source parses without errors. The edit preserves the surrounding statements and trailing comments. It is withheld when the intended extent is unclear, a comment would be removed, or another syntax error prevents validation.
Vada (Put_Line "hello";) and Varc (emit "hello";) receive the same guidance and a validated fix in their respective statement contexts.
For an unfinished construct such as print("hello", the diagnostic names the missing ) and points back to its opening (. A validated quick-fix inserts the closer before any trailing comment. This also applies to missing ] and }. If an operand is missing, as in print(1 +, the diagnostic continues to ask for an expression instead of blaming the closer.
Example (Vada)
X := * 2;error[B0101]: expected expression, found `*`
Example (Varc)
x = / 2;
error[B0101]: expected expression, found `/`
What to do
Look at the token underlined and the ones before it: a missing operand, a misplaced keyword or a typo is the usual cause. In Vibe, block headers such as if and def must end with :, and a function definition needs parentheses around its parameter list, including an empty list. Adjacent arguments or items may need a comma. A quick-fix is a suggested edit to review, not a claim that the name or the repaired program is semantically valid.
Regression source and further reading
Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.
See syntax and source text, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.