docs

您正在閱讀 v0.1.0 的文件。Nabi 0.1.0 已停止支援。 最新版本:v0.1.3 →

本頁尚未翻譯,以下為英文原文。

#E0010: unexpected token

The parser expected one thing and found another: a missing ;, ,, ) or }, a keyword where a name goes, or an expression where an item goes. The message says what was expected; write that, or check the line before for something left open.

nabi
let x = (1 + 2;
println(f"{x}");
error[E0010]: expected `)`, found `;`
  --> main.nabi:1:15
   |
 1 | let x = (1 + 2;
   |         - unclosed delimiter
   |               ^ expected `)`

Close the parenthesis:

nabi
let x = (1 + 2);
println(f"{x}");
3

A missing ; reports expected `;` with help: add `;` at the end of the statement. When a delimiter is left open, a second mark points at it.

Related: E0012 syntax from another language, E0005 unterminated literal or comment

Found a mistake? Edit this page on GitHub. Last updated