Skip to content
Playground(another site)

bynk.parse.extra_tokens

Error Unexpected tokens after an otherwise complete construct.

A .bynk file holds one commons or context, and the parser found more after it ended. The commonest cause is a } too many: the unit closed early, or an extra brace sits at the end, and the first token after the close is reported, either the stray brace or the next declaration. Count the braces back from there. The other is a second commons or context in the same file; each goes in its own file. The position is the first token after the unit's end, not the brace that ended it. Inside a string, an interpolation \(…) holds a single expression, and a second token in it lands here too.

Example

commons demo {
fn one() -> Int { 1 }
}
} // ✗ nothing can follow the unit
commons demo {
fn one() -> Int { 1 }
} // ✓ the unit closes once

In the Book

See also

  • Every code in its category, Parser, on the diagnostic index.
  • bynk explain bynk.parse.extra_tokens shows the same from the installed toolchain, without a network.