logicaffeine_system/
text.rs1#[inline]
5#[allow(non_snake_case)]
6pub fn parseInt(s: String) -> i64 {
7 s.trim()
8 .parse::<i64>()
9 .unwrap_or_else(|_| panic!("Cannot parse '{}' as Int", s))
10}
11
12#[inline]
13#[allow(non_snake_case)]
14pub fn parseFloat(s: String) -> f64 {
15 s.trim()
16 .parse::<f64>()
17 .unwrap_or_else(|_| panic!("Cannot parse '{}' as Float", s))
18}
19
20#[inline]
21pub fn chr(code: i64) -> String {
22 match char::from_u32(code as u32) {
23 Some(c) => c.to_string(),
24 None => panic!("Invalid character code: {}", code),
25 }
26}