add multiline string literal

and make multiple lines in normal string literals an error
This commit is contained in:
Andrew Kelley
2016-04-03 18:44:17 -07:00
parent 5bae9ba086
commit e144ddab24
7 changed files with 162 additions and 11 deletions

View File

@@ -1770,6 +1770,12 @@ fn f() {
const std = @import("std");
}
)SOURCE", 1, ".tmp_source.zig:3:17: error: @import invalid inside function bodies");
add_compile_fail_case("normal string with newline", R"SOURCE(
const foo = "a
b";
)SOURCE", 1, ".tmp_source.zig:2:13: error: use raw string for multiline string literal");
}
//////////////////////////////////////////////////////////////////////////////