unexpected_char

Diagnostic `nanook::expr::unexpected_char`

Summary

unexpected character {0:?}

Help

only ascii letters, digits, operators, and quoted strings are valid here

Details

When this fires

The lexer hit a character it doesn't know how to tokenize. Only ASCII letters, digits, recognised operator punctuation, and quoted string contents are valid in the source.

What to check

Watch for smart quotes from copy-paste, non-ASCII letters, and stray symbols like @, #, $ outside string literals.

# broken: smart quotes
expr = "host.name is "web""
# fixed
expr = "host.name is \"web\""

Caught by nanook check while lexing. The diagnostic span points at the offending byte.