docs

你正在阅读 v0.1.2 的文档。Nabi 0.1.2 已不再提供支持。 最新版本:v0.1.3 →

本页尚未翻译,以下为英文原文。

#E0002: bidirectional control character in source

The source has a Unicode bidirectional control character (U+202A to U+202E, U+2066 to U+2069). These reorder how text is shown, so code can read differently from what the compiler sees. Below, the string "abcdef" hides one between abc and def. Write it as an escape inside a string, "\u{202E}", and delete it everywhere else; the quick fix deletes it. Comments are no exception.

error[E0002]: bidirectional control character U+202E RIGHT-TO-LEFT OVERRIDE in source: it can make code read differently from what the compiler sees
  --> main.nabi:1:17

Write the character as an escape:

nabi
let label = "abc\u{202E}def";
println(f"{label.len()}");
9

Related: E0001 unexpected character in source, E0006 invalid escape in a literal

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