// Backtick raw-identifier escape: a leading backtick makes the following // identifier RAW — its text excludes the backtick and it is never the // reserved/builtin keyword, so a reserved type-name spelling (`s2`, `u8`, …) // can be used as an ordinary identifier. Exercised in every VALUE position: // global, local, param, struct field + member access, function name + call, // and a later reference. (A raw identifier in TYPE position references a // backtick-declared type instead — see examples/0154.) A *bare* `s2` is still // the reserved type name (see examples/1119), so the escape is the only way to // spell these as values. // Regression (issue 0089). #import "modules/std.sx"; // Global named with a reserved type spelling. `u8 := 100; // Function whose name is a reserved type spelling, with a reserved-name param. `s2 :: (`s1: s64) -> s64 { return `s1 * 2; } Point :: struct { `s2: f64; // field name is a reserved type spelling `u16: s64; } main :: () { // Local with a reserved type spelling; later reference resolves to it. `s64 := 7; `s64 = `s64 + 1; print("local = {}\n", `s64); print("global = {}\n", `u8); print("fn = {}\n", `s2(21)); // calls the `s2 function p := Point.{ `s2 = 2.5, `u16 = 9 }; print("field = {} {}\n", p.`s2, p.`u16); }