Home / Docs / Diagnostics

U0101: Unexpected token

Release v0.4.0

The parser found a token that the grammar of spec/02 does not allow at that point. The message names the token found and what was expected. After the error, parsing resumes at the next declaration, so the rest of the file is still checked.

Why Una rejects it

U0101 also reports:

How to fix it

The repair at a glance

diff
  module demo

- pub between(x: Int) -> Bool = 0 < x < 10
+ pub between(x: Int) -> Bool = 0 < x and x < 10

Failing example

una
module demo

pub between(x: Int) -> Bool = 0 < x < 10

Fixed example

una
module demo

pub between(x: Int) -> Bool = 0 < x and x < 10