String literals are not allowed to contain raw control characters (ASCII characters from 0x00
to 0x1f
):
{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0184.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Instead, use an escape sequence. In this case, \t
is the right one:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0184-a.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Alternatively, you can use a Unicode escape sequence. This works for any Unicode code point:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0184-b.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Raw control characters are not allowed in string literals because they are all either whitespace or non-printable, so they would be confusing and hard to notice if embedded directly in the FIDL source file.