diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-02-10 14:45:20 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-02-10 14:45:20 +0100 |
| commit | 18847f55bb3fe9db41e46a2e9e49a9f7c28143af (patch) | |
| tree | e181c33c75f5851a5042290ff59dd44cce353c66 /pkg/compiler/testdata/all.txt | |
| parent | d0da558cb16f3fb7cf26f20d24ee89eeb49a6f30 (diff) | |
pkg/ast: introduce hex-encoded string literals
The stringnozescapes does not make sense with filename,
also we may need similar escaping for string flags.
Handle escaped strings on ast level instead.
This avoids introducing new type and works seamleassly with flags.
As alternative I've also tried using strconv.Quote/Unquote
but it leads to ugly half-escaped strings:
"\xb0\x80s\xe8\xd4N\x91\xe3ڒ,\"C\x82D\xbb\x88\\i\xe2i\xc8\xe9\xd85\xb1\x14):M\xdcn"
Make hex-encoded strings a separate string format instead.
Diffstat (limited to 'pkg/compiler/testdata/all.txt')
| -rw-r--r-- | pkg/compiler/testdata/all.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt index 9d94a81a1..789071964 100644 --- a/pkg/compiler/testdata/all.txt +++ b/pkg/compiler/testdata/all.txt @@ -40,10 +40,13 @@ strings { f11 stringnoz[string_flags1] f12 string[string_flags2] f13 stringnoz[string_flags2] + f14 string[`abcdef`, 4] + f15 string[string_flags3, 4] } [packed] string_flags1 = "foo", "barbaz" string_flags2 = "" +string_flags3 = "ab", `010203`, `de` int_flags = 0, 1, 0xabc, 'x', -11 _ = 1, 2 _ = C1, C2 |
