Rename the language from Dino to Rex
Files use .rex, the command is rex, and the crate, runtime prefixes, docs, editor files and examples all use the new name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f44f09b6a
commit
7cf9727bcd
94 files changed
+858
-858
No files matched your search
@@ -0,0 +1,37 @@
|
||||
struct Tok { first: char }
|
||||
|
||||
func kind(c: char): string {
|
||||
return match c {
|
||||
'+' => "plus"
|
||||
'\n' => "newline"
|
||||
' ' => "space"
|
||||
_ => "other"
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
var c = 'a'
|
||||
print(c, c == 'a', c < 'b', int(c), char(66), string(c) + "!")
|
||||
var s = "héllo wörld 42"
|
||||
var letters = 0
|
||||
var digits = 0
|
||||
for ch in s {
|
||||
if ch.is_letter() { letters += 1 }
|
||||
if ch.is_digit() { digits += 1 }
|
||||
}
|
||||
print(letters, digits, s.len())
|
||||
for i, ch in "aé😀" { print(i, ch) }
|
||||
print(s[0], s[1], s[3], s[s.len() - 1])
|
||||
var up = ""
|
||||
for ch in "rex" { up += string(ch.upper()) }
|
||||
print(up, 'Q'.lower(), kind('+'), kind('\n'), kind('z'))
|
||||
var counts: map[char, int] = {}
|
||||
for ch in "banana" { counts[ch] += 1 }
|
||||
print(counts)
|
||||
var w = ""
|
||||
for ch in "a b c" {
|
||||
if ch == ' ' { continue }
|
||||
w += string(ch)
|
||||
}
|
||||
print(w, 'a'.is_alnum(), ' '.is_space(), 'A'.is_upper())
|
||||
}
|
||||
Reference in new issue
Block a user