unexpected_token

Diagnostic `nanook::expr::unexpected_token`

Summary

expected {0}, got {1}

Help

check the syntax: {0} is required at this position

Details

When this fires

The parser was looking for one specific token (an operator, a keyword, a closing bracket) and got a different one. The error message names both the expected kind and what it actually saw.

What to check

Common culprits: missing closing ) or ], missing and / or between sub-expressions, missing commas in array literals, or a reserved keyword (in, is, not, and, or) used as an identifier.

# broken: missing comma
expr = "host.name in [\"web\" \"db\"]"
# fixed
expr = "host.name in [\"web\", \"db\"]"

Caught by nanook check. See @/docs/nanook-expr.md for the grammar.