diff --git a/docs/AGENTS.md b/docs/AGENTS.md index 7d7fa80c9..52cb5e39d 100644 --- a/docs/AGENTS.md +++ b/docs/AGENTS.md @@ -93,3 +93,4 @@ It may include TODOs on WIP. - [WIT Bundling in Component Binaries](./wep-2026-03-21-wit-bundling.md) - [Same-Scope Shadowing with Self-Reference](./wep-2026-03-25-same-scope-shadowing.md) - [Migration to GC in Components](./wep-2026-03-28-gc-in-components.md) +- [Redesign String and Array APIs](./wep-2026-03-29-redesign-string-array-api.md) diff --git a/docs/cheatsheet-stdlib-core.md b/docs/cheatsheet-stdlib-core.md index d84063723..017b95f0b 100644 --- a/docs/cheatsheet-stdlib-core.md +++ b/docs/cheatsheet-stdlib-core.md @@ -853,13 +853,22 @@ impl String { pub fn internal_append_from_memory(&mut self, ptr: i32, len: i32); pub fn internal_reserve_uninit(&mut self, n: i32) -> i32; pub fn append_byte_filled(&mut self, byte: u8, n: i32); + pub fn push_str(&mut self, other: String); pub fn append(&mut self, other: String); pub fn concat(a: String, b: String) -> String; pub fn bytes(&self) -> StrUtf8ByteIter; pub fn chars(&self) -> StrCharIter; + pub fn push(&mut self, c: char); pub fn append_char(&mut self, c: char); - pub fn truncate_bytes(&mut self, byte_len: i32); + pub fn truncate(&mut self, byte_len: i32); pub fn truncate_chars(&mut self, char_count: i32); + pub fn truncate_bytes(&mut self, byte_len: i32); + pub fn pop(&mut self) -> Option; + pub fn clear(&mut self); + pub fn capacity(&self) -> i32; + pub fn reserve(&mut self, additional: i32); + pub fn shrink_to_fit(&mut self); + pub fn as_bytes(&self) -> Array; pub fn trim_ascii_start(&self) -> String; pub fn trim_ascii_end(&self) -> String; pub fn trim_ascii(&self) -> String; @@ -868,10 +877,28 @@ impl String { pub fn trim(&self) -> String; pub fn to_ascii_lowercase(&self) -> String; pub fn to_ascii_uppercase(&self) -> String; + pub fn contains(&self, pat: String) -> bool; + pub fn starts_with(&self, pat: String) -> bool; + pub fn ends_with(&self, pat: String) -> bool; + pub fn find(&self, pat: String) -> Option; + pub fn rfind(&self, pat: String) -> Option; + pub fn contains_char(&self, ch: char) -> bool; + pub fn find_char(&self, pred: Fn(char) -> bool) -> Option; + pub fn insert(&mut self, byte_index: i32, ch: char); + pub fn insert_str(&mut self, byte_index: i32, s: String); + pub fn remove(&mut self, byte_index: i32) -> char; + pub fn repeat(&self, n: i32) -> String; + pub fn replace(&self, from: String, to: String) -> String; + pub fn replacen(&self, from: String, to: String, count: i32) -> String; pub fn from_iter>(iter: I) -> String; pub fn from_utf8>(bytes: I) -> Result; pub fn from_utf8_lossy>(bytes: I) -> String; pub fn from_utf8_unchecked>(bytes: I) -> String; + pub fn split(&self, sep: String) -> StrSplitIter; + pub fn splitn(&self, n: i32, sep: String) -> StrSplitNIter; + pub fn split_whitespace(&self) -> StrSplitWhitespaceIter; + pub fn lines(&self) -> StrLinesIter; + pub fn char_indices(&self) -> StrCharIndicesIter; } impl Add for String { @@ -1033,20 +1060,36 @@ impl Array { pub fn filled(n: i32, element: T) -> Array; pub fn len(&self) -> i32; pub fn is_empty(&self) -> bool; + pub fn capacity(&self) -> i32; pub fn internal_raw_data(&self) -> builtin::array; pub fn internal_from_raw(repr: builtin::array, used: i32) -> Array; + pub fn push(&mut self, value: T); pub fn append(&mut self, value: T); pub fn pop(&mut self) -> Option; - pub fn truncate(&mut self, len: i32); + pub fn first(&self) -> Option; pub fn last(&self) -> Option; pub fn get(&self, index: i32) -> Option; + pub fn insert(&mut self, index: i32, value: T); + pub fn remove(&mut self, index: i32) -> T; + pub fn swap(&mut self, a: i32, b: i32); + pub fn truncate(&mut self, len: i32); + pub fn clear(&mut self); + pub fn reserve(&mut self, additional: i32); + pub fn shrink_to_fit(&mut self); + pub fn extend(&mut self, other: &Array); + pub fn reverse(&mut self); + pub fn repeat(&self, n: i32) -> Array; pub fn copy_within_append(&mut self, src_start: i32, count: i32); + pub fn contains(&self, value: &T) -> bool; pub fn slice(&self, start: i32, end: i32) -> ArraySlice; pub fn iter(&self) -> ArrayIter; pub fn sort_by(&mut self, cmp: Fn(&T, &T) -> Ordering); pub fn sorted_by(&self, cmp: Fn(&T, &T) -> Ordering) -> Array; + pub fn windows(&self, size: i32) -> WindowsIter; + pub fn chunks(&self, size: i32) -> ChunksIter; pub fn sort(&mut self); pub fn sorted(&self) -> Array; + pub fn join(&self, separator: String) -> String; } impl IndexValue for Array { diff --git a/docs/cheatsheet.md b/docs/cheatsheet.md index 735e4b8ee..4cfb2664d 100644 --- a/docs/cheatsheet.md +++ b/docs/cheatsheet.md @@ -165,7 +165,7 @@ takes([1, 2, 3]); // coercion to Array // Array methods let mut arr: Array = []; -arr.append(1); // add element to end +arr.push(1); // add element to end let n = arr.len(); // get length let empty = arr.is_empty(); // check if empty let first = arr[0]; // index access (read) @@ -219,8 +219,8 @@ let empty = s.is_empty(); // String building let mut builder = String::with_capacity(20); -builder.append("Hello"); -builder.append(", World!"); +builder.push_str("Hello"); +builder.push_str(", World!"); // Iterating over characters for let c of "hello".chars() { diff --git a/docs/spec.md b/docs/spec.md index 194508722..adde44ff2 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -1171,9 +1171,9 @@ The `append` method provides efficient O(1) amortized string building: ```wado let mut builder = String::with_capacity(20); -builder.append("Hello"); -builder.append(", "); -builder.append("World!"); +builder.push_str("Hello"); +builder.push_str(", "); +builder.push_str("World!"); // builder is now "Hello, World!" // Static method for two-string concatenation @@ -1679,7 +1679,7 @@ arr[0] = 100; // Requires mutable array arr[1] = 200; // Array methods -arr.append(4); // Add element to end +arr.push(4); // Add element to end let len = arr.len(); // Get length ``` @@ -3968,7 +3968,7 @@ The `stores[...]` keyword declares that a function stores reference parameters b ```wado // Function that stores a reference parameter fn register(data: &Data) -> Handle with stores[data] { - registry.append(data); // Stores the reference + registry.push(data); // Stores the reference return new_handle(); } @@ -4067,7 +4067,7 @@ fn collect_all() -> Array { with handler Generator { yield(value) => |resume| { - result.append(value); + result.push(value); resume(); }, } { diff --git a/docs/stdlib-core.md b/docs/stdlib-core.md index 893e275c5..850d3bf41 100644 --- a/docs/stdlib-core.md +++ b/docs/stdlib-core.md @@ -1596,10 +1596,14 @@ caller MUST fill all `n` bytes before the string is observed. Append `n` copies of `byte` to this string using array.fill. Much faster than a loop for large n (e.g., trailing zeros in large integers). +##### `pub fn push_str(&mut self, other: String)` + +Appends another string to this string. +Grows the string if necessary (O(1) amortized). + ##### `pub fn append(&mut self, other: String)` -Append another string to this string -Grows the string if necessary (O(1) amortized) +@deprecated Use `push_str` instead. ##### `pub fn concat(a: String, b: String) -> String` @@ -1614,13 +1618,17 @@ Returns an iterator over the UTF-8 bytes of the string. Returns an iterator over the Unicode scalar values (chars) of the string. +##### `pub fn push(&mut self, c: char)` + +Appends a Unicode scalar value (char) to this string. + ##### `pub fn append_char(&mut self, c: char)` -Append a Unicode scalar value (char) to this string. +@deprecated Use `push` instead. -##### `pub fn truncate_bytes(&mut self, byte_len: i32)` +##### `pub fn truncate(&mut self, byte_len: i32)` -Truncate the string to the given byte length. +Truncates the string to the given byte length. Panics if `byte_len` is not on a UTF-8 character boundary. ##### `pub fn truncate_chars(&mut self, char_count: i32)` @@ -1628,6 +1636,34 @@ Panics if `byte_len` is not on a UTF-8 character boundary. Truncate the string to the given number of characters. If `char_count` >= number of characters, the string is unchanged. +##### `pub fn truncate_bytes(&mut self, byte_len: i32)` + +@deprecated Use `truncate` instead. + +##### `pub fn pop(&mut self) -> Option` + +Removes and returns the last character, or None if empty. + +##### `pub fn clear(&mut self)` + +Removes all contents, making the string empty. + +##### `pub fn capacity(&self) -> i32` + +Returns the total capacity in bytes. + +##### `pub fn reserve(&mut self, additional: i32)` + +Reserves capacity for at least `additional` more bytes. + +##### `pub fn shrink_to_fit(&mut self)` + +Shrinks the capacity to match the current byte length. + +##### `pub fn as_bytes(&self) -> Array` + +Returns the bytes of this string as an Array. + ##### `pub fn trim_ascii_start(&self) -> String` Returns a new string with leading ASCII whitespace removed. @@ -1662,6 +1698,62 @@ Non-ASCII bytes are left unchanged. Returns a new string with all ASCII lowercase letters converted to uppercase. Non-ASCII bytes are left unchanged. +##### `pub fn contains(&self, pat: String) -> bool` + +Returns true if this string contains the given substring. + +##### `pub fn starts_with(&self, pat: String) -> bool` + +Returns true if this string starts with the given prefix. + +##### `pub fn ends_with(&self, pat: String) -> bool` + +Returns true if this string ends with the given suffix. + +##### `pub fn find(&self, pat: String) -> Option` + +Returns the byte index of the first occurrence of `pat`, or None. + +##### `pub fn rfind(&self, pat: String) -> Option` + +Returns the byte index of the last occurrence of `pat`, or None. + +##### `pub fn contains_char(&self, ch: char) -> bool` + +Returns true if the string contains the given character. + +##### `pub fn find_char(&self, pred: Fn(char) -> bool) -> Option` + +Returns the byte index of the first character matching the predicate, or None. + +##### `pub fn insert(&mut self, byte_index: i32, ch: char)` + +Inserts a character at the given byte index. +Panics if `byte_index` is not on a UTF-8 character boundary. + +##### `pub fn insert_str(&mut self, byte_index: i32, s: String)` + +Inserts a string at the given byte index. +Panics if `byte_index` is not on a UTF-8 character boundary. + +##### `pub fn remove(&mut self, byte_index: i32) -> char` + +Removes and returns the character at the given byte index. +Panics if the index is not on a UTF-8 character boundary. + +##### `pub fn repeat(&self, n: i32) -> String` + +Returns this string repeated `n` times. + +##### `pub fn replace(&self, from: String, to: String) -> String` + +Replaces all occurrences of `from` with `to`. + +##### `pub fn replacen(&self, from: String, to: String, count: i32) -> String` + +Replaces the first `count` occurrences of `from` with `to`. +If `count` is negative, replaces all occurrences. + ##### `pub fn from_iter>(iter: I) -> String` Build a String from any iterable of chars. @@ -1690,6 +1782,26 @@ Accepts any `IntoIterator` whose item is `u8`: `Array`, `StrUtf8ByteIter`, e The caller must ensure the bytes form valid UTF-8, otherwise the resulting String will contain invalid UTF-8, which may cause undefined behavior. +##### `pub fn split(&self, sep: String) -> StrSplitIter` + +Returns an iterator over substrings split by the given separator. + +##### `pub fn splitn(&self, n: i32, sep: String) -> StrSplitNIter` + +Returns an iterator over at most `n` substrings split by the given separator. + +##### `pub fn split_whitespace(&self) -> StrSplitWhitespaceIter` + +Returns an iterator over whitespace-separated substrings. + +##### `pub fn lines(&self) -> StrLinesIter` + +Returns an iterator over the lines of this string. + +##### `pub fn char_indices(&self) -> StrCharIndicesIter` + +Returns an iterator over characters with their byte indices. + ##### `impl Add for String` ###### `pub fn add(&self, other: &Self) -> Self::Output` @@ -1862,26 +1974,83 @@ _Fields are private._ ##### `pub fn is_empty(&self) -> bool` +##### `pub fn capacity(&self) -> i32` + +Returns the total number of elements the array can hold without reallocating. + ##### `pub fn internal_raw_data(&self) -> builtin::array` ##### `pub fn internal_from_raw(repr: builtin::array, used: i32) -> Array` +##### `pub fn push(&mut self, value: T)` + +Appends a single element to the end. + ##### `pub fn append(&mut self, value: T)` +@deprecated Use `push` instead. + ##### `pub fn pop(&mut self) -> Option` -##### `pub fn truncate(&mut self, len: i32)` +##### `pub fn first(&self) -> Option` + +Returns the first element, or None if empty. ##### `pub fn last(&self) -> Option` ##### `pub fn get(&self, index: i32) -> Option` +##### `pub fn insert(&mut self, index: i32, value: T)` + +Inserts an element at the given index, shifting all elements after it to the right. +Panics if `index > len()`. + +##### `pub fn remove(&mut self, index: i32) -> T` + +Removes and returns the element at the given index, shifting all elements after it to the left. +Panics if `index >= len()`. + +##### `pub fn swap(&mut self, a: i32, b: i32)` + +Swaps two elements by index. +Panics if either index is out of bounds. + +##### `pub fn truncate(&mut self, len: i32)` + +##### `pub fn clear(&mut self)` + +Removes all elements. + +##### `pub fn reserve(&mut self, additional: i32)` + +Reserves capacity for at least `additional` more elements. + +##### `pub fn shrink_to_fit(&mut self)` + +Shrinks the capacity to match the current length. + +##### `pub fn extend(&mut self, other: &Array)` + +Extends this array with elements from another array. + +##### `pub fn reverse(&mut self)` + +Reverses the elements in place. + +##### `pub fn repeat(&self, n: i32) -> Array` + +Returns a new array containing this array's elements repeated `n` times. + ##### `pub fn copy_within_append(&mut self, src_start: i32, count: i32)` Copies `count` elements from `self[src_start..]` and appends them. Handles overlapping regions correctly for both non-overlapping and DEFLATE-style run-length expansion (where src < dst). Forward order is correct in both cases. +##### `pub fn contains(&self, value: &T) -> bool` + +Returns true if the array contains the given value. + ##### `pub fn slice(&self, start: i32, end: i32) -> ArraySlice` ##### `pub fn iter(&self) -> ArrayIter` @@ -1892,10 +2061,24 @@ In-place sort with comparator. Stable, O(n log n) worst case. ##### `pub fn sorted_by(&self, cmp: Fn(&T, &T) -> Ordering) -> Array` +##### `pub fn windows(&self, size: i32) -> WindowsIter` + +Returns an iterator of overlapping windows of size `size`. +Panics if `size` is 0. + +##### `pub fn chunks(&self, size: i32) -> ChunksIter` + +Returns an iterator of non-overlapping chunks of size `size`. +The last chunk may be shorter. Panics if `size` is 0. + ##### `pub fn sort(&mut self)` ##### `pub fn sorted(&self) -> Array` +##### `pub fn join(&self, separator: String) -> String` + +Joins elements into a string with the given separator. + ##### `impl IndexValue for Array` ###### `fn index_value(&self, index: i32) -> Self::Output` diff --git a/docs/wep-2026-03-29-redesign-string-array-api.md b/docs/wep-2026-03-29-redesign-string-array-api.md new file mode 100644 index 000000000..7ee2ee336 --- /dev/null +++ b/docs/wep-2026-03-29-redesign-string-array-api.md @@ -0,0 +1,315 @@ +# WEP: Redesign String and Array APIs + +## Status + +Draft + +## Context + +Wado's `String` and `Array` are designed to feel familiar to Rust developers, but many commonly used methods from Rust's `String`/`&str` and `Vec`/`&[T]` are missing or named differently. This proposal catalogs the gaps and adds the missing pieces. + +Wado intentionally omits Rust concepts tied to ownership and lifetimes (`as_str()`, `as_mut_slice()`, `into_boxed_str()`, `Cow`, etc.). Everything else should be available. + +## Decision + +### Array vs Rust's `Vec` / `&[T]` + +#### Mapping Table + +"—" means intentionally excluded (see rationale below the table). + +| Rust `Vec` / `&[T]` | Wado `Array` | Status | +| ------------------------ | ----------------------------------------- | --------------------------------------- | +| `Vec::new()` | `[]` (literal) or `Array::::default()` | OK | +| `Vec::with_capacity(n)` | `Array::::with_capacity(n)` | OK | +| `vec![x; n]` | `Array::filled(n, x)` | OK | +| `len()` | `len()` | OK | +| `is_empty()` | `is_empty()` | OK | +| `v[i]` (index) | `arr[i]` | OK | +| `v[i] = x` (assign) | `arr[i] = x` | OK | +| `get(i)` | `get(i)` | OK | +| `first()` | `first()` | NEW | +| `last()` | `last()` | OK | +| `push(x)` | `push(x)` | RENAME from `append` | +| `pop()` | `pop()` | OK | +| `insert(i, x)` | `insert(i, x)` | NEW | +| `remove(i)` | `remove(i)` | NEW | +| `swap(a, b)` | `swap(a, b)` | NEW | +| `truncate(len)` | `truncate(len)` | OK | +| `clear()` | `clear()` | NEW | +| `extend(iter)` | `extend(iter)` | NEW | +| `extend_from_slice(s)` | — | use `extend` | +| `contains(&x)` | `contains(&x)` | NEW | +| `iter()` | `iter()` | OK | +| `sort()` | `sort()` | OK | +| `sort_by(cmp)` | `sort_by(cmp)` | OK | +| `sort_by_key(f)` | — | use `sort_by` | +| `sort_unstable()` | — | `sort()` is stable; unstable not needed | +| `binary_search(&x)` | — | use `TreeMap` / `TreeSet` instead | +| `reverse()` | `reverse()` | NEW | +| `dedup()` | — | use `TreeSet` | +| `dedup_by(f)` | — | use `TreeSet` | +| `retain(pred)` | — | use `.iter().filter().collect()` | +| `windows(n)` | `windows(n)` | NEW | +| `chunks(n)` | `chunks(n)` | NEW | +| `repeat(n)` | `repeat(n)` | NEW | +| `concat()` / `join(sep)` | `join(sep)` | NEW | +| `split_at(i)` | — | use `slice` + `truncate` | +| `split_off(i)` | — | use `slice` + `truncate` | +| `drain(..)` | — | complex; use iterator | +| `rotate_left(n)` | — | niche | +| `rotate_right(n)` | — | niche | +| `resize(n, val)` | — | use `truncate` + `extend` | +| `capacity()` | `capacity()` | NEW | +| `reserve(n)` | `reserve(n)` | NEW | +| `shrink_to_fit()` | `shrink_to_fit()` | NEW | +| `as_slice()` | — | no borrowing distinction | +| `as_mut_slice()` | — | no borrowing distinction | +| `into_boxed_slice()` | — | no ownership transfer | +| `leak()` | — | no ownership model | + +Also available via existing Wado features: + +| Rust | Wado equivalent | +| ------------------------------ | -------------------------------------------------- | +| `v[start..end]` | `arr[start..end]` (range indexing, WEP-2026-03-03) | +| `v.iter().filter(f).collect()` | same (Iterator trait) | +| `v.iter().map(f).collect()` | same | +| `v.iter().fold(init, f)` | same | +| `v.iter().find(pred)` | same | +| `v.iter().position(pred)` | same | +| `v.iter().any(pred)` | same | +| `v.iter().all(pred)` | same | +| `v.iter().enumerate()` | same | +| `v.iter().take(n)` | same | +| `v.iter().skip(n)` | same | +| `v.iter().chain(other)` | same | +| `v.iter().zip(other)` | same | +| `v.iter().count()` | same | +| `v.iter().sum()` | `arr.iter().sum()` (on ArrayIter) | +| `v.iter().min()` | `arr.iter().min()` (on ArrayIter) | +| `v.iter().max()` | `arr.iter().max()` (on ArrayIter) | + +#### New Array Methods — Signatures + +```wado +impl Array { + pub fn first(&self) -> Option; + pub fn push(&mut self, value: T); // rename from append + pub fn insert(&mut self, index: i32, value: T); + pub fn remove(&mut self, index: i32) -> T; + pub fn swap(&mut self, a: i32, b: i32); + pub fn clear(&mut self); + pub fn capacity(&self) -> i32; + pub fn reserve(&mut self, additional: i32); + pub fn shrink_to_fit(&mut self); + pub fn extend>(&mut self, iter: I); + pub fn reverse(&mut self); + pub fn repeat(&self, n: i32) -> Array; + pub fn windows(&self, size: i32) -> WindowsIter; + pub fn chunks(&self, size: i32) -> ChunksIter; +} + +impl Array { + pub fn contains(&self, value: &T) -> bool; +} + +impl Array { + pub fn join(&self, separator: String) -> String; +} +``` + +### String vs Rust's `String` / `&str` + +#### Mapping Table + +| Rust `String` / `&str` | Wado `String` | Status | +| ------------------------------------ | ------------------------------------- | --------------------------------------- | +| `String::new()` | `""` (literal) or `String::default()` | OK | +| `String::with_capacity(n)` | `String::with_capacity(n)` | OK | +| `len()` | `len()` (byte length) | OK | +| `is_empty()` | `is_empty()` | OK | +| `push(ch)` | `push(ch)` | RENAME from `append_char` | +| `push_str(s)` | `push_str(s)` | RENAME from `append` | +| `pop()` | `pop()` | NEW | +| `insert(i, ch)` | `insert(i, ch)` | NEW (byte index) | +| `insert_str(i, s)` | `insert_str(i, s)` | NEW (byte index) | +| `remove(i)` | `remove(i)` | NEW (byte index, returns char) | +| `truncate(n)` | `truncate(n)` | RENAME from `truncate_bytes` | +| `clear()` | `clear()` | NEW | +| `chars()` | `chars()` | OK | +| `bytes()` | `bytes()` | OK | +| `char_indices()` | `char_indices()` | NEW | +| `contains(pat)` | `contains(pat)` | NEW | +| `starts_with(pat)` | `starts_with(pat)` | NEW | +| `ends_with(pat)` | `ends_with(pat)` | NEW | +| `find(pat)` | `find(pat)` | NEW | +| `rfind(pat)` | `rfind(pat)` | NEW | +| `split(pat)` | `split(sep)` | NEW (returns iterator) | +| `splitn(n, pat)` | `splitn(n, sep)` | NEW (returns iterator) | +| `rsplit(pat)` | — | niche | +| `rsplitn(n, pat)` | — | niche | +| `split_whitespace()` | `split_whitespace()` | NEW (returns iterator) | +| `lines()` | `lines()` | NEW (returns iterator) | +| `trim()` | `trim()` | OK | +| `trim_start()` | `trim_start()` | OK | +| `trim_end()` | `trim_end()` | OK | +| `trim_ascii()` | `trim_ascii()` | OK | +| `trim_ascii_start()` | `trim_ascii_start()` | OK | +| `trim_ascii_end()` | `trim_ascii_end()` | OK | +| `replace(from, to)` | `replace(from, to)` | NEW | +| `replacen(from, to, n)` | `replacen(from, to, n)` | NEW | +| `to_lowercase()` | `to_lowercase()` | NEW (Unicode) | +| `to_uppercase()` | `to_uppercase()` | NEW (Unicode) | +| `to_ascii_lowercase()` | `to_ascii_lowercase()` | OK | +| `to_ascii_uppercase()` | `to_ascii_uppercase()` | OK | +| `repeat(n)` | `repeat(n)` | NEW | +| `starts_with(ch)` / `starts_with(s)` | overloaded or separate | see below | +| `s + &t` | `s + t` | OK | +| `s += &t` | `s += t` | OK | +| `String::from_utf8(bytes)` | `String::from_utf8(bytes)` | OK | +| `String::from_utf8_lossy(bytes)` | `String::from_utf8_lossy(bytes)` | OK | +| `String::from_utf8_unchecked(bytes)` | `String::from_utf8_unchecked(bytes)` | OK | +| `as_bytes()` | `as_bytes()` | NEW (returns `Array`) | +| `as_str()` | — | no borrowing distinction | +| `into_bytes()` | — | no ownership transfer, use `as_bytes()` | +| `capacity()` | `capacity()` | NEW | +| `reserve(n)` | `reserve(n)` | NEW | +| `shrink_to_fit()` | `shrink_to_fit()` | NEW | +| `drain(..)` | — | complex | +| `retain(pred)` | — | use `.chars().filter().collect()` | +| `split_off(i)` | — | niche | +| `encode_utf16()` | — | not needed for Wasm/WASI | + +Also available via existing Wado features: + +| Rust | Wado equivalent | +| ------------------------------- | ---------------------------------------- | +| `format!("{}", x)` | `` `{x}` `` (template string) | +| `s.chars().filter(f).collect()` | `String::from_iter(s.chars().filter(f))` | +| `s.chars().count()` | `s.chars().count()` | + +#### Pattern Argument Design + +Rust's `str::contains`, `find`, `split`, etc. accept a `Pattern` trait that works with `&str`, `char`, and closures. Wado simplifies this: + +- **String patterns**: `contains(pat: String)`, `find(pat: String)`, `split(sep: String)` — substring matching. +- **Char patterns**: `contains_char(ch: char)`, `find_char(pred: fn(&char) -> bool)` — character-level matching. +- **`starts_with` / `ends_with`**: Accept `String`. For single char, use `s.starts_with(String::from('x'))`. + +This avoids the complexity of a Pattern trait while covering the common cases. + +#### String Byte-Index Convention + +Following Rust, `String` methods that accept or return indices use **byte indices**, not char indices: + +- `find(pat)` → `Option` (byte index) +- `insert(i, ch)` — `i` is a byte index +- `remove(i)` — `i` is a byte index +- `truncate(n)` — `n` is byte count + +This is consistent with `len()` returning byte length and matches Rust's design. Methods panic if the index is not on a char boundary. + +#### New String Methods — Signatures + +```wado +impl String { + pub fn push(&mut self, ch: char); // rename from append_char + pub fn push_str(&mut self, s: String); // rename from append + pub fn pop(&mut self) -> Option; + pub fn insert(&mut self, byte_index: i32, ch: char); + pub fn insert_str(&mut self, byte_index: i32, s: String); + pub fn remove(&mut self, byte_index: i32) -> char; + pub fn truncate(&mut self, byte_len: i32); // rename from truncate_bytes + pub fn clear(&mut self); + pub fn capacity(&self) -> i32; + pub fn reserve(&mut self, additional: i32); + pub fn shrink_to_fit(&mut self); + pub fn as_bytes(&self) -> Array; + pub fn contains(&self, pat: String) -> bool; + pub fn starts_with(&self, pat: String) -> bool; + pub fn ends_with(&self, pat: String) -> bool; + pub fn find(&self, pat: String) -> Option; // byte index + pub fn rfind(&self, pat: String) -> Option; // byte index + pub fn contains_char(&self, ch: char) -> bool; + pub fn find_char(&self, pred: fn(&char) -> bool) -> Option; // byte index + pub fn split(&self, sep: String) -> StrSplitIter; // Iterator + pub fn splitn(&self, n: i32, sep: String) -> StrSplitNIter; // Iterator + pub fn split_whitespace(&self) -> StrSplitWhitespaceIter; // Iterator + pub fn lines(&self) -> StrLinesIter; // Iterator + pub fn replace(&self, from: String, to: String) -> String; + pub fn replacen(&self, from: String, to: String, count: i32) -> String; + pub fn to_lowercase(&self) -> String; + pub fn to_uppercase(&self) -> String; + pub fn repeat(&self, n: i32) -> String; + pub fn char_indices(&self) -> StrCharIndicesIter; // Iterator +} +``` + +### Renames and Deprecations + +| Type | Old Name | New Name | Reason | +| -------- | ------------------- | ------------- | ----------------------------- | +| `Array` | `append(value)` | `push(value)` | Match Rust `Vec::push` | +| `String` | `append_char(c)` | `push(c)` | Match Rust `String::push` | +| `String` | `append(s)` | `push_str(s)` | Match Rust `String::push_str` | +| `String` | `truncate_bytes(n)` | `truncate(n)` | Match Rust `String::truncate` | + +Old names remain as deprecated aliases with compiler warnings during transition. + +`String::truncate_chars(n)` is kept as-is — it has no Rust equivalent (Rust has no char-count truncation) and the `_chars` suffix makes the distinction clear. + +### Existing Wado-Specific Methods (Kept) + +These have no direct Rust counterpart but are useful in Wado: + +| Method | Purpose | +| ---------------------------------------- | ---------------------------------------- | +| `Array::filled(n, x)` | Like `vec![x; n]` but as a static method | +| `Array::sorted()` / `sorted_by()` | Non-mutating sort (returns new Array) | +| `Array::slice(start, end)` | Explicit slice creation | +| `Array::copy_within_append()` | Low-level, used by zlib | +| `String::concat(a, b)` | Static two-string concatenation | +| `String::from_iter(iter)` | Construct from char iterator | +| `String::get_byte(i)` / `set_byte(i, v)` | Low-level byte access | +| `String::append_byte_filled(byte, n)` | Low-level byte fill | +| `String::trim_ascii*()` | ASCII-only trim variants | + +## Consequences + +### Positive + +1. **Rust familiarity**: Developers can transfer Rust knowledge directly. +2. **Completeness**: Common operations (`contains`, `split`, `join`, `find`, `replace`) no longer require manual loops. +3. **Consistent naming**: `push` = one element, `push_str` = string, `extend` = iterable — same vocabulary as Rust. + +### Negative + +1. **Breaking rename**: `append` → `push` / `push_str` requires migration (mitigated by deprecation period). +2. **Byte-index convention for String**: Char-boundary panics can surprise users unfamiliar with UTF-8. Documented clearly. + +### Implementation Priority + +1. **High** (most requested): + - `push` / `push_str` (rename), `clear`, `contains`, `starts_with`, `ends_with` + - `String::split`, `String::replace`, `String::find` + - `Array::join`, `Array::contains` +2. **Medium**: + - `insert`, `remove`, `reverse`, `extend` + - `String::lines`, `String::split_whitespace`, `String::repeat` + - `Array::first`, `Array::repeat` +3. **Lower**: + - `swap`, `windows`, `chunks` + - `String::rfind`, `String::splitn`, `String::replacen`, `String::char_indices` + - `String::to_lowercase`, `String::to_uppercase` + +## Implementation TODOs + +- [ ] Phase 1: Add new methods (high priority) +- [ ] Phase 1: Add new methods (medium priority) +- [ ] Phase 1: Add new methods (lower priority) +- [ ] Phase 2: Deprecation warnings for old names +- [ ] Phase 3: Remove deprecated aliases +- [ ] Update `docs/cheatsheet.md` +- [ ] Update `docs/cheatsheet-stdlib-core.md` (auto-generated) +- [ ] Update `docs/spec.md` diff --git a/wado-compiler/lib/core/base64.wado b/wado-compiler/lib/core/base64.wado index 0942dd7d6..0501f428b 100644 --- a/wado-compiler/lib/core/base64.wado +++ b/wado-compiler/lib/core/base64.wado @@ -73,28 +73,28 @@ fn encode_impl(data: &Array, table: &Array, pad: bool) -> String { let b0 = data[i] as i32; let b1 = data[i + 1] as i32; let b2 = data[i + 2] as i32; - out.append_char(table[b0 >> 2 & 63] as char); - out.append_char(table[(b0 << 4 | b1 >> 4) & 63] as char); - out.append_char(table[(b1 << 2 | b2 >> 6) & 63] as char); - out.append_char(table[b2 & 63] as char); + out.push(table[b0 >> 2 & 63] as char); + out.push(table[(b0 << 4 | b1 >> 4) & 63] as char); + out.push(table[(b1 << 2 | b2 >> 6) & 63] as char); + out.push(table[b2 & 63] as char); i += 3; } if remainder == 1 { let b0 = data[i] as i32; - out.append_char(table[b0 >> 2 & 63] as char); - out.append_char(table[b0 << 4 & 63] as char); + out.push(table[b0 >> 2 & 63] as char); + out.push(table[b0 << 4 & 63] as char); if pad { - out.append("=="); + out.push_str("=="); } } else if remainder == 2 { let b0 = data[i] as i32; let b1 = data[i + 1] as i32; - out.append_char(table[b0 >> 2 & 63] as char); - out.append_char(table[(b0 << 4 | b1 >> 4) & 63] as char); - out.append_char(table[b1 << 2 & 63] as char); + out.push(table[b0 >> 2 & 63] as char); + out.push(table[(b0 << 4 | b1 >> 4) & 63] as char); + out.push(table[b1 << 2 & 63] as char); if pad { - out.append_char('='); + out.push('='); } } @@ -155,9 +155,9 @@ fn decode_impl(input: &Array, input_len: i32) -> Option> { return null; } - out.append((v0 << 2 | v1 >> 4) as u8); - out.append(((v1 & 15) << 4 | v2 >> 2) as u8); - out.append(((v2 & 3) << 6 | v3) as u8); + out.push((v0 << 2 | v1 >> 4) as u8); + out.push(((v1 & 15) << 4 | v2 >> 2) as u8); + out.push(((v2 & 3) << 6 | v3) as u8); i += 4; } @@ -167,7 +167,7 @@ fn decode_impl(input: &Array, input_len: i32) -> Option> { if v0 >= 254 || v1 >= 254 { return null; } - out.append((v0 << 2 | v1 >> 4) as u8); + out.push((v0 << 2 | v1 >> 4) as u8); } else if remainder == 3 { let v0 = table[input[i] as i32] as i32; let v1 = table[input[i + 1] as i32] as i32; @@ -175,8 +175,8 @@ fn decode_impl(input: &Array, input_len: i32) -> Option> { if v0 >= 254 || v1 >= 254 || v2 >= 254 { return null; } - out.append((v0 << 2 | v1 >> 4) as u8); - out.append(((v1 & 15) << 4 | v2 >> 2) as u8); + out.push((v0 << 2 | v1 >> 4) as u8); + out.push(((v1 & 15) << 4 | v2 >> 2) as u8); } return Option::Some(out); diff --git a/wado-compiler/lib/core/base64_test.wado b/wado-compiler/lib/core/base64_test.wado index c93c64c23..df2991bb4 100644 --- a/wado-compiler/lib/core/base64_test.wado +++ b/wado-compiler/lib/core/base64_test.wado @@ -33,7 +33,7 @@ test "encode three bytes" { test "encode all byte values" { let mut data: Array = Array::::with_capacity(256); for let mut i = 0; i < 256; i += 1 { - data.append(i as u8); + data.push(i as u8); } assert decode(encode(&data)) matches { Some(d) && d == data }; } @@ -139,7 +139,7 @@ test "round-trip various lengths" { for let mut size = 0; size <= 20; size += 1 { let mut data: Array = Array::::with_capacity(size); for let mut j = 0; j < size; j += 1 { - data.append(((j * 7 + 13) % 256) as u8); + data.push(((j * 7 + 13) % 256) as u8); } if let Some(decoded) = decode(encode(&data)) { diff --git a/wado-compiler/lib/core/collections.wado b/wado-compiler/lib/core/collections.wado index 15f57130d..0de92db2b 100644 --- a/wado-compiler/lib/core/collections.wado +++ b/wado-compiler/lib/core/collections.wado @@ -189,7 +189,7 @@ impl TreeMap { value, deleted: false, }; - self.entries.append(entry); + self.entries.push(entry); // insert_node will update the index if the key already exists in tree self.root = self.insert_node(self.root, key, new_index); self.size = self.size + 1; @@ -240,7 +240,7 @@ impl TreeMap { let mut new_entries: Array> = []; for let entry of self.entries { if !entry.deleted { - new_entries.append(TreeMapEntry { + new_entries.push(TreeMapEntry { key: entry.key, value: entry.value, deleted: false, @@ -266,7 +266,7 @@ impl TreeMap { let mut result: Array = []; for let entry of self.entries { if !entry.deleted { - result.append(entry.key); + result.push(entry.key); } } return result; @@ -277,7 +277,7 @@ impl TreeMap { let mut result: Array = []; for let entry of self.entries { if !entry.deleted { - result.append(entry.value); + result.push(entry.value); } } return result; @@ -288,7 +288,7 @@ impl TreeMap { let mut result: Array<[K, V]> = []; for let entry of self.entries { if !entry.deleted { - result.append([entry.key, entry.value]); + result.push([entry.key, entry.value]); } } return result; diff --git a/wado-compiler/lib/core/collections/treemap_test.wado b/wado-compiler/lib/core/collections/treemap_test.wado index 50e08cd56..d02ce245a 100644 --- a/wado-compiler/lib/core/collections/treemap_test.wado +++ b/wado-compiler/lib/core/collections/treemap_test.wado @@ -387,8 +387,8 @@ test "for-of over entries" { let mut ks: Array = []; let mut vs: Array = []; for let [k, v] of map.entries() { - ks.append(k); - vs.append(v); + ks.push(k); + vs.push(v); } assert ks.len() == 3; assert ks[0] == "a" && vs[0] == 1; @@ -402,7 +402,7 @@ test "for-of over keys" { map["y"] = 20; let mut result: Array = []; for let k of map.keys() { - result.append(k); + result.push(k); } assert result.len() == 2; assert result[0] == "x"; diff --git a/wado-compiler/lib/core/collections/treeset_test.wado b/wado-compiler/lib/core/collections/treeset_test.wado index e2cd79134..ffd08bccb 100644 --- a/wado-compiler/lib/core/collections/treeset_test.wado +++ b/wado-compiler/lib/core/collections/treeset_test.wado @@ -103,7 +103,7 @@ test "iterates in insertion order" { s.insert(20); let mut result: Array = []; for let x of s { - result.append(x); + result.push(x); } assert result.len() == 3; assert result[0] == 30; @@ -119,7 +119,7 @@ test "duplicate insert does not change order" { s.insert(1); let mut result: Array = []; for let x of s { - result.append(x); + result.push(x); } assert result.len() == 3; assert result[0] == 3; @@ -136,7 +136,7 @@ test "remove and re-insert appends to end" { assert s.insert(1); let mut result: Array = []; for let x of s { - result.append(x); + result.push(x); } assert result.len() == 3; assert result[0] == 2; @@ -152,7 +152,7 @@ test "iteration skips removed elements" { s.remove(20); let mut result: Array = []; for let x of s { - result.append(x); + result.push(x); } assert result.len() == 2; assert result[0] == 10; @@ -188,11 +188,11 @@ test "iterate same set twice" { s.insert(3); let mut first: Array = []; for let x of s { - first.append(x); + first.push(x); } let mut second: Array = []; for let x of s { - second.append(x); + second.push(x); } assert first.len() == 3; assert second.len() == 3; @@ -222,7 +222,7 @@ test "negative integers" { assert !s.contains(0); let mut result: Array = []; for let x of s { - result.append(x); + result.push(x); } assert result[0] == -3; assert result[1] == -1; @@ -237,7 +237,7 @@ test "sequence literal coercion preserves insertion order" { assert s.contains(30); let mut result: Array = []; for let x of s { - result.append(x); + result.push(x); } assert result[0] == 30; assert result[1] == 10; @@ -249,7 +249,7 @@ test "sequence literal coercion deduplicates" { assert s.len() == 3; let mut result: Array = []; for let x of s { - result.append(x); + result.push(x); } assert result[0] == 1; assert result[1] == 2; @@ -281,7 +281,7 @@ test "string set insertion order" { s.insert("b"); let mut result: Array = []; for let x of s { - result.append(x); + result.push(x); } assert result[0] == "c"; assert result[1] == "a"; @@ -358,7 +358,7 @@ test "compaction after many removals" { assert !s.contains(39); let mut result: Array = []; for let x of s { - result.append(x); + result.push(x); } assert result.len() == 10; assert result[0] == 40; diff --git a/wado-compiler/lib/core/json.wado b/wado-compiler/lib/core/json.wado index 0707969d4..bed209b29 100644 --- a/wado-compiler/lib/core/json.wado +++ b/wado-compiler/lib/core/json.wado @@ -52,30 +52,30 @@ pub fn utf8_sequence_length(leading_byte: i32) -> i32 { /// Writes a JSON-escaped string (with surrounding quotes) into buf. pub fn write_escaped_string(buf: &mut String, s: &String) { - buf.append_char('"'); + buf.push('"'); for let c of s.chars() { if c == '"' { - buf.append("\\\""); + buf.push_str("\\\""); } else if c == '\\' { - buf.append("\\\\"); + buf.push_str("\\\\"); } else if c == '\n' { - buf.append("\\n"); + buf.push_str("\\n"); } else if c == '\r' { - buf.append("\\r"); + buf.push_str("\\r"); } else if c == '\t' { - buf.append("\\t"); + buf.push_str("\\t"); } else if (c as u32) < 0x20 { - buf.append("\\u00"); + buf.push_str("\\u00"); let code = c as i32; let hi = code >> 4 & 0xF; let lo = code & 0xF; - buf.append_char(hex_digit(hi)); - buf.append_char(hex_digit(lo)); + buf.push(hex_digit(hi)); + buf.push(hex_digit(lo)); } else { - buf.append_char(c); + buf.push(c); } } - buf.append_char('"'); + buf.push('"'); } struct JsonSeqSerializer { @@ -105,7 +105,7 @@ pub struct JsonSerializer { impl SerializeSeq for JsonSeqSerializer { fn element(&mut self, value: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.buf.append(","); + self.buf.push_str(","); } let mut ser = JsonSerializer { buf: self.buf }; let r = value.serialize::(&mut ser); @@ -115,7 +115,7 @@ impl SerializeSeq for JsonSeqSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.buf.append("]"); + self.buf.push_str("]"); return Result::<(), SerializeError>::Ok(()); } } @@ -123,12 +123,12 @@ impl SerializeSeq for JsonSeqSerializer { impl SerializeMap for JsonMapSerializer { fn key(&mut self, key: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.buf.append(","); + self.buf.push_str(","); } let mut ser = JsonSerializer { buf: self.buf }; let r = key.serialize::(&mut ser); self.buf = ser.buf; - self.buf.append(":"); + self.buf.push_str(":"); self.need_value = true; return r; } @@ -143,7 +143,7 @@ impl SerializeMap for JsonMapSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.buf.append("}"); + self.buf.push_str("}"); return Result::<(), SerializeError>::Ok(()); } } @@ -151,10 +151,10 @@ impl SerializeMap for JsonMapSerializer { impl SerializeStruct for JsonStructSerializer { fn field(&mut self, name: &String, value: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.buf.append(","); + self.buf.push_str(","); } write_escaped_string(&mut self.buf, name); - self.buf.append(":"); + self.buf.push_str(":"); let mut ser = JsonSerializer { buf: self.buf }; let r = value.serialize::(&mut ser); self.buf = ser.buf; @@ -163,7 +163,7 @@ impl SerializeStruct for JsonStructSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.buf.append("}"); + self.buf.push_str("}"); return Result::<(), SerializeError>::Ok(()); } } @@ -177,7 +177,7 @@ impl SerializeVariant for JsonVariantSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.buf.append("}"); + self.buf.push_str("}"); return Result::<(), SerializeError>::Ok(()); } } @@ -189,44 +189,44 @@ impl Serializer for JsonSerializer { type VariantSerializer = JsonVariantSerializer; fn serialize_i32(&mut self, v: i32) -> Result<(), SerializeError> { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_i64(&mut self, v: i64) -> Result<(), SerializeError> { // Values outside ±2^53-1 are serialized as strings for JS safety if v > 9007199254740991 || v < -9007199254740991 { - self.buf.append(`"{v}"`); + self.buf.push_str(`"{v}"`); } else { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); } return Result::<(), SerializeError>::Ok(()); } fn serialize_u32(&mut self, v: u32) -> Result<(), SerializeError> { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_u64(&mut self, v: u64) -> Result<(), SerializeError> { // Values above 2^53-1 are serialized as strings for JS safety if v > 9007199254740991 { - self.buf.append(`"{v}"`); + self.buf.push_str(`"{v}"`); } else { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); } return Result::<(), SerializeError>::Ok(()); } fn serialize_i128(&mut self, v: i128) -> Result<(), SerializeError> { // i128 always serialized as string (always exceeds JS safe integer range) - self.buf.append(`"{v}"`); + self.buf.push_str(`"{v}"`); return Result::<(), SerializeError>::Ok(()); } fn serialize_u128(&mut self, v: u128) -> Result<(), SerializeError> { // u128 always serialized as string (always exceeds JS safe integer range) - self.buf.append(`"{v}"`); + self.buf.push_str(`"{v}"`); return Result::<(), SerializeError>::Ok(()); } @@ -243,7 +243,7 @@ impl Serializer for JsonSerializer { message: "Infinity is not allowed in JSON", }); } - self.buf.append(`{v as f64}`); + self.buf.push_str(`{v as f64}`); return Result::<(), SerializeError>::Ok(()); } @@ -260,15 +260,15 @@ impl Serializer for JsonSerializer { message: "Infinity is not allowed in JSON", }); } - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_bool(&mut self, v: bool) -> Result<(), SerializeError> { if v { - self.buf.append("true"); + self.buf.push_str("true"); } else { - self.buf.append("false"); + self.buf.push_str("false"); } return Result::<(), SerializeError>::Ok(()); } @@ -285,12 +285,12 @@ impl Serializer for JsonSerializer { } fn serialize_null(&mut self) -> Result<(), SerializeError> { - self.buf.append("null"); + self.buf.push_str("null"); return Result::<(), SerializeError>::Ok(()); } fn begin_seq(&mut self, len: i32) -> Result { - self.buf.append("["); + self.buf.push_str("["); return Result::::Ok(JsonSeqSerializer { buf: self.buf, count: 0, @@ -298,7 +298,7 @@ impl Serializer for JsonSerializer { } fn begin_map(&mut self, len: i32) -> Result { - self.buf.append("{"); + self.buf.push_str("{"); return Result::::Ok(JsonMapSerializer { buf: self.buf, count: 0, @@ -307,7 +307,7 @@ impl Serializer for JsonSerializer { } fn begin_struct(&mut self, name: &String, fields: i32) -> Result { - self.buf.append("{"); + self.buf.push_str("{"); return Result::::Ok(JsonStructSerializer { buf: self.buf, count: 0, @@ -320,9 +320,9 @@ impl Serializer for JsonSerializer { } fn begin_variant(&mut self, type_name: &String, variant_name: &String, disc: i32) -> Result { - self.buf.append("{"); + self.buf.push_str("{"); write_escaped_string(&mut self.buf, variant_name); - self.buf.append(":"); + self.buf.push_str(":"); return Result::::Ok(JsonVariantSerializer { buf: self.buf, }); @@ -449,25 +449,25 @@ impl JsonDeserializer { } let esc = self.input.get_byte(self.pos) as i32; if esc == '"' as i32 { - result.append_char('"'); + result.push('"'); } else if esc == '\\' as i32 { - result.append_char('\\'); + result.push('\\'); } else if esc == '/' as i32 { - result.append_char('/'); + result.push('/'); } else if esc == 'n' as i32 { - result.append_char('\n'); + result.push('\n'); } else if esc == 'r' as i32 { - result.append_char('\r'); + result.push('\r'); } else if esc == 't' as i32 { - result.append_char('\t'); + result.push('\t'); } else if esc == 'b' as i32 { - result.append_char(8 as u8 as char); + result.push(8 as u8 as char); } else if esc == 'f' as i32 { - result.append_char(12 as u8 as char); + result.push(12 as u8 as char); } else if esc == 'u' as i32 { let r = self.read_unicode_escape(); if let Ok(c) = r { - result.append_char(c); + result.push(c); } if let Err(e) = r { return Result::::Err(e); @@ -488,13 +488,13 @@ impl JsonDeserializer { return Result::::Err(DeserializeError::eof(self.pos as i64)); } if seq_len == 1 { - result.append_char(b as u8 as char); + result.push(b as u8 as char); } else if seq_len == 2 { let b0 = b as u32; let b1 = self.input.get_byte(self.pos + 1) as u32; let code = (b0 & 0x1F) << 6 | b1 & 0x3F; if let Some(c) = char::from_u32(code) { - result.append_char(c); + result.push(c); } } else if seq_len == 3 { let b0 = b as u32; @@ -502,7 +502,7 @@ impl JsonDeserializer { let b2 = self.input.get_byte(self.pos + 2) as u32; let code = (b0 & 0x0F) << 12 | (b1 & 0x3F) << 6 | b2 & 0x3F; if let Some(c) = char::from_u32(code) { - result.append_char(c); + result.push(c); } } else { let b0 = b as u32; @@ -511,7 +511,7 @@ impl JsonDeserializer { let b3 = self.input.get_byte(self.pos + 3) as u32; let code = (b0 & 0x07) << 18 | (b1 & 0x3F) << 12 | (b2 & 0x3F) << 6 | b3 & 0x3F; if let Some(c) = char::from_u32(code) { - result.append_char(c); + result.push(c); } } self.pos += seq_len; @@ -613,7 +613,7 @@ impl JsonDeserializer { } let mut raw = String::with_capacity(self.pos - start); for let mut i = start; i < self.pos; i += 1 { - raw.append_char(self.input.get_byte(i) as char); + raw.push(self.input.get_byte(i) as char); } return Result::::Ok(raw); } diff --git a/wado-compiler/lib/core/json_nsd.wado b/wado-compiler/lib/core/json_nsd.wado index c8de817f0..8a7ccbd04 100644 --- a/wado-compiler/lib/core/json_nsd.wado +++ b/wado-compiler/lib/core/json_nsd.wado @@ -63,7 +63,7 @@ pub struct NsdSerializer { impl SerializeSeq for NsdSeqSerializer { fn element(&mut self, value: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.buf.append(","); + self.buf.push_str(","); } let mut ser = NsdSerializer { buf: self.buf }; let r = value.serialize::(&mut ser); @@ -73,7 +73,7 @@ impl SerializeSeq for NsdSeqSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.buf.append("]"); + self.buf.push_str("]"); return Result::<(), SerializeError>::Ok(()); } } @@ -81,12 +81,12 @@ impl SerializeSeq for NsdSeqSerializer { impl SerializeMap for NsdMapSerializer { fn key(&mut self, key: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.buf.append(","); + self.buf.push_str(","); } let mut ser = NsdSerializer { buf: self.buf }; let r = key.serialize::(&mut ser); self.buf = ser.buf; - self.buf.append(":"); + self.buf.push_str(":"); self.need_value = true; return r; } @@ -101,7 +101,7 @@ impl SerializeMap for NsdMapSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.buf.append("}"); + self.buf.push_str("}"); return Result::<(), SerializeError>::Ok(()); } } @@ -109,7 +109,7 @@ impl SerializeMap for NsdMapSerializer { impl SerializeStruct for NsdStructSerializer { fn field(&mut self, name: &String, value: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.buf.append(","); + self.buf.push_str(","); } // NSD: omit field name, write value only let mut ser = NsdSerializer { buf: self.buf }; @@ -120,14 +120,14 @@ impl SerializeStruct for NsdStructSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.buf.append("]"); + self.buf.push_str("]"); return Result::<(), SerializeError>::Ok(()); } } impl SerializeVariant for NsdVariantSerializer { fn payload(&mut self, value: &T) -> Result<(), SerializeError> { - self.buf.append(","); + self.buf.push_str(","); let mut ser = NsdSerializer { buf: self.buf }; let r = value.serialize::(&mut ser); self.buf = ser.buf; @@ -135,7 +135,7 @@ impl SerializeVariant for NsdVariantSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.buf.append("]"); + self.buf.push_str("]"); return Result::<(), SerializeError>::Ok(()); } } @@ -147,40 +147,40 @@ impl Serializer for NsdSerializer { type VariantSerializer = NsdVariantSerializer; fn serialize_i32(&mut self, v: i32) -> Result<(), SerializeError> { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_i64(&mut self, v: i64) -> Result<(), SerializeError> { if v > 9007199254740991 || v < -9007199254740991 { - self.buf.append(`"{v}"`); + self.buf.push_str(`"{v}"`); } else { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); } return Result::<(), SerializeError>::Ok(()); } fn serialize_u32(&mut self, v: u32) -> Result<(), SerializeError> { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_u64(&mut self, v: u64) -> Result<(), SerializeError> { if v > 9007199254740991 { - self.buf.append(`"{v}"`); + self.buf.push_str(`"{v}"`); } else { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); } return Result::<(), SerializeError>::Ok(()); } fn serialize_i128(&mut self, v: i128) -> Result<(), SerializeError> { - self.buf.append(`"{v}"`); + self.buf.push_str(`"{v}"`); return Result::<(), SerializeError>::Ok(()); } fn serialize_u128(&mut self, v: u128) -> Result<(), SerializeError> { - self.buf.append(`"{v}"`); + self.buf.push_str(`"{v}"`); return Result::<(), SerializeError>::Ok(()); } @@ -197,7 +197,7 @@ impl Serializer for NsdSerializer { message: "Infinity is not allowed in JSON", }); } - self.buf.append(`{v as f64}`); + self.buf.push_str(`{v as f64}`); return Result::<(), SerializeError>::Ok(()); } @@ -214,15 +214,15 @@ impl Serializer for NsdSerializer { message: "Infinity is not allowed in JSON", }); } - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_bool(&mut self, v: bool) -> Result<(), SerializeError> { if v { - self.buf.append("true"); + self.buf.push_str("true"); } else { - self.buf.append("false"); + self.buf.push_str("false"); } return Result::<(), SerializeError>::Ok(()); } @@ -239,12 +239,12 @@ impl Serializer for NsdSerializer { } fn serialize_null(&mut self) -> Result<(), SerializeError> { - self.buf.append("null"); + self.buf.push_str("null"); return Result::<(), SerializeError>::Ok(()); } fn begin_seq(&mut self, len: i32) -> Result { - self.buf.append("["); + self.buf.push_str("["); return Result::::Ok(NsdSeqSerializer { buf: self.buf, count: 0, @@ -252,7 +252,7 @@ impl Serializer for NsdSerializer { } fn begin_map(&mut self, len: i32) -> Result { - self.buf.append("{"); + self.buf.push_str("{"); return Result::::Ok(NsdMapSerializer { buf: self.buf, count: 0, @@ -262,7 +262,7 @@ impl Serializer for NsdSerializer { fn begin_struct(&mut self, name: &String, fields: i32) -> Result { // NSD: struct as array - self.buf.append("["); + self.buf.push_str("["); return Result::::Ok(NsdStructSerializer { buf: self.buf, count: 0, @@ -271,13 +271,13 @@ impl Serializer for NsdSerializer { fn serialize_unit_variant(&mut self, type_name: &String, variant_name: &String, disc: i32) -> Result<(), SerializeError> { // NSD: discriminant integer - self.buf.append(`{disc}`); + self.buf.push_str(`{disc}`); return Result::<(), SerializeError>::Ok(()); } fn begin_variant(&mut self, type_name: &String, variant_name: &String, disc: i32) -> Result { // NSD: [disc, payload] - self.buf.append(`[{disc}`); + self.buf.push_str(`[{disc}`); return Result::::Ok(NsdVariantSerializer { buf: self.buf, }); diff --git a/wado-compiler/lib/core/json_value.wado b/wado-compiler/lib/core/json_value.wado index d06e684b0..6b9198477 100644 --- a/wado-compiler/lib/core/json_value.wado +++ b/wado-compiler/lib/core/json_value.wado @@ -149,7 +149,7 @@ impl Visitor for ValueVisitor { match next { Ok(opt) => match opt { Some(item) => { - items.append(item); + items.push(item); }, None => { if let Err(e) = seq.end() { diff --git a/wado-compiler/lib/core/prelude/array.wado b/wado-compiler/lib/core/prelude/array.wado index 78afce3d8..24a2e82d2 100644 --- a/wado-compiler/lib/core/prelude/array.wado +++ b/wado-compiler/lib/core/prelude/array.wado @@ -3,8 +3,9 @@ // Provides Array, ArrayIter, and iterator combinators. -use { Ordering, Eq, Ord, IndexValue, IndexAssign, Iterator, IntoIterator, FromIterator } from "core:prelude/traits.wado"; +use { Ordering, Eq, Ord, IndexValue, IndexAssign, Iterator, IntoIterator, FromIterator, Display } from "core:prelude/traits.wado"; use { Option } from "core:prelude/types.wado"; +use { Formatter } from "core:prelude/format.wado"; use { panic } from "core:internal"; fn i32_min(a: i32, b: i32) -> i32 { @@ -39,6 +40,21 @@ impl Array { self.repr = new_repr; } + fn grow_to(&mut self, min_capacity: i32) { + let capacity = builtin::array_len(self.repr); + if min_capacity <= capacity { + return; + } + let new_capacity = i32_max(i32_max(capacity * 2, min_capacity), 4); + let new_repr = builtin::array_new::(new_capacity); + let old_repr = self.repr; + let used = self.used; + for let mut i = 0; i < used; i += 1 { + builtin::array_set::(new_repr, i, builtin::array_get::(old_repr, i)); + } + self.repr = new_repr; + } + pub fn filled(n: i32, element: T) -> Array { let repr = builtin::array_new::(n); builtin::array_fill::(repr, 0, element, n); @@ -53,6 +69,11 @@ impl Array { return self.used == 0; } + /// Returns the total number of elements the array can hold without reallocating. + pub fn capacity(&self) -> i32 { + return builtin::array_len(self.repr); + } + pub fn internal_raw_data(&self) -> builtin::array { return self.repr; } @@ -61,8 +82,9 @@ impl Array { return Array { repr, used }; } + /// Appends a single element to the end. #[comp_feature("array_append")] - pub fn append(&mut self, value: T) with stores[value] { + pub fn push(&mut self, value: T) with stores[value] { let used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { self.grow(); @@ -71,6 +93,11 @@ impl Array { self.used = used + 1; } + /// @deprecated Use `push` instead. + pub fn append(&mut self, value: T) with stores[value] { + self.push(value); + } + pub fn pop(&mut self) -> Option { if self.used == 0 { return null; @@ -79,10 +106,12 @@ impl Array { return Option::Some(builtin::array_get::(self.repr, self.used)); } - pub fn truncate(&mut self, len: i32) { - if len < self.used { - self.used = len; + /// Returns the first element, or None if empty. + pub fn first(&self) -> Option { + if self.used == 0 { + return null; } + return Option::Some(builtin::array_get::(self.repr, 0)); } pub fn last(&self) -> Option { @@ -99,6 +128,118 @@ impl Array { return Option::Some(builtin::array_get::(self.repr, index)); } + /// Inserts an element at the given index, shifting all elements after it to the right. + /// Panics if `index > len()`. + pub fn insert(&mut self, index: i32, value: T) with stores[value] { + assert index >= 0 && index <= self.used, "index out of bounds"; + if builtin::unlikely(self.used >= builtin::array_len(self.repr)) { + self.grow(); + } + // Shift elements right + let mut i = self.used; + while i > index { + builtin::array_set::(self.repr, i, builtin::array_get::(self.repr, i - 1)); + i -= 1; + } + builtin::array_set::(self.repr, index, value); + self.used += 1; + } + + /// Removes and returns the element at the given index, shifting all elements after it to the left. + /// Panics if `index >= len()`. + pub fn remove(&mut self, index: i32) -> T { + assert index >= 0 && index < self.used, "index out of bounds"; + let value = builtin::array_get::(self.repr, index); + // Shift elements left + for let mut i = index; i < self.used - 1; i += 1 { + builtin::array_set::(self.repr, i, builtin::array_get::(self.repr, i + 1)); + } + self.used -= 1; + return value; + } + + /// Swaps two elements by index. + /// Panics if either index is out of bounds. + pub fn swap(&mut self, a: i32, b: i32) { + assert a >= 0 && a < self.used, "index out of bounds"; + assert b >= 0 && b < self.used, "index out of bounds"; + let tmp = builtin::array_get::(self.repr, a); + builtin::array_set::(self.repr, a, builtin::array_get::(self.repr, b)); + builtin::array_set::(self.repr, b, tmp); + } + + pub fn truncate(&mut self, len: i32) { + if len < self.used { + self.used = len; + } + } + + /// Removes all elements. + pub fn clear(&mut self) { + self.used = 0; + } + + /// Reserves capacity for at least `additional` more elements. + pub fn reserve(&mut self, additional: i32) { + let required = self.used + additional; + if required > builtin::array_len(self.repr) { + self.grow_to(required); + } + } + + /// Shrinks the capacity to match the current length. + pub fn shrink_to_fit(&mut self) { + let capacity = builtin::array_len(self.repr); + if capacity > self.used { + let new_repr = builtin::array_new::(self.used); + for let mut i = 0; i < self.used; i += 1 { + builtin::array_set::(new_repr, i, builtin::array_get::(self.repr, i)); + } + self.repr = new_repr; + } + } + + /// Extends this array with elements from another array. + pub fn extend(&mut self, other: &Array) { + let other_len = other.used; + if other_len == 0 { + return; + } + let new_used = self.used + other_len; + if new_used > builtin::array_len(self.repr) { + self.grow_to(new_used); + } + builtin::array_copy::(self.repr, self.used, other.repr, 0, other_len); + self.used = new_used; + } + + /// Reverses the elements in place. + pub fn reverse(&mut self) { + let mut lo = 0; + let mut hi = self.used - 1; + while lo < hi { + let tmp = builtin::array_get::(self.repr, lo); + builtin::array_set::(self.repr, lo, builtin::array_get::(self.repr, hi)); + builtin::array_set::(self.repr, hi, tmp); + lo += 1; + hi -= 1; + } + } + + /// Returns a new array containing this array's elements repeated `n` times. + pub fn repeat(&self, n: i32) -> Array { + let total = self.used * n; + let new_repr = builtin::array_new::(total); + let mut offset = 0; + for let mut r = 0; r < n; r += 1 { + for let mut i = 0; i < self.used; i += 1 { + builtin::array_set::(new_repr, offset, builtin::array_get::(self.repr, i)); + offset += 1; + } + } + return Array { repr: new_repr, used: total }; + } + /// Copies `count` elements from `self[src_start..]` and appends them. /// Handles overlapping regions correctly for both non-overlapping and DEFLATE-style /// run-length expansion (where src < dst). Forward order is correct in both cases. @@ -129,6 +270,18 @@ impl Array { } } +impl Array { + /// Returns true if the array contains the given value. + pub fn contains(&self, value: &T) -> bool { + for let mut i = 0; i < self.used; i += 1 { + if builtin::array_get::(self.repr, i) == *value { + return true; + } + } + return false; + } +} + impl IndexValue for Array { type Output = T; @@ -412,6 +565,99 @@ impl Array { copy.sort_by(cmp); return copy; } + + /// Returns an iterator of overlapping windows of size `size`. + /// Panics if `size` is 0. + pub fn windows(&self, size: i32) -> WindowsIter { + assert size > 0, "window size must be positive"; + return WindowsIter { + repr: self.repr, + used: self.used, + index: 0, + size, + }; + } + + /// Returns an iterator of non-overlapping chunks of size `size`. + /// The last chunk may be shorter. Panics if `size` is 0. + pub fn chunks(&self, size: i32) -> ChunksIter { + assert size > 0, "chunk size must be positive"; + return ChunksIter { + repr: self.repr, + used: self.used, + index: 0, + size, + }; + } +} + +/// Iterator over overlapping windows of an array. +pub struct WindowsIter { + repr: builtin::array, + used: i32, + index: i32, + size: i32, +} + +impl Iterator for WindowsIter { + type Item = ArraySlice; + + fn next(&mut self) -> Option { + if self.index + self.size > self.used { + return null; + } + let slice = ArraySlice { + repr: self.repr, + start: self.index, + end: self.index + self.size, + }; + self.index += 1; + return Option::Some(slice); + } +} + +impl IntoIterator for WindowsIter { + type Item = ArraySlice; + type Iter = WindowsIter; + + fn into_iter(&self) -> Self::Iter { + return *self; + } +} + +/// Iterator over non-overlapping chunks of an array. +pub struct ChunksIter { + repr: builtin::array, + used: i32, + index: i32, + size: i32, +} + +impl Iterator for ChunksIter { + type Item = ArraySlice; + + fn next(&mut self) -> Option { + if self.index >= self.used { + return null; + } + let end = i32_min(self.index + self.size, self.used); + let slice = ArraySlice { + repr: self.repr, + start: self.index, + end, + }; + self.index = end; + return Option::Some(slice); + } +} + +impl IntoIterator for ChunksIter { + type Item = ArraySlice; + type Iter = ChunksIter; + + fn into_iter(&self) -> Self::Iter { + return *self; + } } // sort/sorted require T: Ord (elements must be comparable via Ord::cmp) @@ -432,13 +678,29 @@ impl Array { } } +impl Array { + /// Joins elements into a string with the given separator. + pub fn join(&self, separator: String) -> String { + let mut buf = String::with_capacity(self.used * 8); + let mut f = Formatter::new(&mut buf); + for let mut i = 0; i < self.used; i += 1 { + if i > 0 { + f.write_str(separator); + } + let item = builtin::array_get::(self.repr, i); + item.fmt(&mut f); + } + return buf; + } +} + impl FromIterator for Array { type Iter = ArrayIter; fn from_iter(iter: ArrayIter) -> Array { let mut result: Array = []; for let item of iter { - result.append(item); + result.push(item); } return result; } @@ -455,7 +717,7 @@ impl SequenceLiteralBuilder for Array { } fn push_literal(&mut self, value: T) with stores[value] { - self.append(value); + self.push(value); } fn build(&self) -> Array { diff --git a/wado-compiler/lib/core/prelude/array_test.wado b/wado-compiler/lib/core/prelude/array_test.wado index a672b0934..ae89b8d73 100644 --- a/wado-compiler/lib/core/prelude/array_test.wado +++ b/wado-compiler/lib/core/prelude/array_test.wado @@ -1,8 +1,8 @@ test "append to empty array" { let arr: Array = []; - arr.append(10); - arr.append(20); - arr.append(30); + arr.push(10); + arr.push(20); + arr.push(30); assert arr.len() == 3; assert arr[0] == 10; assert arr[1] == 20; @@ -11,12 +11,12 @@ test "append to empty array" { test "append triggers growth" { let arr: Array = []; - arr.append(10); - arr.append(20); - arr.append(30); - arr.append(40); - arr.append(50); // should trigger resize (capacity 4 -> 8) - arr.append(60); + arr.push(10); + arr.push(20); + arr.push(30); + arr.push(40); + arr.push(50); // should trigger resize (capacity 4 -> 8) + arr.push(60); assert arr.len() == 6; assert arr[3] == 40; assert arr[4] == 50; @@ -57,7 +57,7 @@ test "is_empty on nonempty array" { test "is_empty after append" { let arr: Array = []; assert arr.is_empty(); - arr.append(1); + arr.push(1); assert !arr.is_empty(); } @@ -357,3 +357,226 @@ test "truncate larger than len is no-op" { arr.truncate(10); assert arr.len() == 2; } + +test "push to empty array" { + let arr: Array = []; + arr.push(10); + arr.push(20); + assert arr.len() == 2; + assert arr[0] == 10; + assert arr[1] == 20; +} + +test "first on non-empty array" { + let arr: Array = [10, 20, 30]; + assert arr.first() == Option::Some(10); +} + +test "first on empty array" { + let arr: Array = []; + assert arr.first() matches { None }; +} + +test "clear" { + let mut arr: Array = [1, 2, 3]; + arr.clear(); + assert arr.len() == 0; + assert arr.is_empty(); +} + +test "capacity and reserve" { + let mut arr = Array::::with_capacity(2); + assert arr.capacity() >= 2; + arr.push(1); + arr.push(2); + arr.reserve(10); + assert arr.capacity() >= 12; + assert arr.len() == 2; + assert arr[0] == 1; +} + +test "shrink_to_fit" { + let mut arr = Array::::with_capacity(100); + arr.push(1); + arr.push(2); + arr.shrink_to_fit(); + assert arr.capacity() == 2; + assert arr.len() == 2; + assert arr[0] == 1; + assert arr[1] == 2; +} + +test "insert at beginning" { + let mut arr: Array = [20, 30]; + arr.insert(0, 10); + assert arr.len() == 3; + assert arr[0] == 10; + assert arr[1] == 20; + assert arr[2] == 30; +} + +test "insert at middle" { + let mut arr: Array = [10, 30]; + arr.insert(1, 20); + assert arr.len() == 3; + assert arr[0] == 10; + assert arr[1] == 20; + assert arr[2] == 30; +} + +test "insert at end" { + let mut arr: Array = [10, 20]; + arr.insert(2, 30); + assert arr.len() == 3; + assert arr[2] == 30; +} + +test "remove from beginning" { + let mut arr: Array = [10, 20, 30]; + let v = arr.remove(0); + assert v == 10; + assert arr.len() == 2; + assert arr[0] == 20; + assert arr[1] == 30; +} + +test "remove from middle" { + let mut arr: Array = [10, 20, 30]; + let v = arr.remove(1); + assert v == 20; + assert arr.len() == 2; + assert arr[0] == 10; + assert arr[1] == 30; +} + +test "swap" { + let mut arr: Array = [10, 20, 30]; + arr.swap(0, 2); + assert arr[0] == 30; + assert arr[2] == 10; +} + +test "reverse" { + let mut arr: Array = [1, 2, 3, 4, 5]; + arr.reverse(); + assert arr[0] == 5; + assert arr[1] == 4; + assert arr[2] == 3; + assert arr[3] == 2; + assert arr[4] == 1; +} + +test "reverse empty and single" { + let mut empty: Array = []; + empty.reverse(); + assert empty.len() == 0; + + let mut single: Array = [42]; + single.reverse(); + assert single[0] == 42; +} + +test "extend" { + let mut arr: Array = [1, 2]; + let other: Array = [3, 4, 5]; + arr.extend(&other); + assert arr.len() == 5; + assert arr[2] == 3; + assert arr[4] == 5; +} + +test "contains" { + let arr: Array = [10, 20, 30]; + assert arr.contains(&20); + assert !arr.contains(&99); +} + +test "contains empty" { + let arr: Array = []; + assert !arr.contains(&1); +} + +test "repeat" { + let arr: Array = [1, 2]; + let repeated = arr.repeat(3); + assert repeated.len() == 6; + assert repeated[0] == 1; + assert repeated[1] == 2; + assert repeated[2] == 1; + assert repeated[3] == 2; + assert repeated[4] == 1; + assert repeated[5] == 2; +} + +test "repeat zero" { + let arr: Array = [1, 2, 3]; + let empty = arr.repeat(0); + assert empty.len() == 0; +} + +test "join" { + let arr: Array = [1, 2, 3]; + assert arr.join(", ") == "1, 2, 3"; +} + +test "join single element" { + let arr: Array = [42]; + assert arr.join(", ") == "42"; +} + +test "join empty" { + let arr: Array = []; + assert arr.join(", ") == ""; +} + +test "join strings" { + let arr: Array = ["hello", "world"]; + assert arr.join(" ") == "hello world"; +} + +test "windows" { + let arr: Array = [1, 2, 3, 4, 5]; + let mut wins = arr.windows(3); + let w0 = wins.next(); + assert w0 matches { Some(_) }; + if let Some(s) = w0 { + assert s.len() == 3; + assert s[0] == 1; + assert s[1] == 2; + assert s[2] == 3; + } + let w1 = wins.next(); + if let Some(s) = w1 { + assert s[0] == 2; + assert s[2] == 4; + } + let w2 = wins.next(); + if let Some(s) = w2 { + assert s[0] == 3; + assert s[2] == 5; + } + assert wins.next() matches { None }; +} + +test "chunks" { + let arr: Array = [1, 2, 3, 4, 5]; + let mut chs = arr.chunks(2); + let c0 = chs.next(); + if let Some(s) = c0 { + assert s.len() == 2; + assert s[0] == 1; + assert s[1] == 2; + } + let c1 = chs.next(); + if let Some(s) = c1 { + assert s.len() == 2; + assert s[0] == 3; + assert s[1] == 4; + } + let c2 = chs.next(); + if let Some(s) = c2 { + assert s.len() == 1; + assert s[0] == 5; + } + assert chs.next() matches { None }; +} diff --git a/wado-compiler/lib/core/prelude/conversion_test.wado b/wado-compiler/lib/core/prelude/conversion_test.wado index 1dd4eac16..5d2f9be96 100644 --- a/wado-compiler/lib/core/prelude/conversion_test.wado +++ b/wado-compiler/lib/core/prelude/conversion_test.wado @@ -286,9 +286,9 @@ test "JsonLike: From" { test "JsonLike: building a mixed array via From" { let mut items: Array = []; - items.append(JsonLike::from(1)); - items.append(JsonLike::from(true)); - items.append(JsonLike::from("ok")); + items.push(JsonLike::from(1)); + items.push(JsonLike::from(true)); + items.push(JsonLike::from("ok")); let arr = JsonLike::Arr(items); assert arr matches { Arr(a) && a.len() == 3 }; } diff --git a/wado-compiler/lib/core/prelude/format.wado b/wado-compiler/lib/core/prelude/format.wado index 034b5801f..6e9b45a51 100644 --- a/wado-compiler/lib/core/prelude/format.wado +++ b/wado-compiler/lib/core/prelude/format.wado @@ -61,18 +61,18 @@ impl Formatter { /// Write a string to the output buffer. pub fn write_str(&mut self, s: String) { - self.buf.append(s); + self.buf.push_str(s); } /// Write a single character to the output buffer. pub fn write_char(&mut self, c: char) { - self.buf.append_char(c); + self.buf.push(c); } /// Write `n` copies of a character to the output buffer. pub fn write_char_n(&mut self, c: char, n: i32) { for let mut i = 0; i < n; i += 1 { - self.buf.append_char(c); + self.buf.push(c); } } @@ -81,24 +81,24 @@ impl Formatter { pub fn pad(&mut self, content: String) { let content_len = content.len(); if self.width <= 0 || content_len >= self.width { - self.buf.append(content); + self.buf.push_str(content); return; } let padding = self.width - content_len; let align = self.align; if align matches { Left } { - self.buf.append(content); + self.buf.push_str(content); self.write_char_n(self.fill, padding); } else if align matches { Center } { let left_pad = padding / 2; let right_pad = padding - left_pad; self.write_char_n(self.fill, left_pad); - self.buf.append(content); + self.buf.push_str(content); self.write_char_n(self.fill, right_pad); } else { // Right (default) self.write_char_n(self.fill, padding); - self.buf.append(content); + self.buf.push_str(content); } } @@ -189,10 +189,10 @@ impl Formatter { if self.width <= 0 || content_len >= self.width { // No padding — write sign/prefix, reserve digit area if sign_len > 0 { - self.buf.append(sign); + self.buf.push_str(sign); } if prefix_len > 0 { - self.buf.append(prefix); + self.buf.push_str(prefix); } return self.buf.internal_reserve_uninit(digit_count); } @@ -202,10 +202,10 @@ impl Formatter { if self.zero_pad { // sign + prefix + zeros + [digits] if sign_len > 0 { - self.buf.append(sign); + self.buf.push_str(sign); } if prefix_len > 0 { - self.buf.append(prefix); + self.buf.push_str(prefix); } self.write_char_n('0', padding); return self.buf.internal_reserve_uninit(digit_count); @@ -215,10 +215,10 @@ impl Formatter { if align matches { Left } { // [sign prefix digits] [fill...] if sign_len > 0 { - self.buf.append(sign); + self.buf.push_str(sign); } if prefix_len > 0 { - self.buf.append(prefix); + self.buf.push_str(prefix); } let offset = self.buf.internal_reserve_uninit(digit_count); self.write_char_n(self.fill, padding); @@ -229,10 +229,10 @@ impl Formatter { let right_pad = padding - left_pad; self.write_char_n(self.fill, left_pad); if sign_len > 0 { - self.buf.append(sign); + self.buf.push_str(sign); } if prefix_len > 0 { - self.buf.append(prefix); + self.buf.push_str(prefix); } let offset = self.buf.internal_reserve_uninit(digit_count); self.write_char_n(self.fill, right_pad); @@ -241,10 +241,10 @@ impl Formatter { // Right: [fill...] [sign prefix digits] self.write_char_n(self.fill, padding); if sign_len > 0 { - self.buf.append(sign); + self.buf.push_str(sign); } if prefix_len > 0 { - self.buf.append(prefix); + self.buf.push_str(prefix); } return self.buf.internal_reserve_uninit(digit_count); } diff --git a/wado-compiler/lib/core/prelude/fpfmt.wado b/wado-compiler/lib/core/prelude/fpfmt.wado index 228fb6e30..0b31e7691 100644 --- a/wado-compiler/lib/core/prelude/fpfmt.wado +++ b/wado-compiler/lib/core/prelude/fpfmt.wado @@ -556,7 +556,7 @@ pub fn write_decimal(buf: &mut String, d: u64, p: i32, nd: i32) { if decimal_pos <= 0 { // Need leading zeros: 0.00...digits - buf.append("0."); + buf.push_str("0."); fill_zeros(buf, -decimal_pos); let digit_offset = buf.len(); fill_zeros(buf, nd); @@ -613,21 +613,21 @@ pub fn write_exp(buf: &mut String, d: u64, p: i32, nd: i32, upper: bool) { } // Exponent - buf.append(if upper { "E" } else { "e" }); + buf.push_str(if upper { "E" } else { "e" }); if exp < 0 { - buf.append("-"); + buf.push_str("-"); } let abs_exp = if exp < 0 { -exp } else { exp }; if abs_exp < 10 { - buf.append_char(char::from_u32_unchecked('0' as u32 + abs_exp as u32)); + buf.push(char::from_u32_unchecked('0' as u32 + abs_exp as u32)); } else if abs_exp < 100 { - buf.append_char(i2a_first(abs_exp)); - buf.append_char(i2a_second(abs_exp)); + buf.push(i2a_first(abs_exp)); + buf.push(i2a_second(abs_exp)); } else { - buf.append_char(char::from_u32_unchecked('0' as u32 + (abs_exp / 100) as u32)); - buf.append_char(i2a_first(abs_exp % 100)); - buf.append_char(i2a_second(abs_exp % 100)); + buf.push(char::from_u32_unchecked('0' as u32 + (abs_exp / 100) as u32)); + buf.push(i2a_first(abs_exp % 100)); + buf.push(i2a_second(abs_exp % 100)); } } @@ -650,7 +650,7 @@ pub fn write_decimal_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: if decimal_pos <= 0 { let leading_zeros = -decimal_pos; - buf.append("0."); + buf.push_str("0."); if precision <= leading_zeros { fill_zeros(buf, precision); return; @@ -675,7 +675,7 @@ pub fn write_decimal_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: write_digits_at(buf, start, d, nd); fill_zeros(buf, decimal_pos - nd); if precision > 0 { - buf.append("."); + buf.push_str("."); fill_zeros(buf, precision); } } else { @@ -754,21 +754,21 @@ pub fn write_exp_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: i32, } let exp = p + nd - 1; - buf.append(if upper { "E" } else { "e" }); + buf.push_str(if upper { "E" } else { "e" }); if exp < 0 { - buf.append("-"); + buf.push_str("-"); } let abs_exp = if exp < 0 { -exp } else { exp }; if abs_exp < 10 { - buf.append_char(char::from_u32_unchecked('0' as u32 + abs_exp as u32)); + buf.push(char::from_u32_unchecked('0' as u32 + abs_exp as u32)); } else if abs_exp < 100 { - buf.append_char(i2a_first(abs_exp)); - buf.append_char(i2a_second(abs_exp)); + buf.push(i2a_first(abs_exp)); + buf.push(i2a_second(abs_exp)); } else { - buf.append_char(char::from_u32_unchecked('0' as u32 + (abs_exp / 100) as u32)); - buf.append_char(i2a_first(abs_exp % 100)); - buf.append_char(i2a_second(abs_exp % 100)); + buf.push(char::from_u32_unchecked('0' as u32 + (abs_exp / 100) as u32)); + buf.push(i2a_first(abs_exp % 100)); + buf.push(i2a_second(abs_exp % 100)); } } diff --git a/wado-compiler/lib/core/prelude/fpfmt_comprehensive_test.wado b/wado-compiler/lib/core/prelude/fpfmt_comprehensive_test.wado index 2f8bf3a31..bacd3c02a 100644 --- a/wado-compiler/lib/core/prelude/fpfmt_comprehensive_test.wado +++ b/wado-compiler/lib/core/prelude/fpfmt_comprehensive_test.wado @@ -20,7 +20,7 @@ fn format_exp_padded(d: u64, p: i32, nd: i32) -> String { let mut val = d; let mut digit_chars: Array = []; for let mut i = 0; i < nd; i += 1 { - digit_chars.append(0 as u8); + digit_chars.push(0 as u8); } let mut idx = nd - 1; while idx >= 0 { @@ -29,32 +29,32 @@ fn format_exp_padded(d: u64, p: i32, nd: i32) -> String { idx -= 1; } - buf.append_char(digit_chars[0] as char); + buf.push(digit_chars[0] as char); if nd > 1 { - buf.append_char('.'); + buf.push('.'); for let mut i = 1; i < nd; i += 1 { - buf.append_char(digit_chars[i] as char); + buf.push(digit_chars[i] as char); } } - buf.append_char('e'); + buf.push('e'); if exp < 0 { - buf.append_char('-'); + buf.push('-'); } else { - buf.append_char('+'); + buf.push('+'); } let abs_exp = if exp < 0 { -exp } else { exp }; if abs_exp < 10 { - buf.append_char('0'); - buf.append_char(char::from_u32_unchecked('0' as u32 + abs_exp as u32)); + buf.push('0'); + buf.push(char::from_u32_unchecked('0' as u32 + abs_exp as u32)); } else if abs_exp < 100 { - buf.append_char(char::from_u32_unchecked('0' as u32 + (abs_exp / 10) as u32)); - buf.append_char(char::from_u32_unchecked('0' as u32 + (abs_exp % 10) as u32)); + buf.push(char::from_u32_unchecked('0' as u32 + (abs_exp / 10) as u32)); + buf.push(char::from_u32_unchecked('0' as u32 + (abs_exp % 10) as u32)); } else { - buf.append_char(char::from_u32_unchecked('0' as u32 + (abs_exp / 100) as u32)); - buf.append_char(char::from_u32_unchecked('0' as u32 + (abs_exp / 10 % 10) as u32)); - buf.append_char(char::from_u32_unchecked('0' as u32 + (abs_exp % 10) as u32)); + buf.push(char::from_u32_unchecked('0' as u32 + (abs_exp / 100) as u32)); + buf.push(char::from_u32_unchecked('0' as u32 + (abs_exp / 10 % 10) as u32)); + buf.push(char::from_u32_unchecked('0' as u32 + (abs_exp % 10) as u32)); } return buf; diff --git a/wado-compiler/lib/core/prelude/primitive.wado b/wado-compiler/lib/core/prelude/primitive.wado index 8120b119e..c4b05fd63 100644 --- a/wado-compiler/lib/core/prelude/primitive.wado +++ b/wado-compiler/lib/core/prelude/primitive.wado @@ -207,7 +207,7 @@ impl char { pub fn to_string(&self) -> String { let mut buf = String::with_capacity(4); - buf.append_char(*self); + buf.push(*self); return buf; } @@ -655,12 +655,12 @@ impl u64 { fn fmt_float_special(f: &mut Formatter, is_neg: bool, kind: SpecialKind, zero_repr: String) { let mark = f.mark(); if kind matches { NaN } { - f.buf.append("NaN"); + f.buf.push_str("NaN"); } else if kind matches { Inf } { - f.buf.append(if is_neg { "-inf" } else { "inf" }); + f.buf.push_str(if is_neg { "-inf" } else { "inf" }); } else { - f.buf.append(if is_neg { "-" } else { "" }); - f.buf.append(zero_repr); + f.buf.push_str(if is_neg { "-" } else { "" }); + f.buf.push_str(zero_repr); } f.apply_padding(mark); } @@ -668,9 +668,9 @@ fn fmt_float_special(f: &mut Formatter, is_neg: bool, kind: SpecialKind, zero_re /// Write sign prefix ("-" or "+"). fn fmt_float_sign(f: &mut Formatter, is_neg: bool) { if is_neg { - f.buf.append("-"); + f.buf.push_str("-"); } else if f.sign_plus { - f.buf.append("+"); + f.buf.push_str("+"); } } @@ -733,7 +733,7 @@ impl f32 { write_exp(f.buf, d, p, nd, false); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - f.buf.append(".0"); + f.buf.push_str(".0"); } else { write_decimal(f.buf, d, p, nd); } @@ -1009,7 +1009,7 @@ impl f64 { write_exp(f.buf, d, p, nd, false); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - f.buf.append(".0"); + f.buf.push_str(".0"); } else { write_decimal(f.buf, d, p, nd); } @@ -1026,9 +1026,9 @@ impl f64 { } let mark = f.mark(); fmt_float_sign(f, is_neg); - f.buf.append("0"); + f.buf.push_str("0"); if precision > 0 { - f.buf.append("."); + f.buf.push_str("."); f.buf.append_byte_filled('0' as u8, precision); } f.apply_padding(mark); @@ -1056,13 +1056,13 @@ impl f64 { } let mark = f.mark(); fmt_float_sign(f, is_neg); - f.buf.append("0"); + f.buf.push_str("0"); if precision > 0 { - f.buf.append("."); + f.buf.push_str("."); f.buf.append_byte_filled('0' as u8, precision); } - f.buf.append(if upper_bool { "E" } else { "e" }); - f.buf.append("0"); + f.buf.push_str(if upper_bool { "E" } else { "e" }); + f.buf.push_str("0"); f.apply_padding(mark); return; } @@ -1300,7 +1300,7 @@ impl Display for char { f.write_char(*self); } else { let mut s = String::with_capacity(4); - s.append_char(*self); + s.push(*self); f.pad(s); } } diff --git a/wado-compiler/lib/core/prelude/string.wado b/wado-compiler/lib/core/prelude/string.wado index ca31c5cca..0fd98b90c 100644 --- a/wado-compiler/lib/core/prelude/string.wado +++ b/wado-compiler/lib/core/prelude/string.wado @@ -124,10 +124,10 @@ impl String { self.used = new_used; } - /// Append another string to this string - /// Grows the string if necessary (O(1) amortized) + /// Appends another string to this string. + /// Grows the string if necessary (O(1) amortized). #[comp_feature("string_append")] - pub fn append(&mut self, other: String) { + pub fn push_str(&mut self, other: String) { let other_len = other.len(); if other_len == 0 { return; @@ -142,6 +142,11 @@ impl String { self.used = new_used; } + /// @deprecated Use `push_str` instead. + pub fn append(&mut self, other: String) { + self.push_str(other); + } + /// Concatenate two strings into a new string /// This is a static method: String::concat(a, b) pub fn concat(a: String, b: String) -> String { @@ -316,9 +321,9 @@ impl String { }; } - /// Append a Unicode scalar value (char) to this string. + /// Appends a Unicode scalar value (char) to this string. #[comp_feature("string_append_char")] - pub fn append_char(&mut self, c: char) { + pub fn push(&mut self, c: char) { let code = c as u32; if builtin::unlikely(self.used + 4 > builtin::array_len(self.repr)) { @@ -346,9 +351,14 @@ impl String { } } - /// Truncate the string to the given byte length. + /// @deprecated Use `push` instead. + pub fn append_char(&mut self, c: char) { + self.push(c); + } + + /// Truncates the string to the given byte length. /// Panics if `byte_len` is not on a UTF-8 character boundary. - pub fn truncate_bytes(&mut self, byte_len: i32) { + pub fn truncate(&mut self, byte_len: i32) { if byte_len >= self.used { return; } @@ -383,6 +393,80 @@ impl String { self.used = byte_pos; } + /// @deprecated Use `truncate` instead. + pub fn truncate_bytes(&mut self, byte_len: i32) { + self.truncate(byte_len); + } + + /// Removes and returns the last character, or None if empty. + pub fn pop(&mut self) -> Option { + if self.used == 0 { + return null; + } + // Scan backwards past continuation bytes to find the start of the last char + let mut pos = self.used - 1; + while pos > 0 { + let b = builtin::array_get_u8(self.repr, pos); + if b >= 0x80 && b < 0xC0 { + pos -= 1; + } else { + break; + } + } + // Decode the character at pos + let b0 = builtin::array_get_u8(self.repr, pos) as u32; + let code = if b0 < 0x80 { + b0; + } else if b0 < 0xE0 { + let b1 = builtin::array_get_u8(self.repr, pos + 1) as u32; + (b0 & 0x1F) << 6 | b1 & 0x3F; + } else if b0 < 0xF0 { + let b1 = builtin::array_get_u8(self.repr, pos + 1) as u32; + let b2 = builtin::array_get_u8(self.repr, pos + 2) as u32; + (b0 & 0x0F) << 12 | (b1 & 0x3F) << 6 | b2 & 0x3F; + } else { + let b1 = builtin::array_get_u8(self.repr, pos + 1) as u32; + let b2 = builtin::array_get_u8(self.repr, pos + 2) as u32; + let b3 = builtin::array_get_u8(self.repr, pos + 3) as u32; + (b0 & 0x07) << 18 | (b1 & 0x3F) << 12 | (b2 & 0x3F) << 6 | b3 & 0x3F; + }; + self.used = pos; + return Option::Some(char::from_u32_unchecked(code)); + } + + /// Removes all contents, making the string empty. + pub fn clear(&mut self) { + self.used = 0; + } + + /// Returns the total capacity in bytes. + pub fn capacity(&self) -> i32 { + return builtin::array_len(self.repr); + } + + /// Reserves capacity for at least `additional` more bytes. + pub fn reserve(&mut self, additional: i32) { + let required = self.used + additional; + if required > builtin::array_len(self.repr) { + self.grow(required); + } + } + + /// Shrinks the capacity to match the current byte length. + pub fn shrink_to_fit(&mut self) { + let capacity = builtin::array_len(self.repr); + if capacity > self.used { + let new_repr = builtin::array_new::(self.used); + builtin::array_copy::(new_repr, 0, self.repr, 0, self.used); + self.repr = new_repr; + } + } + + /// Returns the bytes of this string as an Array. + pub fn as_bytes(&self) -> Array { + return self.bytes().collect(); + } + /// Returns a new string with leading ASCII whitespace removed. pub fn trim_ascii_start(&self) -> String { let mut start = 0; @@ -511,6 +595,308 @@ impl String { builtin::array_copy::(repr, 0, self.repr, start, len); return String { repr, used: len }; } + + /// Returns true if this string contains the given substring. + pub fn contains(&self, pat: String) -> bool { + return self.find(pat) matches { Some(_) }; + } + + /// Returns true if this string starts with the given prefix. + pub fn starts_with(&self, pat: String) -> bool { + let pat_len = pat.len(); + if pat_len > self.used { + return false; + } + let pat_repr = pat.internal_raw_bytes(); + for let mut i = 0; i < pat_len; i += 1 { + if builtin::array_get_u8(self.repr, i) != builtin::array_get_u8(pat_repr, i) { + return false; + } + } + return true; + } + + /// Returns true if this string ends with the given suffix. + pub fn ends_with(&self, pat: String) -> bool { + let pat_len = pat.len(); + if pat_len > self.used { + return false; + } + let offset = self.used - pat_len; + let pat_repr = pat.internal_raw_bytes(); + for let mut i = 0; i < pat_len; i += 1 { + if builtin::array_get_u8(self.repr, offset + i) != builtin::array_get_u8(pat_repr, i) { + return false; + } + } + return true; + } + + /// Returns the byte index of the first occurrence of `pat`, or None. + pub fn find(&self, pat: String) -> Option { + let pat_len = pat.len(); + if pat_len == 0 { + return Option::Some(0); + } + if pat_len > self.used { + return null; + } + let pat_repr = pat.internal_raw_bytes(); + let limit = self.used - pat_len; + for let mut i = 0; i <= limit; i += 1 { + let mut matched = true; + for let mut j = 0; j < pat_len; j += 1 { + if builtin::array_get_u8(self.repr, i + j) != builtin::array_get_u8(pat_repr, j) { + matched = false; + break; + } + } + if matched { + return Option::Some(i); + } + } + return null; + } + + /// Returns the byte index of the last occurrence of `pat`, or None. + pub fn rfind(&self, pat: String) -> Option { + let pat_len = pat.len(); + if pat_len == 0 { + return Option::Some(self.used); + } + if pat_len > self.used { + return null; + } + let pat_repr = pat.internal_raw_bytes(); + let mut i = self.used - pat_len; + loop { + let mut matched = true; + for let mut j = 0; j < pat_len; j += 1 { + if builtin::array_get_u8(self.repr, i + j) != builtin::array_get_u8(pat_repr, j) { + matched = false; + break; + } + } + if matched { + return Option::Some(i); + } + if i == 0 { + break; + } + i -= 1; + } + return null; + } + + /// Returns true if the string contains the given character. + pub fn contains_char(&self, ch: char) -> bool { + for let c of self.chars() { + if c == ch { + return true; + } + } + return false; + } + + /// Returns the byte index of the first character matching the predicate, or None. + pub fn find_char(&self, pred: fn(char) -> bool) -> Option { + let mut byte_index = 0; + let mut iter = self.chars(); + while let Some(c) = iter.next() { + if pred(c) { + return Option::Some(byte_index); + } + let code = c as u32; + if code < 0x80 { + byte_index += 1; + } else if code < 0x800 { + byte_index += 2; + } else if code < 0x10000 { + byte_index += 3; + } else { + byte_index += 4; + } + } + return null; + } + + /// Inserts a character at the given byte index. + /// Panics if `byte_index` is not on a UTF-8 character boundary. + pub fn insert(&mut self, byte_index: i32, ch: char) { + assert byte_index >= 0 && byte_index <= self.used, "index out of bounds"; + if byte_index > 0 && byte_index < self.used { + let b = builtin::array_get_u8(self.repr, byte_index); + assert b < 0x80 || b >= 0xC0, "not on a UTF-8 character boundary"; + } + // Encode char to temporary buffer + let code = ch as u32; + let char_len = if code < 0x80 { 1 } else if code < 0x800 { 2 } else if code < 0x10000 { 3 } else { 4 }; + let new_used = self.used + char_len; + if new_used > builtin::array_len(self.repr) { + self.grow(new_used); + } + // Shift bytes right + let mut i = self.used - 1; + while i >= byte_index { + builtin::array_set_u8(self.repr, i + char_len, builtin::array_get_u8(self.repr, i)); + if i == 0 { break; } + i -= 1; + } + // Write encoded char + if code < 0x80 { + builtin::array_set_u8(self.repr, byte_index, code as u8); + } else if code < 0x800 { + builtin::array_set_u8(self.repr, byte_index, (0xC0 | code >> 6) as u8); + builtin::array_set_u8(self.repr, byte_index + 1, (0x80 | code & 0x3F) as u8); + } else if code < 0x10000 { + builtin::array_set_u8(self.repr, byte_index, (0xE0 | code >> 12) as u8); + builtin::array_set_u8(self.repr, byte_index + 1, (0x80 | code >> 6 & 0x3F) as u8); + builtin::array_set_u8(self.repr, byte_index + 2, (0x80 | code & 0x3F) as u8); + } else { + builtin::array_set_u8(self.repr, byte_index, (0xF0 | code >> 18) as u8); + builtin::array_set_u8(self.repr, byte_index + 1, (0x80 | code >> 12 & 0x3F) as u8); + builtin::array_set_u8(self.repr, byte_index + 2, (0x80 | code >> 6 & 0x3F) as u8); + builtin::array_set_u8(self.repr, byte_index + 3, (0x80 | code & 0x3F) as u8); + } + self.used = new_used; + } + + /// Inserts a string at the given byte index. + /// Panics if `byte_index` is not on a UTF-8 character boundary. + pub fn insert_str(&mut self, byte_index: i32, s: String) { + let s_len = s.len(); + if s_len == 0 { + return; + } + assert byte_index >= 0 && byte_index <= self.used, "index out of bounds"; + if byte_index > 0 && byte_index < self.used { + let b = builtin::array_get_u8(self.repr, byte_index); + assert b < 0x80 || b >= 0xC0, "not on a UTF-8 character boundary"; + } + let new_used = self.used + s_len; + if new_used > builtin::array_len(self.repr) { + self.grow(new_used); + } + // Shift bytes right + let mut i = self.used - 1; + while i >= byte_index { + builtin::array_set_u8(self.repr, i + s_len, builtin::array_get_u8(self.repr, i)); + if i == 0 { break; } + i -= 1; + } + // Copy inserted string + builtin::array_copy::(self.repr, byte_index, s.internal_raw_bytes(), 0, s_len); + self.used = new_used; + } + + /// Removes and returns the character at the given byte index. + /// Panics if the index is not on a UTF-8 character boundary. + pub fn remove(&mut self, byte_index: i32) -> char { + assert byte_index >= 0 && byte_index < self.used, "index out of bounds"; + let b0 = builtin::array_get_u8(self.repr, byte_index) as u32; + let char_len = if b0 < 0x80 { 1 } else if b0 < 0xE0 { 2 } else if b0 < 0xF0 { 3 } else { 4 }; + // Decode the character + let code = if b0 < 0x80 { + b0; + } else if b0 < 0xE0 { + let b1 = builtin::array_get_u8(self.repr, byte_index + 1) as u32; + (b0 & 0x1F) << 6 | b1 & 0x3F; + } else if b0 < 0xF0 { + let b1 = builtin::array_get_u8(self.repr, byte_index + 1) as u32; + let b2 = builtin::array_get_u8(self.repr, byte_index + 2) as u32; + (b0 & 0x0F) << 12 | (b1 & 0x3F) << 6 | b2 & 0x3F; + } else { + let b1 = builtin::array_get_u8(self.repr, byte_index + 1) as u32; + let b2 = builtin::array_get_u8(self.repr, byte_index + 2) as u32; + let b3 = builtin::array_get_u8(self.repr, byte_index + 3) as u32; + (b0 & 0x07) << 18 | (b1 & 0x3F) << 12 | (b2 & 0x3F) << 6 | b3 & 0x3F; + }; + // Shift bytes left + let src = byte_index + char_len; + for let mut i = src; i < self.used; i += 1 { + builtin::array_set_u8(self.repr, i - char_len, builtin::array_get_u8(self.repr, i)); + } + self.used -= char_len; + return char::from_u32_unchecked(code); + } + + /// Returns this string repeated `n` times. + pub fn repeat(&self, n: i32) -> String { + if n <= 0 || self.used == 0 { + return String::with_capacity(0); + } + let total = self.used * n; + let repr = builtin::array_new::(total); + for let mut r = 0; r < n; r += 1 { + builtin::array_copy::(repr, r * self.used, self.repr, 0, self.used); + } + return String { repr, used: total }; + } + + /// Replaces all occurrences of `from` with `to`. + pub fn replace(&self, from: String, to: String) -> String { + return self.replacen(from, to, -1); + } + + /// Replaces the first `count` occurrences of `from` with `to`. + /// If `count` is negative, replaces all occurrences. + pub fn replacen(&self, from: String, to: String, count: i32) -> String { + let from_len = from.len(); + if from_len == 0 { + return *self; + } + let to_len = to.len(); + let from_repr = from.internal_raw_bytes(); + let to_repr = to.internal_raw_bytes(); + let mut result = String::with_capacity(self.used); + let mut pos = 0; + let mut replacements = 0; + let limit = self.used - from_len; + while pos <= limit { + if count >= 0 && replacements >= count { + break; + } + // Check for match at pos + let mut matched = true; + for let mut j = 0; j < from_len; j += 1 { + if builtin::array_get_u8(self.repr, pos + j) != builtin::array_get_u8(from_repr, j) { + matched = false; + break; + } + } + if matched { + // Append `to` + if to_len > 0 { + let new_used = result.used + to_len; + if new_used > builtin::array_len(result.repr) { + result.grow(new_used); + } + builtin::array_copy::(result.repr, result.used, to_repr, 0, to_len); + result.used = new_used; + } + pos += from_len; + replacements += 1; + } else { + // Copy one byte + if result.used >= builtin::array_len(result.repr) { + result.grow(result.used + 1); + } + builtin::array_set_u8(result.repr, result.used, builtin::array_get_u8(self.repr, pos)); + result.used += 1; + pos += 1; + } + } + // Copy remaining bytes + while pos < self.used { + if result.used >= builtin::array_len(result.repr) { + result.grow(result.used + 1); + } + builtin::array_set_u8(result.repr, result.used, builtin::array_get_u8(self.repr, pos)); + result.used += 1; + pos += 1; + } + return result; + } } impl Default for String { @@ -524,7 +910,7 @@ impl String { pub fn from_iter>(iter: I) -> String { let mut s = String::with_capacity(8); for let c of iter { - s.append_char(c); + s.push(c); } return s; } @@ -601,7 +987,7 @@ impl String { // 0xF5–0xFF: always invalid return Result::Err("invalid UTF-8: byte out of range"); } - builder.append_char(char::from_u32_unchecked(code)); + builder.push(char::from_u32_unchecked(code)); } return Result::Ok(builder); } @@ -624,73 +1010,73 @@ impl String { if let Some(b0) = b0_opt { if b0 < 0x80 { // 1-byte (ASCII) - builder.append_char(char::from_u32_unchecked(b0 as u32)); + builder.push(char::from_u32_unchecked(b0 as u32)); } else if b0 < 0xC2 { // Bare continuation byte or overlong 2-byte lead: replace - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); } else if b0 < 0xE0 { // 2-byte sequence: 110xxxxx 10xxxxxx if let Some(b1) = iter.next() { if b1 < 0x80 || b1 > 0xBF { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); pending = Option::Some(b1); } else { let code = (b0 as u32 & 0x1F) << 6 | b1 as u32 & 0x3F; - builder.append_char(char::from_u32_unchecked(code)); + builder.push(char::from_u32_unchecked(code)); } } else { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); } } else if b0 < 0xF0 { // 3-byte sequence: 1110xxxx 10xxxxxx 10xxxxxx if let Some(b1) = iter.next() { if b1 < 0x80 || b1 > 0xBF || b0 == 0xE0 && b1 < 0xA0 || b0 == 0xED && b1 >= 0xA0 { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); pending = Option::Some(b1); } else if let Some(b2) = iter.next() { if b2 < 0x80 || b2 > 0xBF { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); pending = Option::Some(b2); } else { let code = (b0 as u32 & 0x0F) << 12 | (b1 as u32 & 0x3F) << 6 | b2 as u32 & 0x3F; - builder.append_char(char::from_u32_unchecked(code)); + builder.push(char::from_u32_unchecked(code)); } } else { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); } } else { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); } } else if b0 < 0xF5 { // 4-byte sequence: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx if let Some(b1) = iter.next() { if b1 < 0x80 || b1 > 0xBF || b0 == 0xF0 && b1 < 0x90 || b0 == 0xF4 && b1 > 0x8F { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); pending = Option::Some(b1); } else if let Some(b2) = iter.next() { if b2 < 0x80 || b2 > 0xBF { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); pending = Option::Some(b2); } else if let Some(b3) = iter.next() { if b3 < 0x80 || b3 > 0xBF { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); pending = Option::Some(b3); } else { let code = (b0 as u32 & 0x07) << 18 | (b1 as u32 & 0x3F) << 12 | (b2 as u32 & 0x3F) << 6 | b3 as u32 & 0x3F; - builder.append_char(char::from_u32_unchecked(code)); + builder.push(char::from_u32_unchecked(code)); } } else { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); } } else { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); } } else { - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); } } else { // 0xF5–0xFF: always invalid - builder.append_char('\uFFFD'); + builder.push('\uFFFD'); } } else { break; @@ -719,7 +1105,296 @@ impl String { impl From for String { pub fn from(value: char) -> String { let mut s = String::with_capacity(4); - s.append_char(value); + s.push(value); return s; } } + +/// Iterator over substrings split by a separator. +pub struct StrSplitIter { + repr: builtin::array, + used: i32, + pos: i32, + sep_repr: builtin::array, + sep_len: i32, + finished: bool, +} + +impl Iterator for StrSplitIter { + type Item = String; + + pub fn next(&mut self) -> Option { + if self.finished { + return null; + } + // Search for next separator + let limit = self.used - self.sep_len; + let mut i = self.pos; + while i <= limit { + let mut matched = true; + for let mut j = 0; j < self.sep_len; j += 1 { + if builtin::array_get_u8(self.repr, i + j) != builtin::array_get_u8(self.sep_repr, j) { + matched = false; + break; + } + } + if matched { + let len = i - self.pos; + let part = builtin::array_new::(len); + builtin::array_copy::(part, 0, self.repr, self.pos, len); + self.pos = i + self.sep_len; + return Option::Some(String::internal_from_utf8_raw(part, len)); + } + i += 1; + } + // No more separators; return the remaining part + let len = self.used - self.pos; + let part = builtin::array_new::(len); + builtin::array_copy::(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some(String::internal_from_utf8_raw(part, len)); + } +} + +/// Iterator over substrings split by a separator, limited to `n` parts. +pub struct StrSplitNIter { + repr: builtin::array, + used: i32, + pos: i32, + sep_repr: builtin::array, + sep_len: i32, + remaining: i32, + finished: bool, +} + +impl Iterator for StrSplitNIter { + type Item = String; + + pub fn next(&mut self) -> Option { + if self.finished { + return null; + } + // If only one split remaining, return the rest + if self.remaining <= 1 { + let len = self.used - self.pos; + let part = builtin::array_new::(len); + builtin::array_copy::(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some(String::internal_from_utf8_raw(part, len)); + } + // Search for separator + let limit = self.used - self.sep_len; + let mut i = self.pos; + while i <= limit { + let mut matched = true; + for let mut j = 0; j < self.sep_len; j += 1 { + if builtin::array_get_u8(self.repr, i + j) != builtin::array_get_u8(self.sep_repr, j) { + matched = false; + break; + } + } + if matched { + let len = i - self.pos; + let part = builtin::array_new::(len); + builtin::array_copy::(part, 0, self.repr, self.pos, len); + self.pos = i + self.sep_len; + self.remaining -= 1; + return Option::Some(String::internal_from_utf8_raw(part, len)); + } + i += 1; + } + // No more separators; return remaining + let len = self.used - self.pos; + let part = builtin::array_new::(len); + builtin::array_copy::(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some(String::internal_from_utf8_raw(part, len)); + } +} + +/// Iterator over whitespace-separated substrings. +pub struct StrSplitWhitespaceIter { + repr: builtin::array, + used: i32, + pos: i32, +} + +fn is_ascii_whitespace_byte(b: u8) -> bool { + return b == 0x20 || b == 0x09 || b == 0x0A || b == 0x0D || b == 0x0C; +} + +impl Iterator for StrSplitWhitespaceIter { + type Item = String; + + pub fn next(&mut self) -> Option { + // Skip leading whitespace + while self.pos < self.used && is_ascii_whitespace_byte(builtin::array_get_u8(self.repr, self.pos)) { + self.pos += 1; + } + if self.pos >= self.used { + return null; + } + // Find end of word + let start = self.pos; + while self.pos < self.used && !is_ascii_whitespace_byte(builtin::array_get_u8(self.repr, self.pos)) { + self.pos += 1; + } + let len = self.pos - start; + let part = builtin::array_new::(len); + builtin::array_copy::(part, 0, self.repr, start, len); + return Option::Some(String::internal_from_utf8_raw(part, len)); + } +} + +/// Iterator over lines of a string. +pub struct StrLinesIter { + repr: builtin::array, + used: i32, + pos: i32, + finished: bool, +} + +impl Iterator for StrLinesIter { + type Item = String; + + pub fn next(&mut self) -> Option { + if self.finished { + return null; + } + if self.pos >= self.used { + self.finished = true; + return null; + } + let start = self.pos; + // Find next \n or \r\n + while self.pos < self.used { + let b = builtin::array_get_u8(self.repr, self.pos); + if b == 0x0A { + let len = self.pos - start; + let part = builtin::array_new::(len); + builtin::array_copy::(part, 0, self.repr, start, len); + self.pos += 1; // skip \n + return Option::Some(String::internal_from_utf8_raw(part, len)); + } + if b == 0x0D { + let len = self.pos - start; + let part = builtin::array_new::(len); + builtin::array_copy::(part, 0, self.repr, start, len); + self.pos += 1; // skip \r + if self.pos < self.used && builtin::array_get_u8(self.repr, self.pos) == 0x0A { + self.pos += 1; // skip \n after \r + } + return Option::Some(String::internal_from_utf8_raw(part, len)); + } + self.pos += 1; + } + // Remaining text (no trailing newline) + let len = self.pos - start; + if len > 0 { + let part = builtin::array_new::(len); + builtin::array_copy::(part, 0, self.repr, start, len); + self.finished = true; + return Option::Some(String::internal_from_utf8_raw(part, len)); + } + self.finished = true; + return null; + } +} + +/// Iterator over characters with their byte indices. +pub struct StrCharIndicesIter { + repr: builtin::array, + used: i32, + byte_index: i32, +} + +impl Iterator for StrCharIndicesIter { + type Item = [i32, char]; + + pub fn next(&mut self) -> Option { + if self.byte_index >= self.used { + return null; + } + let idx = self.byte_index; + let b0 = builtin::array_get_u8(self.repr, self.byte_index); + self.byte_index += 1; + + if b0 < 0x80 { + return Option::Some([idx, char::from_u32_unchecked(b0 as u32)]); + } + if b0 < 0xE0 { + let b1 = builtin::array_get_u8(self.repr, self.byte_index) as u32; + self.byte_index += 1; + let code = (b0 as u32 & 0x1F) << 6 | b1 & 0x3F; + return Option::Some([idx, char::from_u32_unchecked(code)]); + } + if b0 < 0xF0 { + let b1 = builtin::array_get_u8(self.repr, self.byte_index) as u32; + let b2 = builtin::array_get_u8(self.repr, self.byte_index + 1) as u32; + self.byte_index += 2; + let code = (b0 as u32 & 0x0F) << 12 | (b1 & 0x3F) << 6 | b2 & 0x3F; + return Option::Some([idx, char::from_u32_unchecked(code)]); + } + let b1 = builtin::array_get_u8(self.repr, self.byte_index) as u32; + let b2 = builtin::array_get_u8(self.repr, self.byte_index + 1) as u32; + let b3 = builtin::array_get_u8(self.repr, self.byte_index + 2) as u32; + self.byte_index += 3; + let code = (b0 as u32 & 0x07) << 18 | (b1 & 0x3F) << 12 | (b2 & 0x3F) << 6 | b3 & 0x3F; + return Option::Some([idx, char::from_u32_unchecked(code)]); + } +} + +impl String { + /// Returns an iterator over substrings split by the given separator. + pub fn split(&self, sep: String) -> StrSplitIter { + return StrSplitIter { + repr: self.repr, + used: self.used, + pos: 0, + sep_repr: sep.internal_raw_bytes(), + sep_len: sep.len(), + finished: false, + }; + } + + /// Returns an iterator over at most `n` substrings split by the given separator. + pub fn splitn(&self, n: i32, sep: String) -> StrSplitNIter { + return StrSplitNIter { + repr: self.repr, + used: self.used, + pos: 0, + sep_repr: sep.internal_raw_bytes(), + sep_len: sep.len(), + remaining: n, + finished: n <= 0, + }; + } + + /// Returns an iterator over whitespace-separated substrings. + pub fn split_whitespace(&self) -> StrSplitWhitespaceIter { + return StrSplitWhitespaceIter { + repr: self.repr, + used: self.used, + pos: 0, + }; + } + + /// Returns an iterator over the lines of this string. + pub fn lines(&self) -> StrLinesIter { + return StrLinesIter { + repr: self.repr, + used: self.used, + pos: 0, + finished: false, + }; + } + + /// Returns an iterator over characters with their byte indices. + pub fn char_indices(&self) -> StrCharIndicesIter { + return StrCharIndicesIter { + repr: self.repr, + used: self.used, + byte_index: 0, + }; + } +} diff --git a/wado-compiler/lib/core/prelude/string_test.wado b/wado-compiler/lib/core/prelude/string_test.wado index 317407cbd..613ebd210 100644 --- a/wado-compiler/lib/core/prelude/string_test.wado +++ b/wado-compiler/lib/core/prelude/string_test.wado @@ -175,43 +175,43 @@ test "collect multibyte chars" { test "truncate_bytes ASCII" { let mut s = "hello world"; - s.truncate_bytes(5); + s.truncate(5); assert s == "hello"; } test "truncate_bytes no-op when len >= current" { let mut s = "hi"; - s.truncate_bytes(10); + s.truncate(10); assert s == "hi"; } test "truncate_bytes to zero" { let mut s = "abc"; - s.truncate_bytes(0); + s.truncate(0); assert s == ""; } test "truncate_bytes UTF-8 3-byte boundary" { let mut s = "日本語"; - s.truncate_bytes(6); + s.truncate(6); assert s == "日本"; } test "truncate_bytes exact length" { let mut s = "hello"; - s.truncate_bytes(5); + s.truncate(5); assert s == "hello"; } test "truncate_bytes UTF-8 2-byte boundary" { let mut s = "ñé"; - s.truncate_bytes(2); + s.truncate(2); assert s == "ñ"; } test "truncate_bytes UTF-8 4-byte boundary" { let mut s = "😀😃"; - s.truncate_bytes(4); + s.truncate(4); assert s == "😀"; } @@ -468,9 +468,9 @@ test "String::concat" { test "String::append" { let mut builder = String::with_capacity(20); - builder.append("Hello"); - builder.append(", "); - builder.append("World!"); + builder.push_str("Hello"); + builder.push_str(", "); + builder.push_str("World!"); assert builder == "Hello, World!"; } @@ -483,7 +483,7 @@ test "String::with_capacity starts empty" { test "append updates len" { let mut s = String::with_capacity(10); assert s.len() == 0; - s.append("Hi"); + s.push_str("Hi"); assert s.len() == 2; } @@ -707,3 +707,270 @@ test "String::from_utf8_unchecked roundtrip" { test "String::from_utf8_unchecked from bytes iter" { assert String::from_utf8_unchecked("日本語".bytes()) == "日本語"; } + +// --- New API tests --- + +test "push_str" { + let mut s = String::with_capacity(20); + s.push_str("Hello"); + s.push_str(", "); + s.push_str("World!"); + assert s == "Hello, World!"; +} + +test "push" { + let mut s = String::with_capacity(10); + s.push('H'); + s.push('i'); + s.push('!'); + assert s == "Hi!"; +} + +test "push multibyte" { + let mut s = String::with_capacity(20); + s.push('日'); + s.push('本'); + assert s == "日本"; +} + +test "pop ASCII" { + let mut s = "hello"; + let c = s.pop(); + assert c matches { Some(ch) && ch == 'o' }; + assert s == "hell"; +} + +test "pop multibyte" { + let mut s = "日本"; + let c = s.pop(); + assert c matches { Some(ch) && ch as i32 == 0x672C }; + assert s == "日"; +} + +test "pop empty" { + let mut s = ""; + assert s.pop() matches { None }; +} + +test "clear" { + let mut s = "hello"; + s.clear(); + assert s == ""; + assert s.is_empty(); +} + +test "capacity and reserve" { + let mut s = String::with_capacity(10); + assert s.capacity() >= 10; + s.push_str("hi"); + s.reserve(100); + assert s.capacity() >= 102; + assert s == "hi"; +} + +test "shrink_to_fit" { + let mut s = String::with_capacity(1000); + s.push_str("hi"); + s.shrink_to_fit(); + assert s.capacity() == 2; + assert s == "hi"; +} + +test "as_bytes" { + let bytes = "Hello".as_bytes(); + assert bytes.len() == 5; + assert bytes[0] == 72; + assert bytes[4] == 111; +} + +test "as_bytes multibyte" { + let bytes = "日".as_bytes(); + assert bytes.len() == 3; + assert bytes[0] == 0xE6; + assert bytes[1] == 0x97; + assert bytes[2] == 0xA5; +} + +test "contains" { + assert "hello world".contains("world"); + assert "hello world".contains("hello"); + assert "hello world".contains(" "); + assert !"hello world".contains("xyz"); + assert "hello".contains(""); +} + +test "starts_with" { + assert "hello world".starts_with("hello"); + assert !"hello world".starts_with("world"); + assert "hello".starts_with(""); + assert "hello".starts_with("hello"); +} + +test "ends_with" { + assert "hello world".ends_with("world"); + assert !"hello world".ends_with("hello"); + assert "hello".ends_with(""); + assert "hello".ends_with("hello"); +} + +test "find" { + assert "hello world".find("world") matches { Some(idx) && idx == 6 }; + assert "hello world".find("hello") matches { Some(idx) && idx == 0 }; + assert "hello world".find("xyz") matches { None }; + assert "abcabc".find("bc") matches { Some(idx) && idx == 1 }; +} + +test "rfind" { + assert "abcabc".rfind("bc") matches { Some(idx) && idx == 4 }; + assert "hello".rfind("xyz") matches { None }; + assert "hello".rfind("hello") matches { Some(idx) && idx == 0 }; +} + +test "contains_char" { + assert "hello".contains_char('h'); + assert "hello".contains_char('o'); + assert !"hello".contains_char('x'); +} + +test "find_char" { + assert "hello".find_char(|c: char| c == 'l') matches { Some(idx) && idx == 2 }; + assert "hello".find_char(|c: char| c == 'x') matches { None }; +} + +test "truncate" { + let mut s = "hello world"; + s.truncate(5); + assert s == "hello"; +} + +test "truncate no-op" { + let mut s = "hi"; + s.truncate(10); + assert s == "hi"; +} + +test "insert char" { + let mut s = "hllo"; + s.insert(1, 'e'); + assert s == "hello"; +} + +test "insert char at start" { + let mut s = "ello"; + s.insert(0, 'h'); + assert s == "hello"; +} + +test "insert char at end" { + let mut s = "hell"; + s.insert(4, 'o'); + assert s == "hello"; +} + +test "insert_str" { + let mut s = "hd"; + s.insert_str(1, "ello worl"); + assert s == "hello world"; +} + +test "remove" { + let mut s = "hello"; + let c = s.remove(0); + assert c == 'h'; + assert s == "ello"; +} + +test "remove middle" { + let mut s = "hello"; + let c = s.remove(2); + assert c == 'l'; + assert s == "helo"; +} + +test "repeat" { + assert "ab".repeat(3) == "ababab"; + assert "x".repeat(0) == ""; + assert "hi".repeat(1) == "hi"; +} + +test "replace" { + assert "hello world".replace("world", "earth") == "hello earth"; + assert "aaa".replace("a", "bb") == "bbbbbb"; + assert "hello".replace("xyz", "abc") == "hello"; +} + +test "replacen" { + assert "aaa".replacen("a", "bb", 2) == "bbbba"; + assert "aaa".replacen("a", "bb", 0) == "aaa"; +} + +test "split" { + let parts: Array = "a,b,c".split(",").collect(); + assert parts.len() == 3; + assert parts[0] == "a"; + assert parts[1] == "b"; + assert parts[2] == "c"; +} + +test "split no match" { + let parts: Array = "hello".split(",").collect(); + assert parts.len() == 1; + assert parts[0] == "hello"; +} + +test "splitn" { + let parts: Array = "a,b,c,d".splitn(3, ",").collect(); + assert parts.len() == 3; + assert parts[0] == "a"; + assert parts[1] == "b"; + assert parts[2] == "c,d"; +} + +test "split_whitespace" { + let parts: Array = " hello world ".split_whitespace().collect(); + assert parts.len() == 2; + assert parts[0] == "hello"; + assert parts[1] == "world"; +} + +test "split_whitespace empty" { + let parts: Array = " ".split_whitespace().collect(); + assert parts.len() == 0; +} + +test "lines" { + let ls: Array = "hello\nworld\n".lines().collect(); + assert ls.len() == 2; + assert ls[0] == "hello"; + assert ls[1] == "world"; +} + +test "lines CRLF" { + let ls: Array = "a\r\nb\r\n".lines().collect(); + assert ls.len() == 2; + assert ls[0] == "a"; + assert ls[1] == "b"; +} + +test "lines no trailing newline" { + let ls: Array = "a\nb".lines().collect(); + assert ls.len() == 2; + assert ls[0] == "a"; + assert ls[1] == "b"; +} + +test "char_indices" { + let indices: Array<[i32, char]> = "Aé".char_indices().collect(); + assert indices.len() == 2; + assert indices[0].0 == 0; + assert indices[0].1 == 'A'; + assert indices[1].0 == 1; + assert indices[1].1 as i32 == 0xE9; +} + +test "char_indices multibyte" { + let indices: Array<[i32, char]> = "日本".char_indices().collect(); + assert indices.len() == 2; + assert indices[0].0 == 0; + assert indices[1].0 == 3; +} diff --git a/wado-compiler/lib/core/prelude/traits.wado b/wado-compiler/lib/core/prelude/traits.wado index 3f4d7ea3e..7963d97ed 100644 --- a/wado-compiler/lib/core/prelude/traits.wado +++ b/wado-compiler/lib/core/prelude/traits.wado @@ -313,7 +313,7 @@ pub trait Iterator { fn collect(&mut self) -> Array { let mut result: Array = []; while let Some(item) = self.next() { - result.append(item); + result.push(item); } return result; } diff --git a/wado-compiler/lib/core/serde.wado b/wado-compiler/lib/core/serde.wado index 6338ae123..6f9508450 100644 --- a/wado-compiler/lib/core/serde.wado +++ b/wado-compiler/lib/core/serde.wado @@ -524,12 +524,12 @@ impl Deserialize for Array { if let Ok(first_opt) = first { if let Some(first_elem) = first_opt { let mut items = Array::::with_capacity(2); - items.append(first_elem); + items.push(first_elem); loop { let next = seq.next_element::(); if let Ok(next_opt) = next { if let Some(item) = next_opt { - items.append(item); + items.push(item); } else { let end_result = seq.end(); if let Err(e) = end_result { diff --git a/wado-compiler/lib/core/serde_test.wado b/wado-compiler/lib/core/serde_test.wado index c854c4d4f..a6c895ab2 100644 --- a/wado-compiler/lib/core/serde_test.wado +++ b/wado-compiler/lib/core/serde_test.wado @@ -47,7 +47,7 @@ struct MockSerializer { impl SerializeSeq for MockSeqSerializer { fn element(&mut self, value: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.w.buf.append(","); + self.w.buf.push_str(","); } let mut ser = MockSerializer { w: self.w }; let r = value.serialize::(&mut ser); @@ -57,7 +57,7 @@ impl SerializeSeq for MockSeqSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.w.buf.append("]"); + self.w.buf.push_str("]"); return Result::<(), SerializeError>::Ok(()); } } @@ -65,12 +65,12 @@ impl SerializeSeq for MockSeqSerializer { impl SerializeMap for MockMapSerializer { fn key(&mut self, key: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.w.buf.append(","); + self.w.buf.push_str(","); } let mut ser = MockSerializer { w: self.w }; let r = key.serialize::(&mut ser); self.w = ser.w; - self.w.buf.append(":"); + self.w.buf.push_str(":"); return r; } @@ -83,7 +83,7 @@ impl SerializeMap for MockMapSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.w.buf.append("}"); + self.w.buf.push_str("}"); return Result::<(), SerializeError>::Ok(()); } } @@ -91,9 +91,9 @@ impl SerializeMap for MockMapSerializer { impl SerializeStruct for MockStructSerializer { fn field(&mut self, name: &String, value: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.w.buf.append(","); + self.w.buf.push_str(","); } - self.w.buf.append(`"{*name}":`); + self.w.buf.push_str(`"{*name}":`); let mut ser = MockSerializer { w: self.w }; let r = value.serialize::(&mut ser); self.w = ser.w; @@ -102,7 +102,7 @@ impl SerializeStruct for MockStructSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.w.buf.append("}"); + self.w.buf.push_str("}"); return Result::<(), SerializeError>::Ok(()); } } @@ -116,7 +116,7 @@ impl SerializeVariant for MockVariantSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.w.buf.append("}"); + self.w.buf.push_str("}"); return Result::<(), SerializeError>::Ok(()); } } @@ -128,81 +128,81 @@ impl Serializer for MockSerializer { type VariantSerializer = MockVariantSerializer; fn serialize_i32(&mut self, v: i32) -> Result<(), SerializeError> { - self.w.buf.append(`{v}`); + self.w.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_i64(&mut self, v: i64) -> Result<(), SerializeError> { - self.w.buf.append(`{v}`); + self.w.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_u32(&mut self, v: u32) -> Result<(), SerializeError> { - self.w.buf.append(`{v}`); + self.w.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_u64(&mut self, v: u64) -> Result<(), SerializeError> { - self.w.buf.append(`{v}`); + self.w.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_f32(&mut self, v: f32) -> Result<(), SerializeError> { - self.w.buf.append(`{v as f64}`); + self.w.buf.push_str(`{v as f64}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_f64(&mut self, v: f64) -> Result<(), SerializeError> { - self.w.buf.append(`{v}`); + self.w.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_bool(&mut self, v: bool) -> Result<(), SerializeError> { if v { - self.w.buf.append("true"); + self.w.buf.push_str("true"); } else { - self.w.buf.append("false"); + self.w.buf.push_str("false"); } return Result::<(), SerializeError>::Ok(()); } fn serialize_char(&mut self, v: char) -> Result<(), SerializeError> { - self.w.buf.append(`"{v}"`); + self.w.buf.push_str(`"{v}"`); return Result::<(), SerializeError>::Ok(()); } fn serialize_string(&mut self, v: &String) -> Result<(), SerializeError> { - self.w.buf.append(`"{*v}"`); + self.w.buf.push_str(`"{*v}"`); return Result::<(), SerializeError>::Ok(()); } fn serialize_null(&mut self) -> Result<(), SerializeError> { - self.w.buf.append("null"); + self.w.buf.push_str("null"); return Result::<(), SerializeError>::Ok(()); } fn begin_seq(&mut self, len: i32) -> Result { - self.w.buf.append("["); + self.w.buf.push_str("["); return Result::::Ok(MockSeqSerializer { w: self.w, count: 0 }); } fn begin_map(&mut self, len: i32) -> Result { - self.w.buf.append("{"); + self.w.buf.push_str("{"); return Result::::Ok(MockMapSerializer { w: self.w, count: 0 }); } fn begin_struct(&mut self, name: &String, fields: i32) -> Result { - self.w.buf.append("{"); + self.w.buf.push_str("{"); return Result::::Ok(MockStructSerializer { w: self.w, count: 0 }); } fn serialize_unit_variant(&mut self, type_name: &String, variant_name: &String, disc: i32) -> Result<(), SerializeError> { - self.w.buf.append(`"{*variant_name}"`); + self.w.buf.push_str(`"{*variant_name}"`); return Result::<(), SerializeError>::Ok(()); } fn begin_variant(&mut self, type_name: &String, variant_name: &String, disc: i32) -> Result { - self.w.buf.append(`\{"{*variant_name}":`); + self.w.buf.push_str(`\{"{*variant_name}":`); return Result::::Ok(MockVariantSerializer { w: self.w }); } } diff --git a/wado-compiler/lib/core/zlib.wado b/wado-compiler/lib/core/zlib.wado index d9581b792..83976e904 100644 --- a/wado-compiler/lib/core/zlib.wado +++ b/wado-compiler/lib/core/zlib.wado @@ -866,7 +866,7 @@ fn inflate_raw_ex(input: &Array, input_offset: i32, input_length: i32) -> [A copy = have; } for let mut i = 0; i < copy; i += 1 { - output.append(input[inp + i]); + output.push(input[inp + i]); } have -= copy; inp += copy; @@ -1311,7 +1311,7 @@ fn inflate_raw_ex(input: &Array, input_offset: i32, input_length: i32) -> [A win_copy = copy; } for let mut i = 0; i < win_copy; i += 1 { - output.append(state.window[(from_win + i) % state.wsize]); + output.push(state.window[(from_win + i) % state.wsize]); } copy -= win_copy; // rest from output @@ -1332,7 +1332,7 @@ fn inflate_raw_ex(input: &Array, input_offset: i32, input_length: i32) -> [A } }, Lit => { - output.append(state.length as u8); + output.push(state.length as u8); // update window periodically if output.len() % 32768 == 0 { let wlen = if output.len() > 32768 { 32768 } else { output.len() }; @@ -1453,23 +1453,23 @@ pub fn deflate_stored(input: &Array) -> Array { // Block header: BFINAL (1 bit) + BTYPE=00 (2 bits) = stored if is_last { - output.append(1); // BFINAL=1, BTYPE=00 + output.push(1); // BFINAL=1, BTYPE=00 } else { - output.append(0); // BFINAL=0, BTYPE=00 + output.push(0); // BFINAL=0, BTYPE=00 } // LEN and NLEN (little-endian) let len_lo = (block_len & 0xFF) as u8; let len_hi = (block_len >> 8 & 0xFF) as u8; - output.append(len_lo); - output.append(len_hi); + output.push(len_lo); + output.push(len_hi); let nlen = block_len ^ 0xFFFF; - output.append((nlen & 0xFF) as u8); - output.append((nlen >> 8 & 0xFF) as u8); + output.push((nlen & 0xFF) as u8); + output.push((nlen >> 8 & 0xFF) as u8); // Data for let mut i = 0; i < block_len; i += 1 { - output.append(input[pos + i]); + output.push(input[pos + i]); } pos += block_len; } @@ -1483,21 +1483,21 @@ pub fn zlib_compress_stored(input: &Array) -> Array { let mut output: Array = Array::::with_capacity(input.len() + 12); // zlib header: CMF=0x78 (deflate, 32K window), FLG=0x01 (check bits) - output.append(0x78); - output.append(0x01); + output.push(0x78); + output.push(0x01); // deflate stored blocks let deflated = deflate_stored(input); for let mut i = 0; i < deflated.len(); i += 1 { - output.append(deflated[i]); + output.push(deflated[i]); } // adler32 trailer (big-endian) let checksum = adler32(adler32_init(), input, 0, input.len()); - output.append((checksum >> 24 & 0xFF) as u8); - output.append((checksum >> 16 & 0xFF) as u8); - output.append((checksum >> 8 & 0xFF) as u8); - output.append((checksum & 0xFF) as u8); + output.push((checksum >> 24 & 0xFF) as u8); + output.push((checksum >> 16 & 0xFF) as u8); + output.push((checksum >> 8 & 0xFF) as u8); + output.push((checksum & 0xFF) as u8); return output; } @@ -1536,10 +1536,10 @@ impl BitWriter { self.buf = self.buf | value as u64 << self.bits as u64; self.bits += count; while self.bits >= 32 { - self.output.append((self.buf & 0xFF) as u8); - self.output.append((self.buf >> 8 & 0xFF) as u8); - self.output.append((self.buf >> 16 & 0xFF) as u8); - self.output.append((self.buf >> 24 & 0xFF) as u8); + self.output.push((self.buf & 0xFF) as u8); + self.output.push((self.buf >> 8 & 0xFF) as u8); + self.output.push((self.buf >> 16 & 0xFF) as u8); + self.output.push((self.buf >> 24 & 0xFF) as u8); self.buf = self.buf >> 32; self.bits -= 32; } @@ -1547,12 +1547,12 @@ impl BitWriter { fn flush(&mut self) { while self.bits >= 8 { - self.output.append((self.buf & 0xFF) as u8); + self.output.push((self.buf & 0xFF) as u8); self.buf = self.buf >> 8; self.bits -= 8; } if self.bits > 0 { - self.output.append((self.buf & 0xFF) as u8); + self.output.push((self.buf & 0xFF) as u8); self.buf = 0 as u64; self.bits = 0; } @@ -1865,7 +1865,7 @@ fn build_huffman_tree(freqs: &Array, max_sym: i32, max_bits: i32, bl_count: let mut items: Array<[i32, i32]> = []; // [freq, index] for let mut i = 0; i < max_sym; i += 1 { if freqs[i] > 0 { - items.append([freqs[i], i]); + items.push([freqs[i], i]); } } @@ -1959,7 +1959,7 @@ fn build_huffman_tree(freqs: &Array, max_sym: i32, max_bits: i32, bl_count: node_freq[parent] = n1_freq + n2_freq; dad[n1_idx] = parent; dad[n2_idx] = parent; - int_nodes.append([n1_freq + n2_freq, parent]); + int_nodes.push([n1_freq + n2_freq, parent]); next_node += 1; nodes_remaining -= 1; } @@ -2024,7 +2024,7 @@ fn build_huffman_tree(freqs: &Array, max_sym: i32, max_bits: i32, bl_count: if d > max_bits { d = max_bits; } - sym_list.append([d, freqs[i], i]); + sym_list.push([d, freqs[i], i]); } } // Sort by depth ascending, then freq ascending @@ -2196,32 +2196,32 @@ fn write_dynamic_block(bw: &mut BitWriter, symbols: &Array, distances: &Arr while rem > 0 { if rem >= 11 { let run = i32::min(rem, 138); - rle.append(18); - rle_extra.append(run - 11); + rle.push(18); + rle_extra.push(run - 11); rem -= run; } else if rem >= 3 { - rle.append(17); - rle_extra.append(rem - 3); + rle.push(17); + rle_extra.push(rem - 3); rem = 0; } else { - rle.append(0); - rle_extra.append(0); + rle.push(0); + rle_extra.push(0); rem -= 1; } } } else { - rle.append(val); - rle_extra.append(0); + rle.push(val); + rle_extra.push(0); let mut rem = count - 1; while rem > 0 { if rem >= 3 { let run = i32::min(rem, 6); - rle.append(16); - rle_extra.append(run - 3); + rle.push(16); + rle_extra.push(run - 3); rem -= run; } else { - rle.append(val); - rle_extra.append(0); + rle.push(val); + rle_extra.push(0); rem -= 1; } } @@ -2426,8 +2426,8 @@ pub fn deflate_with_level(input: &Array, level: i32, strategy: i32) -> Array if strategy == 2 { // Z_HUFFMAN_ONLY for let mut i = 0; i < input_len; i += 1 { - symbols.append(input[i] as i32); - distances.append(0); + symbols.push(input[i] as i32); + distances.push(0); } } else if strategy == 3 { // Z_RLE — run-length only @@ -2441,17 +2441,17 @@ pub fn deflate_with_level(input: &Array, level: i32, strategy: i32) -> Array } if run >= 4 { // Emit literal for first byte, then match(distance=1, length=run-1) for the rest - symbols.append(input[pos] as i32); - distances.append(0); + symbols.push(input[pos] as i32); + distances.push(0); let match_len = run - 1; // Cap match at 258 let actual_match = i32::min(match_len, 258); - symbols.append(257 + actual_match - 3); - distances.append(1); + symbols.push(257 + actual_match - 3); + distances.push(1); pos += 1 + actual_match; } else { - symbols.append(input[pos] as i32); - distances.append(0); + symbols.push(input[pos] as i32); + distances.push(0); pos += 1; } } @@ -2519,15 +2519,15 @@ pub fn deflate_with_level(input: &Array, level: i32, strategy: i32) -> Array if match_available { if best_len > prev_match_len { // Current match is better: emit previous as literal - symbols.append(input[pos - 1] as i32); - distances.append(0); + symbols.push(input[pos - 1] as i32); + distances.push(0); prev_match_len = best_len; prev_match_dist = best_dist; pos += 1; } else { // Previous match was better: emit it - symbols.append(257 + prev_match_len - 3); - distances.append(prev_match_dist); + symbols.push(257 + prev_match_len - 3); + distances.push(prev_match_dist); // Insert hash entries for skipped positions let skip = prev_match_len - 1; for let mut i = 0; i < skip - 1; i += 1 { @@ -2551,8 +2551,8 @@ pub fn deflate_with_level(input: &Array, level: i32, strategy: i32) -> Array pos += 1; } else { // Match is long enough, emit immediately - symbols.append(257 + best_len - 3); - distances.append(best_dist); + symbols.push(257 + best_len - 3); + distances.push(best_dist); for let mut i = 1; i < best_len; i += 1 { if pos + i + 2 < input_len { let mh = hash3(input[pos + i], input[pos + i + 1], input[pos + i + 2]); @@ -2565,16 +2565,16 @@ pub fn deflate_with_level(input: &Array, level: i32, strategy: i32) -> Array prev_match_len = 0; } } else { - symbols.append(input[pos] as i32); - distances.append(0); + symbols.push(input[pos] as i32); + distances.push(0); pos += 1; } } // Flush pending match if match_available { - symbols.append(input[input_len - 1] as i32); - distances.append(0); + symbols.push(input[input_len - 1] as i32); + distances.push(0); } } else { // Fast matching (levels 1-3) — no lazy evaluation @@ -2624,8 +2624,8 @@ pub fn deflate_with_level(input: &Array, level: i32, strategy: i32) -> Array } if best_len >= 3 { - symbols.append(257 + best_len - 3); - distances.append(best_dist); + symbols.push(257 + best_len - 3); + distances.push(best_dist); for let mut i = 1; i < best_len; i += 1 { if pos + i + 2 < input_len { let mh = hash3(input[pos + i], input[pos + i + 1], input[pos + i + 2]); @@ -2635,8 +2635,8 @@ pub fn deflate_with_level(input: &Array, level: i32, strategy: i32) -> Array } pos += best_len; } else { - symbols.append(input[pos] as i32); - distances.append(0); + symbols.push(input[pos] as i32); + distances.push(0); pos += 1; } } @@ -2759,32 +2759,32 @@ pub fn deflate_with_level(input: &Array, level: i32, strategy: i32) -> Array while hrem > 0 { if hrem >= 11 { let hrun = i32::min(hrem, 138); - hdr_rle.append(18); - hdr_rle_extra.append(hrun - 11); + hdr_rle.push(18); + hdr_rle_extra.push(hrun - 11); hrem -= hrun; } else if hrem >= 3 { - hdr_rle.append(17); - hdr_rle_extra.append(hrem - 3); + hdr_rle.push(17); + hdr_rle_extra.push(hrem - 3); hrem = 0; } else { - hdr_rle.append(0); - hdr_rle_extra.append(0); + hdr_rle.push(0); + hdr_rle_extra.push(0); hrem -= 1; } } } else { - hdr_rle.append(hval); - hdr_rle_extra.append(0); + hdr_rle.push(hval); + hdr_rle_extra.push(0); let mut hrem = hcount - 1; while hrem > 0 { if hrem >= 3 { let hrun = i32::min(hrem, 6); - hdr_rle.append(16); - hdr_rle_extra.append(hrun - 3); + hdr_rle.push(16); + hdr_rle_extra.push(hrun - 3); hrem -= hrun; } else { - hdr_rle.append(hval); - hdr_rle_extra.append(0); + hdr_rle.push(hval); + hdr_rle_extra.push(0); hrem -= 1; } } @@ -2883,19 +2883,19 @@ fn zlib_wrap(input: &Array, deflated: &Array, level: i32) -> Array { if rem != 0 { flg += 31 - rem; } - output.append(cmf as u8); - output.append(flg as u8); + output.push(cmf as u8); + output.push(flg as u8); for let mut i = 0; i < deflated.len(); i += 1 { - output.append(deflated[i]); + output.push(deflated[i]); } // adler32 trailer (big-endian) let checksum = adler32(adler32_init(), input, 0, input.len()); - output.append((checksum >> 24 & 0xFF) as u8); - output.append((checksum >> 16 & 0xFF) as u8); - output.append((checksum >> 8 & 0xFF) as u8); - output.append((checksum & 0xFF) as u8); + output.push((checksum >> 24 & 0xFF) as u8); + output.push((checksum >> 16 & 0xFF) as u8); + output.push((checksum >> 8 & 0xFF) as u8); + output.push((checksum & 0xFF) as u8); return output; } @@ -3033,7 +3033,7 @@ pub fn inflate_gzip(input: &Array) -> Result, ZlibError> { // Append member output for let mut i = 0; i < member_output.len(); i += 1 { - output.append(member_output[i]); + output.push(member_output[i]); } // Move to next member @@ -3059,14 +3059,14 @@ pub fn gzip_compress2(input: &Array, level: i32) -> Array { let mut output: Array = Array::::with_capacity(deflated.len() + 18); // Gzip header (10 bytes) - output.append(GZIP_MAGIC1); // ID1 - output.append(GZIP_MAGIC2); // ID2 - output.append(8); // CM = deflate - output.append(0); // FLG = no flags - output.append(0); // MTIME (4 bytes, zero) - output.append(0); - output.append(0); - output.append(0); + output.push(GZIP_MAGIC1); // ID1 + output.push(GZIP_MAGIC2); // ID2 + output.push(8); // CM = deflate + output.push(0); // FLG = no flags + output.push(0); // MTIME (4 bytes, zero) + output.push(0); + output.push(0); + output.push(0); // XFL: compression level hint let xfl: u8 = if level <= 1 { 4; @@ -3075,27 +3075,27 @@ pub fn gzip_compress2(input: &Array, level: i32) -> Array { } else { 0; }; - output.append(xfl); - output.append(0xFF); // OS = unknown + output.push(xfl); + output.push(0xFF); // OS = unknown // Compressed data for let mut i = 0; i < deflated.len(); i += 1 { - output.append(deflated[i]); + output.push(deflated[i]); } // CRC32 trailer (little-endian) let crc = crc32(crc32_init(), input, 0, input.len()); - output.append((crc & 0xFF) as u8); - output.append((crc >> 8 & 0xFF) as u8); - output.append((crc >> 16 & 0xFF) as u8); - output.append((crc >> 24 & 0xFF) as u8); + output.push((crc & 0xFF) as u8); + output.push((crc >> 8 & 0xFF) as u8); + output.push((crc >> 16 & 0xFF) as u8); + output.push((crc >> 24 & 0xFF) as u8); // ISIZE: original size mod 2^32 (little-endian) let isize_val = input.len() as u32; - output.append((isize_val & 0xFF) as u8); - output.append((isize_val >> 8 & 0xFF) as u8); - output.append((isize_val >> 16 & 0xFF) as u8); - output.append((isize_val >> 24 & 0xFF) as u8); + output.push((isize_val & 0xFF) as u8); + output.push((isize_val >> 8 & 0xFF) as u8); + output.push((isize_val >> 16 & 0xFF) as u8); + output.push((isize_val >> 24 & 0xFF) as u8); return output; } @@ -3184,7 +3184,7 @@ impl GzipHeader { pub fn set_extra(&mut self, extra: &Array) { self.extra = []; for let mut i = 0; i < extra.len(); i += 1 { - self.extra.append(extra[i]); + self.extra.push(extra[i]); } } @@ -3208,9 +3208,9 @@ pub fn gzip_compress_with_header(input: &Array, level: i32, header: &GzipHea let mut output: Array = Array::::with_capacity(deflated.len() + 64); // Gzip header - output.append(GZIP_MAGIC1); - output.append(GZIP_MAGIC2); - output.append(8); // CM = deflate + output.push(GZIP_MAGIC1); + output.push(GZIP_MAGIC2); + output.push(8); // CM = deflate // Flags let mut flags = 0; @@ -3229,13 +3229,13 @@ pub fn gzip_compress_with_header(input: &Array, level: i32, header: &GzipHea if header.comment.len() > 0 { flags = flags | 16; // FCOMMENT } - output.append(flags as u8); + output.push(flags as u8); // MTIME (4 bytes little-endian) - output.append((header.time & 0xFF) as u8); - output.append((header.time >> 8 & 0xFF) as u8); - output.append((header.time >> 16 & 0xFF) as u8); - output.append((header.time >> 24 & 0xFF) as u8); + output.push((header.time & 0xFF) as u8); + output.push((header.time >> 8 & 0xFF) as u8); + output.push((header.time >> 16 & 0xFF) as u8); + output.push((header.time >> 24 & 0xFF) as u8); // XFL let xfl = if level <= 1 { @@ -3245,62 +3245,62 @@ pub fn gzip_compress_with_header(input: &Array, level: i32, header: &GzipHea } else { 0; }; - output.append(xfl as u8); + output.push(xfl as u8); // OS - output.append(header.os as u8); + output.push(header.os as u8); // Extra field if header.extra.len() > 0 { let xlen = header.extra.len(); - output.append((xlen & 0xFF) as u8); - output.append((xlen >> 8 & 0xFF) as u8); + output.push((xlen & 0xFF) as u8); + output.push((xlen >> 8 & 0xFF) as u8); for let mut i = 0; i < xlen; i += 1 { - output.append(header.extra[i]); + output.push(header.extra[i]); } } // File name (null-terminated) if header.name.len() > 0 { for let mut i = 0; i < header.name.len(); i += 1 { - output.append(header.name.get_byte(i)); + output.push(header.name.get_byte(i)); } - output.append(0); + output.push(0); } // Comment (null-terminated) if header.comment.len() > 0 { for let mut i = 0; i < header.comment.len(); i += 1 { - output.append(header.comment.get_byte(i)); + output.push(header.comment.get_byte(i)); } - output.append(0); + output.push(0); } // Header CRC16 if header.hcrc { let hcrc = crc32(crc32_init(), &output, 0, output.len()); - output.append((hcrc & 0xFF) as u8); - output.append((hcrc >> 8 & 0xFF) as u8); + output.push((hcrc & 0xFF) as u8); + output.push((hcrc >> 8 & 0xFF) as u8); } // Compressed data for let mut i = 0; i < deflated.len(); i += 1 { - output.append(deflated[i]); + output.push(deflated[i]); } // CRC32 trailer let crc = crc32(crc32_init(), input, 0, input.len()); - output.append((crc & 0xFF) as u8); - output.append((crc >> 8 & 0xFF) as u8); - output.append((crc >> 16 & 0xFF) as u8); - output.append((crc >> 24 & 0xFF) as u8); + output.push((crc & 0xFF) as u8); + output.push((crc >> 8 & 0xFF) as u8); + output.push((crc >> 16 & 0xFF) as u8); + output.push((crc >> 24 & 0xFF) as u8); // ISIZE let isize_val = input.len() as u32; - output.append((isize_val & 0xFF) as u8); - output.append((isize_val >> 8 & 0xFF) as u8); - output.append((isize_val >> 16 & 0xFF) as u8); - output.append((isize_val >> 24 & 0xFF) as u8); + output.push((isize_val & 0xFF) as u8); + output.push((isize_val >> 8 & 0xFF) as u8); + output.push((isize_val >> 16 & 0xFF) as u8); + output.push((isize_val >> 24 & 0xFF) as u8); return output; } @@ -3310,7 +3310,7 @@ fn bytes_to_string(buf: &Array, offset: i32, len: i32) -> String { let mut s = String::with_capacity(len); for let mut i = 0; i < len; i += 1 { // Append single-byte characters as strings via template - s.append(`{buf[offset + i] as char}`); + s.push(`{buf[offset + i] as char}`); } return s; } @@ -3348,7 +3348,7 @@ pub fn inflate_get_gzip_header(input: &Array) -> Result DeflateStream { let mut buf_copy: Array = Array::::with_capacity(self.buffer.len()); for let mut i = 0; i < self.buffer.len(); i += 1 { - buf_copy.append(self.buffer[i]); + buf_copy.push(self.buffer[i]); } return DeflateStream { level: self.level, @@ -3543,7 +3543,7 @@ impl DeflateStream { panic("DeflateStream already finished"); } for let mut i = 0; i < chunk.len(); i += 1 { - self.buffer.append(chunk[i]); + self.buffer.push(chunk[i]); } } @@ -3649,7 +3649,7 @@ impl InflateStream { pub fn copy(&self) -> InflateStream { let mut buf_copy: Array = Array::::with_capacity(self.buffer.len()); for let mut i = 0; i < self.buffer.len(); i += 1 { - buf_copy.append(self.buffer[i]); + buf_copy.push(self.buffer[i]); } return InflateStream { format: self.format, @@ -3662,7 +3662,7 @@ impl InflateStream { /// Adds a compressed data chunk to the stream buffer. pub fn update(&mut self, chunk: &Array) { for let mut i = 0; i < chunk.len(); i += 1 { - self.buffer.append(chunk[i]); + self.buffer.push(chunk[i]); } } diff --git a/wado-compiler/lib/core/zlib_test.wado b/wado-compiler/lib/core/zlib_test.wado index b70529d2d..9319d8a66 100644 --- a/wado-compiler/lib/core/zlib_test.wado +++ b/wado-compiler/lib/core/zlib_test.wado @@ -72,7 +72,7 @@ fn bytes_equal(a: &Array, b: &Array) -> bool { fn string_to_bytes(s: String) -> Array { let mut out: Array = Array::::with_capacity(s.len()); for let mut i = 0; i < s.len(); i += 1 { - out.append(s.get_byte(i)); + out.push(s.get_byte(i)); } return out; } @@ -80,7 +80,7 @@ fn string_to_bytes(s: String) -> Array { fn make_pattern_data(size: i32) -> Array { let mut data: Array = Array::::with_capacity(size); for let mut i = 0; i < size; i += 1 { - data.append((i % 256) as u8); + data.push((i % 256) as u8); } return data; } @@ -88,7 +88,7 @@ fn make_pattern_data(size: i32) -> Array { fn make_repeated(byte: u8, count: i32) -> Array { let mut data: Array = Array::::with_capacity(count); for let mut i = 0; i < count; i += 1 { - data.append(byte); + data.push(byte); } return data; } @@ -157,10 +157,10 @@ test "adler32_combine" { let seg2 = string_to_bytes("World!"); let mut combined: Array = Array::::with_capacity(seg1.len() + seg2.len()); for let mut i = 0; i < seg1.len(); i += 1 { - combined.append(seg1[i]); + combined.push(seg1[i]); } for let mut i = 0; i < seg2.len(); i += 1 { - combined.append(seg2[i]); + combined.push(seg2[i]); } let a1 = adler32(adler32_init(), &seg1, 0, seg1.len()); @@ -175,10 +175,10 @@ test "crc32_combine" { let seg2 = string_to_bytes("World!"); let mut combined: Array = Array::::with_capacity(seg1.len() + seg2.len()); for let mut i = 0; i < seg1.len(); i += 1 { - combined.append(seg1[i]); + combined.push(seg1[i]); } for let mut i = 0; i < seg2.len(); i += 1 { - combined.append(seg2[i]); + combined.push(seg2[i]); } let c1 = crc32(crc32_init(), &seg1, 0, seg1.len()); @@ -289,7 +289,7 @@ test "Huffman round-trip Hello World x20" { let mut data: Array = Array::::with_capacity(280); for let mut j = 0; j < 20; j += 1 { for let mut i = 0; i < 14; i += 1 { - data.append(unit[i]); + data.push(unit[i]); } } let compressed = zlib_compress(&data); @@ -422,10 +422,10 @@ test "gzip multi-member" { let mut multi: Array = Array::::with_capacity(gz1.len() + gz2.len()); for let mut i = 0; i < gz1.len(); i += 1 { - multi.append(gz1[i]); + multi.push(gz1[i]); } for let mut i = 0; i < gz2.len(); i += 1 { - multi.append(gz2[i]); + multi.push(gz2[i]); } let decompressed = inflate_gzip(&multi).unwrap(); @@ -459,11 +459,11 @@ test "DeflateStream chunked update/finish" { let data = make_pattern_data(500); let mut chunk1: Array = Array::::with_capacity(200); for let mut i = 0; i < 200; i += 1 { - chunk1.append(data[i]); + chunk1.push(data[i]); } let mut chunk2: Array = Array::::with_capacity(300); for let mut i = 200; i < 500; i += 1 { - chunk2.append(data[i]); + chunk2.push(data[i]); } let mut ds = DeflateStream::new(Z_DEFAULT_COMPRESSION); @@ -482,11 +482,11 @@ test "InflateStream chunked update/finish" { let half = compressed.len() / 2; let mut c1: Array = Array::::with_capacity(half); for let mut i = 0; i < half; i += 1 { - c1.append(compressed[i]); + c1.push(compressed[i]); } let mut c2: Array = Array::::with_capacity(compressed.len() - half); for let mut i = half; i < compressed.len(); i += 1 { - c2.append(compressed[i]); + c2.push(compressed[i]); } let mut is = InflateStream::new(); diff --git a/wado-compiler/src/synthesis/cm_binding.rs b/wado-compiler/src/synthesis/cm_binding.rs index fab2e5568..037325c29 100644 --- a/wado-compiler/src/synthesis/cm_binding.rs +++ b/wado-compiler/src/synthesis/cm_binding.rs @@ -870,11 +870,11 @@ fn synthesize_lift_list( ); loop_stmts.extend(elem_lift_stmts); - // __result.append(lifted_elem) + // __result.push(lifted_elem) loop_stmts.push(expr_stmt(generic_method_call( local_ref(result_local, "__result", array_type_id), "Array", - "append", + "push", ModuleSource::prelude(), vec![lifted_elem], TypeTable::UNIT, @@ -5832,9 +5832,9 @@ fn synthesize_stream_read_func( receiver: Box::new(local_ref(arr_idx, "arr", array_type_id)), func: FunctionRef { module_source: ModuleSource::prelude(), - name: format!("Array<{elem_name}>::append"), + name: format!("Array<{elem_name}>::push"), monomorph_info: Some(MonomorphInfo { - generic_name: "Array::append".to_string(), + generic_name: "Array::push".to_string(), impl_type_args: vec![elem_type_id], method_type_args: vec![], is_blanket: false, @@ -5843,7 +5843,7 @@ fn synthesize_stream_read_func( struct_name: format!("Array<{elem_name}>"), base_struct_name: "Array".to_string(), trait_name: None, - method_name: "append".to_string(), + method_name: "push".to_string(), method_type_args: vec![], is_type_param_receiver: false, is_ref_impl: false, diff --git a/wado-compiler/src/synthesis/common.rs b/wado-compiler/src/synthesis/common.rs index 88ab9cd46..2b1b228a9 100644 --- a/wado-compiler/src/synthesis/common.rs +++ b/wado-compiler/src/synthesis/common.rs @@ -333,8 +333,8 @@ pub fn generic_static_call( /// Create a method call on a generic struct with proper monomorphization info. /// -/// For example, `arr.append(elem)` where `arr: Array` needs: -/// - `method_info` with `struct_name: "Array"`, `method_name: "append"` +/// For example, `arr.push(elem)` where `arr: Array` needs: +/// - `method_info` with `struct_name: "Array"`, `method_name: "push"` /// - The receiver's `type_id` must be the concrete `Array` `TypeId` pub fn generic_method_call( receiver: TirExpr, diff --git a/wado-compiler/src/synthesis/template.rs b/wado-compiler/src/synthesis/template.rs index f56c625ba..10740aa0c 100644 --- a/wado-compiler/src/synthesis/template.rs +++ b/wado-compiler/src/synthesis/template.rs @@ -423,12 +423,12 @@ fn build_template_block( receiver: Box::new(buf_ref), func: FunctionRef { module_source: ModuleSource::string(), - name: "String::append".to_string(), + name: "String::push_str".to_string(), monomorph_info: None, method_info: Some(LocalMethodName::new( "String".to_string(), None, - "append".to_string(), + "push_str".to_string(), )), is_cm_binding: false, }, @@ -467,12 +467,12 @@ fn build_template_block( receiver: Box::new(buf_ref), func: FunctionRef { module_source: ModuleSource::string(), - name: "String::append".to_string(), + name: "String::push_str".to_string(), monomorph_info: None, method_info: Some(LocalMethodName::new( "String".to_string(), None, - "append".to_string(), + "push_str".to_string(), )), is_cm_binding: false, }, diff --git a/wado-compiler/tests/fixtures.golden/allocator_debug_poison.wir.wado b/wado-compiler/tests/fixtures.golden/allocator_debug_poison.wir.wado index 32c775b87..f4c36aa82 100644 --- a/wado-compiler/tests/fixtures.golden/allocator_debug_poison.wir.wado +++ b/wado-compiler/tests/fixtures.golden/allocator_debug_poison.wir.wado @@ -72,9 +72,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -133,32 +133,32 @@ fn run() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_debug_poison.wado"), used: 56 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_debug_poison.wado"), used: 56 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_24 = __local_11; i32::fmt_decimal(8, __local_24); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: ptr1 > 0 "), used: 21 }); - String::append_char(__local_10, 112); - String::append_char(__local_10, 116); - String::append_char(__local_10, 114); - String::append_char(__local_10, 49); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 112); + String::push(__local_10, 116); + String::push(__local_10, 114); + String::push(__local_10, 49); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_29 = __local_11; i32::fmt_decimal(ptr1, __local_29); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -170,36 +170,36 @@ condition: ptr1 > 0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_debug_poison.wado"), used: 56 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_debug_poison.wado"), used: 56 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_35 = __local_15; i32::fmt_decimal(19, __local_35); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); - String::append(__local_14, __tmpl: block -> ref String { + String::push(__local_14, 58); + String::push(__local_14, 32); + String::push_str(__local_14, __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(59), used: 0 }; - String::append(__local_12, String { repr: array.new_data("expected poisoned memory (0xFFFFFFFF), got "), used: 43 }); + String::push_str(__local_12, String { repr: array.new_data("expected poisoned memory (0xFFFFFFFF), got "), used: 43 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(poisoned, __local_13); break __tmpl: __local_12; }); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: poisoned == -1 "), used: 27 }); - String::append(__local_14, String { repr: array.new_data("poisoned: "), used: 10 }); + String::push_str(__local_14, String { repr: array.new_data("poisoned: "), used: 10 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_46 = __local_15; i32::fmt_decimal(poisoned, __local_46); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -209,62 +209,62 @@ condition: poisoned == -1 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(162), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_debug_poison.wado"), used: 56 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_debug_poison.wado"), used: 56 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_52 = __local_19; i32::fmt_decimal(23, __local_52); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); - String::append(__local_18, __tmpl: block -> ref String { + String::push(__local_18, 58); + String::push(__local_18, 32); + String::push_str(__local_18, __tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(92), used: 0 }; - String::append(__local_16, String { repr: array.new_data("debug allocator should not reuse freed address: ptr1="), used: 53 }); + String::push_str(__local_16, String { repr: array.new_data("debug allocator should not reuse freed address: ptr1="), used: 53 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_58 = __local_17; i32::fmt_decimal(ptr1, __local_58); - String::append_char(__local_16, 44); - String::append_char(__local_16, 32); - String::append_char(__local_16, 112); - String::append_char(__local_16, 116); - String::append_char(__local_16, 114); - String::append_char(__local_16, 50); - String::append_char(__local_16, 61); + String::push(__local_16, 44); + String::push(__local_16, 32); + String::push(__local_16, 112); + String::push(__local_16, 116); + String::push(__local_16, 114); + String::push(__local_16, 50); + String::push(__local_16, 61); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_63 = __local_17; i32::fmt_decimal(ptr2, __local_63); break __tmpl: __local_16; }); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: ptr2 != ptr1 "), used: 25 }); - String::append_char(__local_18, 112); - String::append_char(__local_18, 116); - String::append_char(__local_18, 114); - String::append_char(__local_18, 50); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 112); + String::push(__local_18, 116); + String::push(__local_18, 114); + String::push(__local_18, 50); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_68 = __local_19; i32::fmt_decimal(ptr2, __local_68); - String::append_char(__local_18, 10); - String::append_char(__local_18, 112); - String::append_char(__local_18, 116); - String::append_char(__local_18, 114); - String::append_char(__local_18, 49); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 10); + String::push(__local_18, 112); + String::push(__local_18, 116); + String::push(__local_18, 114); + String::push(__local_18, 49); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_73 = __local_19; i32::fmt_decimal(ptr1, __local_73); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -504,7 +504,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -519,7 +519,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -557,7 +557,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -591,20 +591,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -614,10 +614,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -627,10 +627,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -638,10 +638,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/allocator_free_rewind.wir.wado b/wado-compiler/tests/fixtures.golden/allocator_free_rewind.wir.wado index 82c280130..07e1b0c3b 100644 --- a/wado-compiler/tests/fixtures.golden/allocator_free_rewind.wir.wado +++ b/wado-compiler/tests/fixtures.golden/allocator_free_rewind.wir.wado @@ -72,9 +72,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -138,42 +138,42 @@ fn run() with Stdout { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_free_rewind.wado"), used: 55 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_free_rewind.wado"), used: 55 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_28 = __local_15; i32::fmt_decimal(11, __local_28); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: ptr1 > base "), used: 24 }); - String::append_char(__local_14, 112); - String::append_char(__local_14, 116); - String::append_char(__local_14, 114); - String::append_char(__local_14, 49); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 112); + String::push(__local_14, 116); + String::push(__local_14, 114); + String::push(__local_14, 49); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_33 = __local_15; i32::fmt_decimal(ptr1, __local_33); - String::append_char(__local_14, 10); - String::append_char(__local_14, 98); - String::append_char(__local_14, 97); - String::append_char(__local_14, 115); - String::append_char(__local_14, 101); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 10); + String::push(__local_14, 98); + String::push(__local_14, 97); + String::push(__local_14, 115); + String::push(__local_14, 101); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_38 = __local_15; i32::fmt_decimal(base, __local_38); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -184,62 +184,62 @@ condition: ptr1 > base if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(162), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_free_rewind.wado"), used: 55 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_free_rewind.wado"), used: 55 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_44 = __local_19; i32::fmt_decimal(18, __local_44); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); - String::append(__local_18, __tmpl: block -> ref String { + String::push(__local_18, 58); + String::push(__local_18, 32); + String::push_str(__local_18, __tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(61), used: 0 }; - String::append(__local_16, String { repr: array.new_data("expected rewind: ptr1="), used: 22 }); + String::push_str(__local_16, String { repr: array.new_data("expected rewind: ptr1="), used: 22 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_50 = __local_17; i32::fmt_decimal(ptr1, __local_50); - String::append_char(__local_16, 44); - String::append_char(__local_16, 32); - String::append_char(__local_16, 112); - String::append_char(__local_16, 116); - String::append_char(__local_16, 114); - String::append_char(__local_16, 50); - String::append_char(__local_16, 61); + String::push(__local_16, 44); + String::push(__local_16, 32); + String::push(__local_16, 112); + String::push(__local_16, 116); + String::push(__local_16, 114); + String::push(__local_16, 50); + String::push(__local_16, 61); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_55 = __local_17; i32::fmt_decimal(ptr2, __local_55); break __tmpl: __local_16; }); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: ptr2 == ptr1 "), used: 25 }); - String::append_char(__local_18, 112); - String::append_char(__local_18, 116); - String::append_char(__local_18, 114); - String::append_char(__local_18, 50); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 112); + String::push(__local_18, 116); + String::push(__local_18, 114); + String::push(__local_18, 50); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_60 = __local_19; i32::fmt_decimal(ptr2, __local_60); - String::append_char(__local_18, 10); - String::append_char(__local_18, 112); - String::append_char(__local_18, 116); - String::append_char(__local_18, 114); - String::append_char(__local_18, 49); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 10); + String::push(__local_18, 112); + String::push(__local_18, 116); + String::push(__local_18, 114); + String::push(__local_18, 49); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_65 = __local_19; i32::fmt_decimal(ptr1, __local_65); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -257,49 +257,49 @@ condition: ptr2 == ptr1 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_free_rewind.wado"), used: 55 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_free_rewind.wado"), used: 55 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_71 = __local_23; i32::fmt_decimal(28, __local_71); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); - String::append(__local_22, __tmpl: block -> ref String { + String::push(__local_22, 58); + String::push(__local_22, 32); + String::push_str(__local_22, __tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(54), used: 0 }; - String::append(__local_20, String { repr: array.new_data("loop iteration "), used: 15 }); + String::push_str(__local_20, String { repr: array.new_data("loop iteration "), used: 15 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(i, __local_21); - String::append(__local_20, String { repr: array.new_data(": expected same address"), used: 23 }); + String::push_str(__local_20, String { repr: array.new_data(": expected same address"), used: 23 }); break __tmpl: __local_20; }); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: p == ptr2 "), used: 22 }); - String::append_char(__local_22, 112); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); + String::push(__local_22, 112); + String::push(__local_22, 58); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_82 = __local_23; i32::fmt_decimal(p, __local_82); - String::append_char(__local_22, 10); - String::append_char(__local_22, 112); - String::append_char(__local_22, 116); - String::append_char(__local_22, 114); - String::append_char(__local_22, 50); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); + String::push(__local_22, 10); + String::push(__local_22, 112); + String::push(__local_22, 116); + String::push(__local_22, 114); + String::push(__local_22, 50); + String::push(__local_22, 58); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_87 = __local_23; i32::fmt_decimal(ptr2, __local_87); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -545,7 +545,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -560,7 +560,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -598,7 +598,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l30; }; @@ -632,20 +632,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -655,10 +655,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -668,10 +668,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -679,10 +679,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/allocator_grow.wir.wado b/wado-compiler/tests/fixtures.golden/allocator_grow.wir.wado index a82d6bfa6..b44b26584 100644 --- a/wado-compiler/tests/fixtures.golden/allocator_grow.wir.wado +++ b/wado-compiler/tests/fixtures.golden/allocator_grow.wir.wado @@ -76,9 +76,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -118,29 +118,29 @@ fn allocator_grow_large() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("allocator_grow_large"), used: 20 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_grow.wado"), used: 48 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("allocator_grow_large"), used: 20 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_grow.wado"), used: 48 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_9 = __local_5; i32::fmt_decimal(8, __local_9); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: ptr >= 0 "), used: 21 }); - String::append_char(__local_4, 112); - String::append_char(__local_4, 116); - String::append_char(__local_4, 114); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 112); + String::push(__local_4, 116); + String::push(__local_4, 114); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_14 = __local_5; i32::fmt_decimal(ptr, __local_14); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -168,29 +168,29 @@ fn allocator_grow_repeated() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("allocator_grow_repeated"), used: 23 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_grow.wado"), used: 48 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("allocator_grow_repeated"), used: 23 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/allocator_grow.wado"), used: 48 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_10 = __local_6; i32::fmt_decimal(17, __local_10); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: ptr >= 0 "), used: 21 }); - String::append_char(__local_5, 112); - String::append_char(__local_5, 116); - String::append_char(__local_5, 114); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 112); + String::push(__local_5, 116); + String::push(__local_5, 114); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_15 = __local_6; i32::fmt_decimal(ptr, __local_15); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -441,7 +441,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -456,7 +456,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -494,7 +494,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l29; }; @@ -528,20 +528,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -551,10 +551,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -564,10 +564,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -575,10 +575,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/anon_struct_basic.wir.wado b/wado-compiler/tests/fixtures.golden/anon_struct_basic.wir.wado index 566fa5f87..a457a125e 100644 --- a/wado-compiler/tests/fixtures.golden/anon_struct_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/anon_struct_basic.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -103,8 +103,8 @@ fn run() with Stdout { __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_7 = __local_2; i32::fmt_decimal(1, __local_7); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_12 = __local_2; i32::fmt_decimal(2, __local_12); @@ -307,7 +307,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -322,7 +322,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -360,7 +360,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -394,20 +394,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -417,10 +417,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -430,10 +430,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -441,10 +441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/anon_struct_nested.wir.wado b/wado-compiler/tests/fixtures.golden/anon_struct_nested.wir.wado index e23a02848..d130318d4 100644 --- a/wado-compiler/tests/fixtures.golden/anon_struct_nested.wir.wado +++ b/wado-compiler/tests/fixtures.golden/anon_struct_nested.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -105,20 +105,20 @@ fn run() with Stdout { __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_7 = __local_2; i32::fmt_decimal(0, __local_7); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_12 = __local_2; i32::fmt_decimal(0, __local_12); - String::append_char(__local_1, 32); - String::append_char(__local_1, 45); - String::append_char(__local_1, 62); - String::append_char(__local_1, 32); + String::push(__local_1, 32); + String::push(__local_1, 45); + String::push(__local_1, 62); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_17 = __local_2; i32::fmt_decimal(10, __local_17); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_22 = __local_2; i32::fmt_decimal(20, __local_22); @@ -321,7 +321,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -336,7 +336,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -374,7 +374,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -408,20 +408,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -431,10 +431,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -444,10 +444,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -455,10 +455,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/anon_struct_shorthand.wir.wado b/wado-compiler/tests/fixtures.golden/anon_struct_shorthand.wir.wado index b849dd190..8784f55de 100644 --- a/wado-compiler/tests/fixtures.golden/anon_struct_shorthand.wir.wado +++ b/wado-compiler/tests/fixtures.golden/anon_struct_shorthand.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -103,8 +103,8 @@ fn run() with Stdout { __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(10, __local_9); - String::append_char(__local_3, 44); - String::append_char(__local_3, 32); + String::push(__local_3, 44); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; i32::fmt_decimal(20, __local_14); @@ -307,7 +307,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -322,7 +322,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -360,7 +360,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -394,20 +394,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -417,10 +417,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -430,10 +430,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -441,10 +441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/anon_struct_structural_eq.wir.wado b/wado-compiler/tests/fixtures.golden/anon_struct_structural_eq.wir.wado index 6c8e7a988..437256889 100644 --- a/wado-compiler/tests/fixtures.golden/anon_struct_structural_eq.wir.wado +++ b/wado-compiler/tests/fixtures.golden/anon_struct_structural_eq.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -103,8 +103,8 @@ fn run() with Stdout { __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(1, __local_9); - String::append_char(__local_3, 44); - String::append_char(__local_3, 32); + String::push(__local_3, 44); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; i32::fmt_decimal(2, __local_14); @@ -307,7 +307,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -322,7 +322,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -360,7 +360,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -394,20 +394,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -417,10 +417,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -430,10 +430,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -441,10 +441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/anon_struct_various_types.wir.wado b/wado-compiler/tests/fixtures.golden/anon_struct_various_types.wir.wado index a9dd39829..4d12f5e03 100644 --- a/wado-compiler/tests/fixtures.golden/anon_struct_various_types.wir.wado +++ b/wado-compiler/tests/fixtures.golden/anon_struct_various_types.wir.wado @@ -111,9 +111,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -212,8 +212,8 @@ fn run() with Stdout { __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_52 = __local_19; i32::fmt_decimal(__sroa_s_g.0, __local_52); - String::append_char(__local_18, 44); - String::append_char(__local_18, 32); + String::push(__local_18, 44); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_57 = __local_19; Formatter::pad(__local_57, if __sroa_s_g.1 -> ref String { @@ -221,9 +221,9 @@ fn run() with Stdout { } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_18, 44); - String::append_char(__local_18, 32); - String::append(__local_18, __sroa_s_g.2); + String::push(__local_18, 44); + String::push(__local_18, 32); + String::push_str(__local_18, __sroa_s_g.2); break __tmpl: __local_18; }); } @@ -699,10 +699,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -741,7 +741,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -756,7 +756,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -794,7 +794,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l56; }; @@ -814,7 +814,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -822,17 +822,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -862,20 +862,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -885,10 +885,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -898,10 +898,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -909,10 +909,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_append_collapse.wir.wado b/wado-compiler/tests/fixtures.golden/array_append_collapse.wir.wado index 60d8db08b..dcadc1a64 100644 --- a/wado-compiler/tests/fixtures.golden/array_append_collapse.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_append_collapse.wir.wado @@ -103,23 +103,23 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i64); +type "functype/Array::push" = fn(ref Array, i64); type "functype/Array::grow" = fn(ref Array); @@ -294,27 +294,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_52 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_52, 114); - String::append_char(__local_52, 117); - String::append_char(__local_52, 110); - String::append_char(__local_52, 32); - String::append_char(__local_52, 97); - String::append_char(__local_52, 116); - String::append_char(__local_52, 32); - String::append(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_52, 58); + String::push_str(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_52, 114); + String::push(__local_52, 117); + String::push(__local_52, 110); + String::push(__local_52, 32); + String::push(__local_52, 97); + String::push(__local_52, 116); + String::push(__local_52, 32); + String::push_str(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_52, 58); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_104 = __local_53; i32::fmt_decimal(8, __local_104); - String::append(__local_52, String { repr: array.new_data(" + String::push_str(__local_52, String { repr: array.new_data(" condition: a.len() == 3 "), used: 25 }); - String::append(__local_52, String { repr: array.new_data("a.len(): "), used: 9 }); + String::push_str(__local_52, String { repr: array.new_data("a.len(): "), used: 9 }); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_109 = __local_53; i32::fmt_decimal(__v0_2, __local_109); - String::append_char(__local_52, 10); + String::push(__local_52, 10); break __tmpl: __local_52; }); unreachable; @@ -330,32 +330,32 @@ condition: a.len() == 3 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_54 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_54, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_54, 114); - String::append_char(__local_54, 117); - String::append_char(__local_54, 110); - String::append_char(__local_54, 32); - String::append_char(__local_54, 97); - String::append_char(__local_54, 116); - String::append_char(__local_54, 32); - String::append(__local_54, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_54, 58); + String::push_str(__local_54, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_54, 114); + String::push(__local_54, 117); + String::push(__local_54, 110); + String::push(__local_54, 32); + String::push(__local_54, 97); + String::push(__local_54, 116); + String::push(__local_54, 32); + String::push_str(__local_54, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_54, 58); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_117 = __local_55; i32::fmt_decimal(9, __local_117); - String::append(__local_54, String { repr: array.new_data(" + String::push_str(__local_54, String { repr: array.new_data(" condition: a[0] == 10 "), used: 23 }); - String::append_char(__local_54, 97); - String::append_char(__local_54, 91); - String::append_char(__local_54, 48); - String::append_char(__local_54, 93); - String::append_char(__local_54, 58); - String::append_char(__local_54, 32); + String::push(__local_54, 97); + String::push(__local_54, 91); + String::push(__local_54, 48); + String::push(__local_54, 93); + String::push(__local_54, 58); + String::push(__local_54, 32); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_122 = __local_55; i32::fmt_decimal(__v0_4, __local_122); - String::append_char(__local_54, 10); + String::push(__local_54, 10); break __tmpl: __local_54; }); unreachable; @@ -371,32 +371,32 @@ condition: a[0] == 10 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_56 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_56, 114); - String::append_char(__local_56, 117); - String::append_char(__local_56, 110); - String::append_char(__local_56, 32); - String::append_char(__local_56, 97); - String::append_char(__local_56, 116); - String::append_char(__local_56, 32); - String::append(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_56, 58); + String::push_str(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_56, 114); + String::push(__local_56, 117); + String::push(__local_56, 110); + String::push(__local_56, 32); + String::push(__local_56, 97); + String::push(__local_56, 116); + String::push(__local_56, 32); + String::push_str(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_56, 58); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_130 = __local_57; i32::fmt_decimal(10, __local_130); - String::append(__local_56, String { repr: array.new_data(" + String::push_str(__local_56, String { repr: array.new_data(" condition: a[1] == 20 "), used: 23 }); - String::append_char(__local_56, 97); - String::append_char(__local_56, 91); - String::append_char(__local_56, 49); - String::append_char(__local_56, 93); - String::append_char(__local_56, 58); - String::append_char(__local_56, 32); + String::push(__local_56, 97); + String::push(__local_56, 91); + String::push(__local_56, 49); + String::push(__local_56, 93); + String::push(__local_56, 58); + String::push(__local_56, 32); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_135 = __local_57; i32::fmt_decimal(__v0_6, __local_135); - String::append_char(__local_56, 10); + String::push(__local_56, 10); break __tmpl: __local_56; }); unreachable; @@ -412,32 +412,32 @@ condition: a[1] == 20 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_58 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_58, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_58, 114); - String::append_char(__local_58, 117); - String::append_char(__local_58, 110); - String::append_char(__local_58, 32); - String::append_char(__local_58, 97); - String::append_char(__local_58, 116); - String::append_char(__local_58, 32); - String::append(__local_58, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_58, 58); + String::push_str(__local_58, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_58, 114); + String::push(__local_58, 117); + String::push(__local_58, 110); + String::push(__local_58, 32); + String::push(__local_58, 97); + String::push(__local_58, 116); + String::push(__local_58, 32); + String::push_str(__local_58, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_58, 58); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; __local_143 = __local_59; i32::fmt_decimal(11, __local_143); - String::append(__local_58, String { repr: array.new_data(" + String::push_str(__local_58, String { repr: array.new_data(" condition: a[2] == 30 "), used: 23 }); - String::append_char(__local_58, 97); - String::append_char(__local_58, 91); - String::append_char(__local_58, 50); - String::append_char(__local_58, 93); - String::append_char(__local_58, 58); - String::append_char(__local_58, 32); + String::push(__local_58, 97); + String::push(__local_58, 91); + String::push(__local_58, 50); + String::push(__local_58, 93); + String::push(__local_58, 58); + String::push(__local_58, 32); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; __local_148 = __local_59; i32::fmt_decimal(__v0_8, __local_148); - String::append_char(__local_58, 10); + String::push(__local_58, 10); break __tmpl: __local_58; }); unreachable; @@ -451,27 +451,27 @@ condition: a[2] == 30 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_60 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_60, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_60, 114); - String::append_char(__local_60, 117); - String::append_char(__local_60, 110); - String::append_char(__local_60, 32); - String::append_char(__local_60, 97); - String::append_char(__local_60, 116); - String::append_char(__local_60, 32); - String::append(__local_60, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_60, 58); + String::push_str(__local_60, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_60, 114); + String::push(__local_60, 117); + String::push(__local_60, 110); + String::push(__local_60, 32); + String::push(__local_60, 97); + String::push(__local_60, 116); + String::push(__local_60, 32); + String::push_str(__local_60, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_60, 58); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; __local_162 = __local_61; i32::fmt_decimal(15, __local_162); - String::append(__local_60, String { repr: array.new_data(" + String::push_str(__local_60, String { repr: array.new_data(" condition: b.len() == 2 "), used: 25 }); - String::append(__local_60, String { repr: array.new_data("b.len(): "), used: 9 }); + String::push_str(__local_60, String { repr: array.new_data("b.len(): "), used: 9 }); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; __local_167 = __local_61; i32::fmt_decimal(__v0_12, __local_167); - String::append_char(__local_60, 10); + String::push(__local_60, 10); break __tmpl: __local_60; }); unreachable; @@ -487,32 +487,32 @@ condition: b.len() == 2 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_62 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_62, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_62, 114); - String::append_char(__local_62, 117); - String::append_char(__local_62, 110); - String::append_char(__local_62, 32); - String::append_char(__local_62, 97); - String::append_char(__local_62, 116); - String::append_char(__local_62, 32); - String::append(__local_62, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_62, 58); + String::push_str(__local_62, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_62, 114); + String::push(__local_62, 117); + String::push(__local_62, 110); + String::push(__local_62, 32); + String::push(__local_62, 97); + String::push(__local_62, 116); + String::push(__local_62, 32); + String::push_str(__local_62, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_62, 58); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; __local_175 = __local_63; i32::fmt_decimal(16, __local_175); - String::append(__local_62, String { repr: array.new_data(" + String::push_str(__local_62, String { repr: array.new_data(" condition: b[0] == 100 "), used: 24 }); - String::append_char(__local_62, 98); - String::append_char(__local_62, 91); - String::append_char(__local_62, 48); - String::append_char(__local_62, 93); - String::append_char(__local_62, 58); - String::append_char(__local_62, 32); + String::push(__local_62, 98); + String::push(__local_62, 91); + String::push(__local_62, 48); + String::push(__local_62, 93); + String::push(__local_62, 58); + String::push(__local_62, 32); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; __local_180 = __local_63; i32::fmt_decimal(__v0_14, __local_180); - String::append_char(__local_62, 10); + String::push(__local_62, 10); break __tmpl: __local_62; }); unreachable; @@ -528,32 +528,32 @@ condition: b[0] == 100 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_64 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_64, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_64, 114); - String::append_char(__local_64, 117); - String::append_char(__local_64, 110); - String::append_char(__local_64, 32); - String::append_char(__local_64, 97); - String::append_char(__local_64, 116); - String::append_char(__local_64, 32); - String::append(__local_64, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_64, 58); + String::push_str(__local_64, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_64, 114); + String::push(__local_64, 117); + String::push(__local_64, 110); + String::push(__local_64, 32); + String::push(__local_64, 97); + String::push(__local_64, 116); + String::push(__local_64, 32); + String::push_str(__local_64, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_64, 58); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; __local_188 = __local_65; i32::fmt_decimal(17, __local_188); - String::append(__local_64, String { repr: array.new_data(" + String::push_str(__local_64, String { repr: array.new_data(" condition: b[1] == 200 "), used: 24 }); - String::append_char(__local_64, 98); - String::append_char(__local_64, 91); - String::append_char(__local_64, 49); - String::append_char(__local_64, 93); - String::append_char(__local_64, 58); - String::append_char(__local_64, 32); + String::push(__local_64, 98); + String::push(__local_64, 91); + String::push(__local_64, 49); + String::push(__local_64, 93); + String::push(__local_64, 58); + String::push(__local_64, 32); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; __local_193 = __local_65; i32::fmt_decimal(__v0_16, __local_193); - String::append_char(__local_64, 10); + String::push(__local_64, 10); break __tmpl: __local_64; }); unreachable; @@ -567,27 +567,27 @@ condition: b[1] == 200 if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_66 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_66, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_66, 114); - String::append_char(__local_66, 117); - String::append_char(__local_66, 110); - String::append_char(__local_66, 32); - String::append_char(__local_66, 97); - String::append_char(__local_66, 116); - String::append_char(__local_66, 32); - String::append(__local_66, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_66, 58); + String::push_str(__local_66, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_66, 114); + String::push(__local_66, 117); + String::push(__local_66, 110); + String::push(__local_66, 32); + String::push(__local_66, 97); + String::push(__local_66, 116); + String::push(__local_66, 32); + String::push_str(__local_66, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_66, 58); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; __local_203 = __local_67; i32::fmt_decimal(21, __local_203); - String::append(__local_66, String { repr: array.new_data(" + String::push_str(__local_66, String { repr: array.new_data(" condition: c.len() == 0 "), used: 25 }); - String::append(__local_66, String { repr: array.new_data("c.len(): "), used: 9 }); + String::push_str(__local_66, String { repr: array.new_data("c.len(): "), used: 9 }); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; __local_208 = __local_67; i32::fmt_decimal(__v0_20, __local_208); - String::append_char(__local_66, 10); + String::push(__local_66, 10); break __tmpl: __local_66; }); unreachable; @@ -601,27 +601,27 @@ condition: c.len() == 0 if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_68 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_68, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_68, 114); - String::append_char(__local_68, 117); - String::append_char(__local_68, 110); - String::append_char(__local_68, 32); - String::append_char(__local_68, 97); - String::append_char(__local_68, 116); - String::append_char(__local_68, 32); - String::append(__local_68, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_68, 58); + String::push_str(__local_68, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_68, 114); + String::push(__local_68, 117); + String::push(__local_68, 110); + String::push(__local_68, 32); + String::push(__local_68, 97); + String::push(__local_68, 116); + String::push(__local_68, 32); + String::push_str(__local_68, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_68, 58); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; __local_220 = __local_69; i32::fmt_decimal(25, __local_220); - String::append(__local_68, String { repr: array.new_data(" + String::push_str(__local_68, String { repr: array.new_data(" condition: d.len() == 1 "), used: 25 }); - String::append(__local_68, String { repr: array.new_data("d.len(): "), used: 9 }); + String::push_str(__local_68, String { repr: array.new_data("d.len(): "), used: 9 }); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; __local_225 = __local_69; i32::fmt_decimal(__v0_24, __local_225); - String::append_char(__local_68, 10); + String::push(__local_68, 10); break __tmpl: __local_68; }); unreachable; @@ -637,32 +637,32 @@ condition: d.len() == 1 if __cond_27 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_70 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_70, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_70, 114); - String::append_char(__local_70, 117); - String::append_char(__local_70, 110); - String::append_char(__local_70, 32); - String::append_char(__local_70, 97); - String::append_char(__local_70, 116); - String::append_char(__local_70, 32); - String::append(__local_70, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_70, 58); + String::push_str(__local_70, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_70, 114); + String::push(__local_70, 117); + String::push(__local_70, 110); + String::push(__local_70, 32); + String::push(__local_70, 97); + String::push(__local_70, 116); + String::push(__local_70, 32); + String::push_str(__local_70, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_70, 58); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; __local_233 = __local_71; i32::fmt_decimal(26, __local_233); - String::append(__local_70, String { repr: array.new_data(" + String::push_str(__local_70, String { repr: array.new_data(" condition: d[0] == 42 "), used: 23 }); - String::append_char(__local_70, 100); - String::append_char(__local_70, 91); - String::append_char(__local_70, 48); - String::append_char(__local_70, 93); - String::append_char(__local_70, 58); - String::append_char(__local_70, 32); + String::push(__local_70, 100); + String::push(__local_70, 91); + String::push(__local_70, 48); + String::push(__local_70, 93); + String::push(__local_70, 58); + String::push(__local_70, 32); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; __local_238 = __local_71; i32::fmt_decimal(__v0_26, __local_238); - String::append_char(__local_70, 10); + String::push(__local_70, 10); break __tmpl: __local_70; }); unreachable; @@ -676,27 +676,27 @@ condition: d[0] == 42 if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_72 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_72, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_72, 114); - String::append_char(__local_72, 117); - String::append_char(__local_72, 110); - String::append_char(__local_72, 32); - String::append_char(__local_72, 97); - String::append_char(__local_72, 116); - String::append_char(__local_72, 32); - String::append(__local_72, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_72, 58); + String::push_str(__local_72, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_72, 114); + String::push(__local_72, 117); + String::push(__local_72, 110); + String::push(__local_72, 32); + String::push(__local_72, 97); + String::push(__local_72, 116); + String::push(__local_72, 32); + String::push_str(__local_72, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_72, 58); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; __local_254 = __local_73; i32::fmt_decimal(30, __local_254); - String::append(__local_72, String { repr: array.new_data(" + String::push_str(__local_72, String { repr: array.new_data(" condition: e.len() == 3 "), used: 25 }); - String::append(__local_72, String { repr: array.new_data("e.len(): "), used: 9 }); + String::push_str(__local_72, String { repr: array.new_data("e.len(): "), used: 9 }); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; __local_259 = __local_73; i32::fmt_decimal(__v0_30, __local_259); - String::append_char(__local_72, 10); + String::push(__local_72, 10); break __tmpl: __local_72; }); unreachable; @@ -712,32 +712,32 @@ condition: e.len() == 3 if __cond_33 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_74 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_74, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_74, 114); - String::append_char(__local_74, 117); - String::append_char(__local_74, 110); - String::append_char(__local_74, 32); - String::append_char(__local_74, 97); - String::append_char(__local_74, 116); - String::append_char(__local_74, 32); - String::append(__local_74, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_74, 58); + String::push_str(__local_74, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_74, 114); + String::push(__local_74, 117); + String::push(__local_74, 110); + String::push(__local_74, 32); + String::push(__local_74, 97); + String::push(__local_74, 116); + String::push(__local_74, 32); + String::push_str(__local_74, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_74, 58); __local_75 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_74 }; __local_267 = __local_75; i32::fmt_decimal(31, __local_267); - String::append(__local_74, String { repr: array.new_data(" + String::push_str(__local_74, String { repr: array.new_data(" condition: e[0] == 1 "), used: 22 }); - String::append_char(__local_74, 101); - String::append_char(__local_74, 91); - String::append_char(__local_74, 48); - String::append_char(__local_74, 93); - String::append_char(__local_74, 58); - String::append_char(__local_74, 32); + String::push(__local_74, 101); + String::push(__local_74, 91); + String::push(__local_74, 48); + String::push(__local_74, 93); + String::push(__local_74, 58); + String::push(__local_74, 32); __local_75 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_74 }; __local_272 = __local_75; i64::fmt_decimal(__v0_32, __local_272); - String::append_char(__local_74, 10); + String::push(__local_74, 10); break __tmpl: __local_74; }); unreachable; @@ -751,27 +751,27 @@ condition: e[0] == 1 if __cond_37 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_76 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_76, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_76, 114); - String::append_char(__local_76, 117); - String::append_char(__local_76, 110); - String::append_char(__local_76, 32); - String::append_char(__local_76, 97); - String::append_char(__local_76, 116); - String::append_char(__local_76, 32); - String::append(__local_76, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_76, 58); + String::push_str(__local_76, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_76, 114); + String::push(__local_76, 117); + String::push(__local_76, 110); + String::push(__local_76, 32); + String::push(__local_76, 97); + String::push(__local_76, 116); + String::push(__local_76, 32); + String::push_str(__local_76, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_76, 58); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_76 }; __local_286 = __local_77; i32::fmt_decimal(35, __local_286); - String::append(__local_76, String { repr: array.new_data(" + String::push_str(__local_76, String { repr: array.new_data(" condition: f.len() == 2 "), used: 25 }); - String::append(__local_76, String { repr: array.new_data("f.len(): "), used: 9 }); + String::push_str(__local_76, String { repr: array.new_data("f.len(): "), used: 9 }); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_76 }; __local_291 = __local_77; i32::fmt_decimal(__v0_36, __local_291); - String::append_char(__local_76, 10); + String::push(__local_76, 10); break __tmpl: __local_76; }); unreachable; @@ -787,31 +787,31 @@ condition: f.len() == 2 if __cond_39 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_78 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_78, 114); - String::append_char(__local_78, 117); - String::append_char(__local_78, 110); - String::append_char(__local_78, 32); - String::append_char(__local_78, 97); - String::append_char(__local_78, 116); - String::append_char(__local_78, 32); - String::append(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_78, 58); + String::push_str(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_78, 114); + String::push(__local_78, 117); + String::push(__local_78, 110); + String::push(__local_78, 32); + String::push(__local_78, 97); + String::push(__local_78, 116); + String::push(__local_78, 32); + String::push_str(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_78, 58); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; __local_299 = __local_79; i32::fmt_decimal(36, __local_299); - String::append(__local_78, String { repr: array.new_data(" + String::push_str(__local_78, String { repr: array.new_data(" condition: f[0] == \"hello\" "), used: 28 }); - String::append_char(__local_78, 102); - String::append_char(__local_78, 91); - String::append_char(__local_78, 48); - String::append_char(__local_78, 93); - String::append_char(__local_78, 58); - String::append_char(__local_78, 32); + String::push(__local_78, 102); + String::push(__local_78, 91); + String::push(__local_78, 48); + String::push(__local_78, 93); + String::push(__local_78, 58); + String::push(__local_78, 32); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; String^Inspect::inspect(__v0_38, __local_79); - String::append_char(__local_78, 10); + String::push(__local_78, 10); break __tmpl: __local_78; }); unreachable; @@ -827,31 +827,31 @@ condition: f[0] == \"hello\" if __cond_41 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_80 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_80, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_80, 114); - String::append_char(__local_80, 117); - String::append_char(__local_80, 110); - String::append_char(__local_80, 32); - String::append_char(__local_80, 97); - String::append_char(__local_80, 116); - String::append_char(__local_80, 32); - String::append(__local_80, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_80, 58); + String::push_str(__local_80, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_80, 114); + String::push(__local_80, 117); + String::push(__local_80, 110); + String::push(__local_80, 32); + String::push(__local_80, 97); + String::push(__local_80, 116); + String::push(__local_80, 32); + String::push_str(__local_80, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_80, 58); __local_81 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_80 }; __local_308 = __local_81; i32::fmt_decimal(37, __local_308); - String::append(__local_80, String { repr: array.new_data(" + String::push_str(__local_80, String { repr: array.new_data(" condition: f[1] == \"world\" "), used: 28 }); - String::append_char(__local_80, 102); - String::append_char(__local_80, 91); - String::append_char(__local_80, 49); - String::append_char(__local_80, 93); - String::append_char(__local_80, 58); - String::append_char(__local_80, 32); + String::push(__local_80, 102); + String::push(__local_80, 91); + String::push(__local_80, 49); + String::push(__local_80, 93); + String::push(__local_80, 58); + String::push(__local_80, 32); __local_81 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_80 }; String^Inspect::inspect(__v0_40, __local_81); - String::append_char(__local_80, 10); + String::push(__local_80, 10); break __tmpl: __local_80; }); unreachable; @@ -868,27 +868,27 @@ condition: f[1] == \"world\" if __cond_45 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_82 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_82, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_82, 114); - String::append_char(__local_82, 117); - String::append_char(__local_82, 110); - String::append_char(__local_82, 32); - String::append_char(__local_82, 97); - String::append_char(__local_82, 116); - String::append_char(__local_82, 32); - String::append(__local_82, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_82, 58); + String::push_str(__local_82, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_82, 114); + String::push(__local_82, 117); + String::push(__local_82, 110); + String::push(__local_82, 32); + String::push(__local_82, 97); + String::push(__local_82, 116); + String::push(__local_82, 32); + String::push_str(__local_82, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_82, 58); __local_83 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_82 }; __local_325 = __local_83; i32::fmt_decimal(41, __local_325); - String::append(__local_82, String { repr: array.new_data(" + String::push_str(__local_82, String { repr: array.new_data(" condition: g.items.len() == 3 "), used: 31 }); - String::append(__local_82, String { repr: array.new_data("g.items.len(): "), used: 15 }); + String::push_str(__local_82, String { repr: array.new_data("g.items.len(): "), used: 15 }); __local_83 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_82 }; __local_330 = __local_83; i32::fmt_decimal(__v0_44, __local_330); - String::append_char(__local_82, 10); + String::push(__local_82, 10); break __tmpl: __local_82; }); unreachable; @@ -905,27 +905,27 @@ condition: g.items.len() == 3 if __cond_47 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_84 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_84, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_84, 114); - String::append_char(__local_84, 117); - String::append_char(__local_84, 110); - String::append_char(__local_84, 32); - String::append_char(__local_84, 97); - String::append_char(__local_84, 116); - String::append_char(__local_84, 32); - String::append(__local_84, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_84, 58); + String::push_str(__local_84, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_84, 114); + String::push(__local_84, 117); + String::push(__local_84, 110); + String::push(__local_84, 32); + String::push(__local_84, 97); + String::push(__local_84, 116); + String::push(__local_84, 32); + String::push_str(__local_84, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_84, 58); __local_85 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_84 }; __local_338 = __local_85; i32::fmt_decimal(42, __local_338); - String::append(__local_84, String { repr: array.new_data(" + String::push_str(__local_84, String { repr: array.new_data(" condition: g.items[0] == 5 "), used: 28 }); - String::append(__local_84, String { repr: array.new_data("g.items[0]: "), used: 12 }); + String::push_str(__local_84, String { repr: array.new_data("g.items[0]: "), used: 12 }); __local_85 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_84 }; __local_343 = __local_85; i32::fmt_decimal(__v0_46, __local_343); - String::append_char(__local_84, 10); + String::push(__local_84, 10); break __tmpl: __local_84; }); unreachable; @@ -942,27 +942,27 @@ condition: g.items[0] == 5 if __cond_49 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_86 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_86, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_86, 114); - String::append_char(__local_86, 117); - String::append_char(__local_86, 110); - String::append_char(__local_86, 32); - String::append_char(__local_86, 97); - String::append_char(__local_86, 116); - String::append_char(__local_86, 32); - String::append(__local_86, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_86, 58); + String::push_str(__local_86, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_86, 114); + String::push(__local_86, 117); + String::push(__local_86, 110); + String::push(__local_86, 32); + String::push(__local_86, 97); + String::push(__local_86, 116); + String::push(__local_86, 32); + String::push_str(__local_86, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_86, 58); __local_87 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_86 }; __local_351 = __local_87; i32::fmt_decimal(43, __local_351); - String::append(__local_86, String { repr: array.new_data(" + String::push_str(__local_86, String { repr: array.new_data(" condition: g.items[1] == 10 "), used: 29 }); - String::append(__local_86, String { repr: array.new_data("g.items[1]: "), used: 12 }); + String::push_str(__local_86, String { repr: array.new_data("g.items[1]: "), used: 12 }); __local_87 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_86 }; __local_356 = __local_87; i32::fmt_decimal(__v0_48, __local_356); - String::append_char(__local_86, 10); + String::push(__local_86, 10); break __tmpl: __local_86; }); unreachable; @@ -979,27 +979,27 @@ condition: g.items[1] == 10 if __cond_51 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_88 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_88, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_88, 114); - String::append_char(__local_88, 117); - String::append_char(__local_88, 110); - String::append_char(__local_88, 32); - String::append_char(__local_88, 97); - String::append_char(__local_88, 116); - String::append_char(__local_88, 32); - String::append(__local_88, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); - String::append_char(__local_88, 58); + String::push_str(__local_88, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_88, 114); + String::push(__local_88, 117); + String::push(__local_88, 110); + String::push(__local_88, 32); + String::push(__local_88, 97); + String::push(__local_88, 116); + String::push(__local_88, 32); + String::push_str(__local_88, String { repr: array.new_data("wado-compiler/tests/fixtures/array_append_collapse.wado"), used: 55 }); + String::push(__local_88, 58); __local_89 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_88 }; __local_364 = __local_89; i32::fmt_decimal(44, __local_364); - String::append(__local_88, String { repr: array.new_data(" + String::push_str(__local_88, String { repr: array.new_data(" condition: g.items[2] == 15 "), used: 29 }); - String::append(__local_88, String { repr: array.new_data("g.items[2]: "), used: 12 }); + String::push_str(__local_88, String { repr: array.new_data("g.items[2]: "), used: 12 }); __local_89 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_88 }; __local_369 = __local_89; i32::fmt_decimal(__v0_50, __local_369); - String::append_char(__local_88, 10); + String::push(__local_88, 10); break __tmpl: __local_88; }); unreachable; @@ -1278,7 +1278,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1366,7 +1366,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1393,7 +1393,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1435,7 +1435,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1477,7 +1477,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1530,7 +1530,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l78; }; @@ -1564,20 +1564,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1587,10 +1587,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1600,10 +1600,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1611,10 +1611,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1626,7 +1626,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1643,22 +1643,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b97; @@ -1666,7 +1666,7 @@ fn String^Inspect::inspect(self, f) { continue l98; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/array_bounds.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds.wir.wado index 43710b633..a8d019fa3 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds.wir.wado @@ -83,11 +83,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -142,8 +142,8 @@ fn array_bounds_check() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_9: builtin::array_get(arr.repr, 0); }, __local_18); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_25 = __local_3; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_13: block -> i32 { @@ -153,8 +153,8 @@ fn array_bounds_check() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_13: builtin::array_get(arr.repr, 1); }, __local_25); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_32 = __local_3; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_17: block -> i32 { @@ -237,29 +237,29 @@ fn array_bounds_elim_redundant() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("array_bounds_elim_redundant"), used: 27 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds.wado"), used: 46 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("array_bounds_elim_redundant"), used: 27 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds.wado"), used: 46 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_29 = __local_9; i32::fmt_decimal(26, __local_29); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: sum == 120 "), used: 23 }); - String::append_char(__local_8, 115); - String::append_char(__local_8, 117); - String::append_char(__local_8, 109); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 115); + String::push(__local_8, 117); + String::push(__local_8, 109); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_34 = __local_9; i32::fmt_decimal(__v0, __local_34); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -510,7 +510,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -525,7 +525,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -552,7 +552,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -605,7 +605,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l37; }; @@ -639,20 +639,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -662,10 +662,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -675,10 +675,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -686,10 +686,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_check_negative.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_check_negative.wir.wado index 2728be0e6..923891580 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_check_negative.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_check_negative.wir.wado @@ -50,7 +50,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -184,7 +184,7 @@ fn "core:internal/cm_stream_write_raw_u8"(handle, data, len) { // from core:int drop("mem/realloc"(ptr, raw_len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_check_oob_read.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_check_oob_read.wir.wado index 49121ffaa..5ef1c16a9 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_check_oob_read.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_check_oob_read.wir.wado @@ -50,7 +50,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -184,7 +184,7 @@ fn "core:internal/cm_stream_write_raw_u8"(handle, data, len) { // from core:int drop("mem/realloc"(ptr, raw_len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_check_oob_write.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_check_oob_write.wir.wado index 4abf16f81..2e99d4aa3 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_check_oob_write.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_check_oob_write.wir.wado @@ -50,7 +50,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -182,7 +182,7 @@ fn "core:internal/cm_stream_write_raw_u8"(handle, data, len) { // from core:int drop("mem/realloc"(ptr, raw_len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_const.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_const.wir.wado index 76ef145dc..f333ab25e 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_const.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_const.wir.wado @@ -79,11 +79,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -148,32 +148,32 @@ fn __test_0_constant_index_within_bounds() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_0_constant_index_within_bounds"), used: 37 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_0_constant_index_within_bounds"), used: 37 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_29 = __local_9; i32::fmt_decimal(7, __local_29); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: arr[0] == 10 "), used: 25 }); - String::append_char(__local_8, 97); - String::append_char(__local_8, 114); - String::append_char(__local_8, 114); - String::append_char(__local_8, 91); - String::append_char(__local_8, 48); - String::append_char(__local_8, 93); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 114); + String::push(__local_8, 114); + String::push(__local_8, 91); + String::push(__local_8, 48); + String::push(__local_8, 93); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_34 = __local_9; i32::fmt_decimal(__v0_2, __local_34); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -189,32 +189,32 @@ condition: arr[0] == 10 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_0_constant_index_within_bounds"), used: 37 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_0_constant_index_within_bounds"), used: 37 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_42 = __local_11; i32::fmt_decimal(8, __local_42); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: arr[1] == 20 "), used: 25 }); - String::append_char(__local_10, 97); - String::append_char(__local_10, 114); - String::append_char(__local_10, 114); - String::append_char(__local_10, 91); - String::append_char(__local_10, 49); - String::append_char(__local_10, 93); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 114); + String::push(__local_10, 114); + String::push(__local_10, 91); + String::push(__local_10, 49); + String::push(__local_10, 93); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_47 = __local_11; i32::fmt_decimal(__v0_4, __local_47); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -230,32 +230,32 @@ condition: arr[1] == 20 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_0_constant_index_within_bounds"), used: 37 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_0_constant_index_within_bounds"), used: 37 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_55 = __local_13; i32::fmt_decimal(9, __local_55); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: arr[2] == 30 "), used: 25 }); - String::append_char(__local_12, 97); - String::append_char(__local_12, 114); - String::append_char(__local_12, 114); - String::append_char(__local_12, 91); - String::append_char(__local_12, 50); - String::append_char(__local_12, 93); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 114); + String::push(__local_12, 114); + String::push(__local_12, 91); + String::push(__local_12, 50); + String::push(__local_12, 93); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_60 = __local_13; i32::fmt_decimal(__v0_6, __local_60); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -310,30 +310,30 @@ fn __test_1_multiple_arrays_with_different_sizes() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_1_multiple_arrays_with_different_sizes"), used: 45 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_1_multiple_arrays_with_different_sizes"), used: 45 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_44 = __local_13; i32::fmt_decimal(15, __local_44); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: a[0] == 1 "), used: 22 }); - String::append_char(__local_12, 97); - String::append_char(__local_12, 91); - String::append_char(__local_12, 48); - String::append_char(__local_12, 93); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 91); + String::push(__local_12, 48); + String::push(__local_12, 93); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_49 = __local_13; i32::fmt_decimal(__v0_4, __local_49); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -349,30 +349,30 @@ condition: a[0] == 1 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_1_multiple_arrays_with_different_sizes"), used: 45 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_1_multiple_arrays_with_different_sizes"), used: 45 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_57 = __local_15; i32::fmt_decimal(16, __local_57); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: a[1] == 2 "), used: 22 }); - String::append_char(__local_14, 97); - String::append_char(__local_14, 91); - String::append_char(__local_14, 49); - String::append_char(__local_14, 93); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 91); + String::push(__local_14, 49); + String::push(__local_14, 93); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_62 = __local_15; i32::fmt_decimal(__v0_6, __local_62); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -388,30 +388,30 @@ condition: a[1] == 2 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_1_multiple_arrays_with_different_sizes"), used: 45 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_1_multiple_arrays_with_different_sizes"), used: 45 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_70 = __local_17; i32::fmt_decimal(17, __local_70); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: b[0] == 10 "), used: 23 }); - String::append_char(__local_16, 98); - String::append_char(__local_16, 91); - String::append_char(__local_16, 48); - String::append_char(__local_16, 93); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 98); + String::push(__local_16, 91); + String::push(__local_16, 48); + String::push(__local_16, 93); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_75 = __local_17; i32::fmt_decimal(__v0_8, __local_75); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -427,30 +427,30 @@ condition: b[0] == 10 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_1_multiple_arrays_with_different_sizes"), used: 45 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_1_multiple_arrays_with_different_sizes"), used: 45 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_83 = __local_19; i32::fmt_decimal(18, __local_83); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: b[3] == 40 "), used: 23 }); - String::append_char(__local_18, 98); - String::append_char(__local_18, 91); - String::append_char(__local_18, 51); - String::append_char(__local_18, 93); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 98); + String::push(__local_18, 91); + String::push(__local_18, 51); + String::push(__local_18, 93); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_88 = __local_19; i32::fmt_decimal(__v0_10, __local_88); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -508,32 +508,32 @@ fn __test_2_array_with_write_then_read() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_2_array_with_write_then_read"), used: 35 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_2_array_with_write_then_read"), used: 35 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_38 = __local_9; i32::fmt_decimal(26, __local_38); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: arr[0] == 42 "), used: 25 }); - String::append_char(__local_8, 97); - String::append_char(__local_8, 114); - String::append_char(__local_8, 114); - String::append_char(__local_8, 91); - String::append_char(__local_8, 48); - String::append_char(__local_8, 93); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 114); + String::push(__local_8, 114); + String::push(__local_8, 91); + String::push(__local_8, 48); + String::push(__local_8, 93); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_43 = __local_9; i32::fmt_decimal(__v0_2, __local_43); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -549,32 +549,32 @@ condition: arr[0] == 42 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_2_array_with_write_then_read"), used: 35 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_2_array_with_write_then_read"), used: 35 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_51 = __local_11; i32::fmt_decimal(27, __local_51); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: arr[1] == 99 "), used: 25 }); - String::append_char(__local_10, 97); - String::append_char(__local_10, 114); - String::append_char(__local_10, 114); - String::append_char(__local_10, 91); - String::append_char(__local_10, 49); - String::append_char(__local_10, 93); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 114); + String::push(__local_10, 114); + String::push(__local_10, 91); + String::push(__local_10, 49); + String::push(__local_10, 93); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_56 = __local_11; i32::fmt_decimal(__v0_4, __local_56); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -590,32 +590,32 @@ condition: arr[1] == 99 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_2_array_with_write_then_read"), used: 35 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_2_array_with_write_then_read"), used: 35 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_const.wado"), used: 57 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_64 = __local_13; i32::fmt_decimal(28, __local_64); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: arr[2] == 7 "), used: 24 }); - String::append_char(__local_12, 97); - String::append_char(__local_12, 114); - String::append_char(__local_12, 114); - String::append_char(__local_12, 91); - String::append_char(__local_12, 50); - String::append_char(__local_12, 93); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 114); + String::push(__local_12, 114); + String::push(__local_12, 91); + String::push(__local_12, 50); + String::push(__local_12, 93); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_69 = __local_13; i32::fmt_decimal(__v0_6, __local_69); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -828,7 +828,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -843,7 +843,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -870,7 +870,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -923,7 +923,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l50; }; @@ -957,20 +957,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -980,10 +980,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -993,10 +993,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1004,10 +1004,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_const_wir.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_const_wir.wir.wado index e04003128..e836a6cd5 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_const_wir.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_const_wir.wir.wado @@ -79,11 +79,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -154,13 +154,13 @@ fn run() with Stdout { __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_26 = __local_6; i32::fmt_decimal(first, __local_26); - String::append_char(__local_5, 44); - String::append_char(__local_5, 32); + String::push(__local_5, 44); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_31 = __local_6; i32::fmt_decimal(second, __local_31); - String::append_char(__local_5, 44); - String::append_char(__local_5, 32); + String::push(__local_5, 44); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_36 = __local_6; i32::fmt_decimal(third, __local_36); @@ -400,7 +400,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -415,7 +415,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -442,7 +442,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -495,7 +495,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -529,20 +529,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -552,10 +552,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -565,10 +565,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -576,10 +576,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_le_guard.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_le_guard.wir.wado index 483ff8328..9b0575e0b 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_le_guard.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_le_guard.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -355,7 +355,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -370,7 +370,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -408,7 +408,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l29; }; @@ -442,20 +442,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -465,10 +465,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -478,10 +478,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -489,10 +489,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_le_guard_wir.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_le_guard_wir.wir.wado index 9964abcc4..42e189eb2 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_le_guard_wir.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_le_guard_wir.wir.wado @@ -73,9 +73,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -343,7 +343,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -358,7 +358,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -396,7 +396,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -430,20 +430,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -453,10 +453,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -466,10 +466,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -477,10 +477,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_loop_guard.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_loop_guard.wir.wado index a1dcc0ee0..f20e8ad4e 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_loop_guard.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_loop_guard.wir.wado @@ -79,11 +79,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -157,31 +157,31 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_loop_guard.wado"), used: 62 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_loop_guard.wado"), used: 62 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_30 = __local_7; i32::fmt_decimal(12, __local_30); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: sum == 150 "), used: 23 }); - String::append_char(__local_6, 115); - String::append_char(__local_6, 117); - String::append_char(__local_6, 109); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 115); + String::push(__local_6, 117); + String::push(__local_6, 109); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_35 = __local_7; i32::fmt_decimal(__v0, __local_35); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -426,7 +426,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -441,7 +441,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -468,7 +468,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -521,7 +521,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l32; }; @@ -555,20 +555,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -578,10 +578,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -591,10 +591,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -602,10 +602,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_loop_guard_wir.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_loop_guard_wir.wir.wado index f7034096a..af598722f 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_loop_guard_wir.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_loop_guard_wir.wir.wado @@ -71,11 +71,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -340,7 +340,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -355,7 +355,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -382,7 +382,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -435,7 +435,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l30; }; @@ -469,20 +469,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -492,10 +492,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -505,10 +505,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -516,10 +516,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_after_mutation.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_after_mutation.wir.wado index 9eaa16e4a..85bc7a24b 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_after_mutation.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_after_mutation.wir.wado @@ -71,11 +71,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -133,34 +133,34 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_oob_after_mutation.wado"), used: 70 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_oob_after_mutation.wado"), used: 70 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_25 = __local_5; i32::fmt_decimal(15, __local_25); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: arr[0] == 999 "), used: 26 }); - String::append_char(__local_4, 97); - String::append_char(__local_4, 114); - String::append_char(__local_4, 114); - String::append_char(__local_4, 91); - String::append_char(__local_4, 48); - String::append_char(__local_4, 93); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 114); + String::push(__local_4, 114); + String::push(__local_4, 91); + String::push(__local_4, 48); + String::push(__local_4, 93); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_30 = __local_5; i32::fmt_decimal(__v0, __local_30); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -370,7 +370,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -385,7 +385,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -412,7 +412,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -465,7 +465,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -499,20 +499,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -522,10 +522,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -535,10 +535,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -546,10 +546,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_complex.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_complex.wir.wado index fffd661d0..56e17268f 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_complex.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_complex.wir.wado @@ -50,7 +50,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -80,9 +80,9 @@ fn run() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 1); - Array::append(arr, 2); - Array::append(arr, 3); + Array::push(arr, 1); + Array::push(arr, 2); + Array::push(arr, 3); drop(__inline_Array_i32__IndexValue__index_value_6: block -> i32 { if 5 >= arr.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -187,7 +187,7 @@ fn "core:internal/cm_stream_write_raw_u8"(handle, data, len) { // from core:int drop("mem/realloc"(ptr, raw_len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_loop_dynamic.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_loop_dynamic.wir.wado index 44fdb939b..1a98728e4 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_loop_dynamic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_loop_dynamic.wir.wado @@ -71,11 +71,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -137,7 +137,7 @@ fn run() { if (i < 3) == 0 { break __for_0; }; - Array::append(arr, i * 10); + Array::push(arr, i * 10); i = i + 1; continue l1; }; @@ -154,34 +154,34 @@ fn run() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_9, 114); - String::append_char(__local_9, 117); - String::append_char(__local_9, 110); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_oob_loop_dynamic.wado"), used: 68 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_9, 114); + String::push(__local_9, 117); + String::push(__local_9, 110); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_oob_loop_dynamic.wado"), used: 68 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_24 = __local_10; i32::fmt_decimal(11, __local_24); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: arr[0] == 0 "), used: 24 }); - String::append_char(__local_9, 97); - String::append_char(__local_9, 114); - String::append_char(__local_9, 114); - String::append_char(__local_9, 91); - String::append_char(__local_9, 48); - String::append_char(__local_9, 93); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 114); + String::push(__local_9, 114); + String::push(__local_9, 91); + String::push(__local_9, 48); + String::push(__local_9, 93); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_29 = __local_10; i32::fmt_decimal(__v0_3, __local_29); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -197,34 +197,34 @@ condition: arr[0] == 0 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_11, 114); - String::append_char(__local_11, 117); - String::append_char(__local_11, 110); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_oob_loop_dynamic.wado"), used: 68 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_11, 114); + String::push(__local_11, 117); + String::push(__local_11, 110); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_oob_loop_dynamic.wado"), used: 68 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_37 = __local_12; i32::fmt_decimal(12, __local_37); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: arr[1] == 10 "), used: 25 }); - String::append_char(__local_11, 97); - String::append_char(__local_11, 114); - String::append_char(__local_11, 114); - String::append_char(__local_11, 91); - String::append_char(__local_11, 49); - String::append_char(__local_11, 93); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 114); + String::push(__local_11, 114); + String::push(__local_11, 91); + String::push(__local_11, 49); + String::push(__local_11, 93); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_42 = __local_12; i32::fmt_decimal(__v0_5, __local_42); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -240,34 +240,34 @@ condition: arr[1] == 10 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_13, 114); - String::append_char(__local_13, 117); - String::append_char(__local_13, 110); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_oob_loop_dynamic.wado"), used: 68 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_13, 114); + String::push(__local_13, 117); + String::push(__local_13, 110); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/array_bounds_elim_oob_loop_dynamic.wado"), used: 68 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_50 = __local_14; i32::fmt_decimal(13, __local_50); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: arr[2] == 20 "), used: 25 }); - String::append_char(__local_13, 97); - String::append_char(__local_13, 114); - String::append_char(__local_13, 114); - String::append_char(__local_13, 91); - String::append_char(__local_13, 50); - String::append_char(__local_13, 93); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 114); + String::push(__local_13, 114); + String::push(__local_13, 91); + String::push(__local_13, 50); + String::push(__local_13, 93); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_55 = __local_14; i32::fmt_decimal(__v0_7, __local_55); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -477,7 +477,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -492,7 +492,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -519,7 +519,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -572,7 +572,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l37; }; @@ -606,20 +606,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -629,10 +629,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -642,10 +642,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -653,10 +653,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_preserved_wir.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_preserved_wir.wir.wado index d469d0d89..217a3de68 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_preserved_wir.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_preserved_wir.wir.wado @@ -58,7 +58,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -230,7 +230,7 @@ fn "core:internal/cm_stream_write_raw_u8"(handle, data, len) { // from core:int drop("mem/realloc"(ptr, raw_len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_simple.wir.wado b/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_simple.wir.wado index 78f08af45..d29e21724 100644 --- a/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_simple.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_bounds_elim_oob_simple.wir.wado @@ -50,7 +50,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -184,7 +184,7 @@ fn "core:internal/cm_stream_write_raw_u8"(handle, data, len) { // from core:int drop("mem/realloc"(ptr, raw_len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/array_explicit_cast.wir.wado b/wado-compiler/tests/fixtures.golden/array_explicit_cast.wir.wado index a3091ec15..034bea925 100644 --- a/wado-compiler/tests/fixtures.golden/array_explicit_cast.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_explicit_cast.wir.wado @@ -79,11 +79,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -136,8 +136,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_11: builtin::array_get(a.repr, 0); }, __local_17); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_24 = __local_3; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_15: block -> i32 { @@ -147,8 +147,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_15: builtin::array_get(a.repr, 1); }, __local_24); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_31 = __local_3; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_19: block -> i32 { @@ -394,7 +394,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -409,7 +409,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -436,7 +436,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -489,7 +489,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -523,20 +523,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -546,10 +546,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -559,10 +559,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -570,10 +570,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_f64.wir.wado b/wado-compiler/tests/fixtures.golden/array_f64.wir.wado index f65eee9b7..9bea64da0 100644 --- a/wado-compiler/tests/fixtures.golden/array_f64.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_f64.wir.wado @@ -98,7 +98,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -106,9 +106,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/Array::append" = fn(ref Array, f64); +type "functype/Array::push" = fn(ref Array, f64); type "functype/Array::grow" = fn(ref Array); @@ -185,7 +185,7 @@ fn run() with Stdout { }; break __inline_Array_f64__IndexValue__index_value_10: builtin::array_get(a.repr, 0); }, __local_16); - String::append(__local_2, String { repr: array.new_data(", "), used: 2 }); + String::push_str(__local_2, String { repr: array.new_data(", "), used: 2 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_21 = __local_3; f64::fmt_into(__inline_Array_f64__IndexValue__index_value_13: block -> f64 { @@ -195,7 +195,7 @@ fn run() with Stdout { }; break __inline_Array_f64__IndexValue__index_value_13: builtin::array_get(a.repr, 1); }, __local_21); - String::append(__local_2, String { repr: array.new_data(", "), used: 2 }); + String::push_str(__local_2, String { repr: array.new_data(", "), used: 2 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_26 = __local_3; f64::fmt_into(__inline_Array_f64__IndexValue__index_value_16: block -> f64 { @@ -970,7 +970,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1025,7 +1025,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1057,7 +1057,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1139,25 +1139,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1258,9 +1258,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1314,13 +1314,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1355,9 +1355,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1398,7 +1398,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1413,7 +1413,7 @@ fn String::append(self, other) { self.used = new_used; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/array_index_1.wir.wado b/wado-compiler/tests/fixtures.golden/array_index_1.wir.wado index 132d9eb12..3f896fbdc 100644 --- a/wado-compiler/tests/fixtures.golden/array_index_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_index_1.wir.wado @@ -117,13 +117,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -135,11 +135,11 @@ type "functype/Node::is_full" = fn(ref Node, i32) -> bool; type "functype/Node::count_active" = fn(ref Node) -> i32; -type "functype/Array::append" = fn(ref Array, bool); +type "functype/Array::push" = fn(ref Array, bool); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -238,13 +238,13 @@ fn array_index_inline() with Stdout { __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_25 = __local_5; i32::fmt_decimal(first, __local_25); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); + String::push(__local_4, 44); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_30 = __local_5; i32::fmt_decimal(second, __local_30); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); + String::push(__local_4, 44); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_35 = __local_5; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_18: block -> i32 { @@ -275,14 +275,14 @@ fn array_index_inline_btree() with Stdout { result = Tree::check(tree); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 114); - String::append_char(__local_4, 101); - String::append_char(__local_4, 115); - String::append_char(__local_4, 117); - String::append_char(__local_4, 108); - String::append_char(__local_4, 116); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 114); + String::push(__local_4, 101); + String::push(__local_4, 115); + String::push(__local_4, 117); + String::push(__local_4, 108); + String::push(__local_4, 116); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(result, __local_5); break __tmpl: __local_4; @@ -302,13 +302,13 @@ fn array_index_inline_compare() with Stdout { result = find_key_index(keys, String { repr: array.new_data("cherry"), used: 6 }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_3, 105); - String::append_char(__local_3, 110); - String::append_char(__local_3, 100); - String::append_char(__local_3, 101); - String::append_char(__local_3, 120); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 105); + String::push(__local_3, 110); + String::push(__local_3, 100); + String::push(__local_3, 101); + String::push(__local_3, 120); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(result, __local_4); break __tmpl: __local_3; @@ -356,13 +356,13 @@ fn array_index_inline_generic() with Stdout { __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_25 = __local_6; i32::fmt_decimal(first, __local_25); - String::append_char(__local_5, 44); - String::append_char(__local_5, 32); + String::push(__local_5, 44); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_30 = __local_6; i32::fmt_decimal(second, __local_30); - String::append_char(__local_5, 44); - String::append_char(__local_5, 32); + String::push(__local_5, 44); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_35 = __local_6; i32::fmt_decimal(third, __local_35); @@ -417,11 +417,11 @@ fn array_index_inline_loop() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(sum, __local_8); break __tmpl: __local_7; @@ -462,8 +462,8 @@ fn array_index_inline_loop() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_24: builtin::array_get(arr2.repr, 0); }, __local_48); - String::append_char(__local_9, 44); - String::append_char(__local_9, 32); + String::push(__local_9, 44); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_55 = __local_10; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_28: block -> i32 { @@ -473,8 +473,8 @@ fn array_index_inline_loop() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_28: builtin::array_get(arr2.repr, 1); }, __local_55); - String::append_char(__local_9, 44); - String::append_char(__local_9, 32); + String::push(__local_9, 44); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_62 = __local_10; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_32: block -> i32 { @@ -732,7 +732,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -790,7 +790,7 @@ fn String^Ord::cmp(self, other) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -817,7 +817,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -985,7 +985,7 @@ fn Node::count_active(self) { return count; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1027,7 +1027,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1080,7 +1080,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l81; }; @@ -1114,20 +1114,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1137,10 +1137,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1150,10 +1150,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1161,10 +1161,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_index_2.wir.wado b/wado-compiler/tests/fixtures.golden/array_index_2.wir.wado index 55cae9531..680d567d3 100644 --- a/wado-compiler/tests/fixtures.golden/array_index_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_index_2.wir.wado @@ -102,21 +102,21 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); type "functype/Container::count_flagged" = fn(ref Container) -> i32; -type "functype/Array::append" = fn(ref Array, bool); +type "functype/Array::push" = fn(ref Array, bool); type "functype/Array::grow" = fn(ref Array); @@ -212,31 +212,31 @@ fn array_index_inline_multi() with Stdout { count = Container::count_flagged(Container { items: __sroa_c_items, markers: __sroa_c_markers }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(59), used: 0 }; - String::append_char(__local_9, 105); - String::append_char(__local_9, 116); - String::append_char(__local_9, 101); - String::append_char(__local_9, 109); - String::append_char(__local_9, 115); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); - String::append(__local_9, item0); - String::append_char(__local_9, 44); - String::append_char(__local_9, 32); - String::append(__local_9, item1); - String::append_char(__local_9, 44); - String::append_char(__local_9, 32); - String::append(__local_9, item2); + String::push(__local_9, 105); + String::push(__local_9, 116); + String::push(__local_9, 101); + String::push(__local_9, 109); + String::push(__local_9, 115); + String::push(__local_9, 58); + String::push(__local_9, 32); + String::push_str(__local_9, item0); + String::push(__local_9, 44); + String::push(__local_9, 32); + String::push_str(__local_9, item1); + String::push(__local_9, 44); + String::push(__local_9, 32); + String::push_str(__local_9, item2); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(41), used: 0 }; - String::append_char(__local_10, 102); - String::append_char(__local_10, 108); - String::append_char(__local_10, 97); - String::append_char(__local_10, 103); - String::append_char(__local_10, 115); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 102); + String::push(__local_10, 108); + String::push(__local_10, 97); + String::push(__local_10, 103); + String::push(__local_10, 115); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_56 = __local_11; Formatter::pad(__local_56, if flag0 -> ref String { @@ -244,8 +244,8 @@ fn array_index_inline_multi() with Stdout { } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_10, 44); - String::append_char(__local_10, 32); + String::push(__local_10, 44); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_61 = __local_11; Formatter::pad(__local_61, if flag1 -> ref String { @@ -257,13 +257,13 @@ fn array_index_inline_multi() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_12, 99); - String::append_char(__local_12, 111); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 116); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 99); + String::push(__local_12, 111); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 116); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(count, __local_13); break __tmpl: __local_12; @@ -336,15 +336,15 @@ fn array_index_inline_nested() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(41), used: 0 }; - String::append(__local_6, String { repr: array.new_data("sum (excluding deleted): "), used: 25 }); + String::push_str(__local_6, String { repr: array.new_data("sum (excluding deleted): "), used: 25 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(sum, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_8, String { repr: array.new_data("first key: "), used: 11 }); - String::append(__local_8, __inline_Array_String__IndexValue__index_value_26: block -> ref String { + String::push_str(__local_8, String { repr: array.new_data("first key: "), used: 11 }); + String::push_str(__local_8, __inline_Array_String__IndexValue__index_value_26: block -> ref String { if 0 >= __sroa_node_keys.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; @@ -593,7 +593,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -608,7 +608,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -635,7 +635,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -677,7 +677,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -751,7 +751,7 @@ fn Container::count_flagged(self) { return count; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -804,7 +804,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l54; }; @@ -824,7 +824,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -832,17 +832,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -872,20 +872,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -895,10 +895,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -908,10 +908,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -919,10 +919,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_index_inline_method.wir.wado b/wado-compiler/tests/fixtures.golden/array_index_inline_method.wir.wado index 581b5987e..dc4d97a77 100644 --- a/wado-compiler/tests/fixtures.golden/array_index_inline_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_index_inline_method.wir.wado @@ -101,13 +101,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -115,11 +115,11 @@ type "functype/Container::is_full" = fn(ref Container, i type "functype/Container::find_key_index" = fn(ref Container, ref String) -> i32; -type "functype/Array::append" = fn(ref Array, bool); +type "functype/Array::push" = fn(ref Array, bool); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -176,24 +176,24 @@ fn run() with Stdout { full = Container::is_full(c, 5); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(47), used: 0 }; - String::append_char(__local_6, 105); - String::append_char(__local_6, 110); - String::append_char(__local_6, 100); - String::append_char(__local_6, 101); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 105); + String::push(__local_6, 110); + String::push(__local_6, 100); + String::push(__local_6, 101); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_39 = __local_7; i32::fmt_decimal(idx, __local_39); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); - String::append_char(__local_6, 102); - String::append_char(__local_6, 117); - String::append_char(__local_6, 108); - String::append_char(__local_6, 108); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 44); + String::push(__local_6, 32); + String::push(__local_6, 102); + String::push(__local_6, 117); + String::push(__local_6, 108); + String::push(__local_6, 108); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_44 = __local_7; Formatter::pad(__local_44, if full -> ref String { @@ -437,7 +437,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -495,7 +495,7 @@ fn String^Ord::cmp(self, other) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -522,7 +522,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -637,7 +637,7 @@ fn Container::find_key_index(self, key) { return i; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -679,7 +679,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -732,7 +732,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l54; }; @@ -752,7 +752,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -760,17 +760,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -800,20 +800,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -823,10 +823,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -836,10 +836,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -847,10 +847,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_index_inline_recursive.wir.wado b/wado-compiler/tests/fixtures.golden/array_index_inline_recursive.wir.wado index 2df722a08..c38cf713a 100644 --- a/wado-compiler/tests/fixtures.golden/array_index_inline_recursive.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_index_inline_recursive.wir.wado @@ -86,17 +86,17 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); type "functype/Node::traverse" = fn(ref Node, i32); -type "functype/Array>::append" = fn(ref Array>, ref Node); +type "functype/Array>::push" = fn(ref Array>, ref Node); type "functype/Array>::grow" = fn(ref Array>); @@ -130,13 +130,13 @@ fn print_depth(depth) with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_1, 100); - String::append_char(__local_1, 101); - String::append_char(__local_1, 112); - String::append_char(__local_1, 116); - String::append_char(__local_1, 104); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 100); + String::push(__local_1, 101); + String::push(__local_1, 112); + String::push(__local_1, 116); + String::push(__local_1, 104); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(depth, __local_2); break __tmpl: __local_1; @@ -372,7 +372,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -387,7 +387,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -414,7 +414,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -486,7 +486,7 @@ fn Node::traverse(self, depth) with Stdout { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -539,7 +539,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -573,20 +573,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -596,10 +596,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -609,10 +609,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -620,10 +620,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_large_literal_dynamic.wir.wado b/wado-compiler/tests/fixtures.golden/array_large_literal_dynamic.wir.wado index 7c98fd5ee..41d74b95c 100644 --- a/wado-compiler/tests/fixtures.golden/array_large_literal_dynamic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_large_literal_dynamic.wir.wado @@ -79,11 +79,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -188,32 +188,32 @@ fn run() with Stdout { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 114); - String::append_char(__local_19, 117); - String::append_char(__local_19, 110); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 114); + String::push(__local_19, 117); + String::push(__local_19, 110); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_568 = __local_20; i32::fmt_decimal(27, __local_568); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: a[0] == 0 "), used: 22 }); - String::append_char(__local_19, 97); - String::append_char(__local_19, 91); - String::append_char(__local_19, 48); - String::append_char(__local_19, 93); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 91); + String::push(__local_19, 48); + String::push(__local_19, 93); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_573 = __local_20; i32::fmt_decimal(__v0_3, __local_573); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -229,34 +229,34 @@ condition: a[0] == 0 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 114); - String::append_char(__local_21, 117); - String::append_char(__local_21, 110); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 114); + String::push(__local_21, 117); + String::push(__local_21, 110); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_581 = __local_22; i32::fmt_decimal(28, __local_581); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: a[127] == 127 "), used: 26 }); - String::append_char(__local_21, 97); - String::append_char(__local_21, 91); - String::append_char(__local_21, 49); - String::append_char(__local_21, 50); - String::append_char(__local_21, 55); - String::append_char(__local_21, 93); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 91); + String::push(__local_21, 49); + String::push(__local_21, 50); + String::push(__local_21, 55); + String::push(__local_21, 93); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_586 = __local_22; i32::fmt_decimal(__v0_5, __local_586); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -272,34 +272,34 @@ condition: a[127] == 127 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_23, 114); - String::append_char(__local_23, 117); - String::append_char(__local_23, 110); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_23, 114); + String::push(__local_23, 117); + String::push(__local_23, 110); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_594 = __local_24; i32::fmt_decimal(29, __local_594); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: a[255] == 255 "), used: 26 }); - String::append_char(__local_23, 97); - String::append_char(__local_23, 91); - String::append_char(__local_23, 50); - String::append_char(__local_23, 53); - String::append_char(__local_23, 53); - String::append_char(__local_23, 93); - String::append_char(__local_23, 58); - String::append_char(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 91); + String::push(__local_23, 50); + String::push(__local_23, 53); + String::push(__local_23, 53); + String::push(__local_23, 93); + String::push(__local_23, 58); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_599 = __local_24; i32::fmt_decimal(__v0_7, __local_599); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -315,34 +315,34 @@ condition: a[255] == 255 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_25, 114); - String::append_char(__local_25, 117); - String::append_char(__local_25, 110); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_25, 114); + String::push(__local_25, 117); + String::push(__local_25, 110); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_607 = __local_26; i32::fmt_decimal(31, __local_607); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: a[256] == 999 "), used: 26 }); - String::append_char(__local_25, 97); - String::append_char(__local_25, 91); - String::append_char(__local_25, 50); - String::append_char(__local_25, 53); - String::append_char(__local_25, 54); - String::append_char(__local_25, 93); - String::append_char(__local_25, 58); - String::append_char(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 91); + String::push(__local_25, 50); + String::push(__local_25, 53); + String::push(__local_25, 54); + String::push(__local_25, 93); + String::push(__local_25, 58); + String::push(__local_25, 32); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_612 = __local_26; i32::fmt_decimal(__v0_9, __local_612); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -358,34 +358,34 @@ condition: a[256] == 999 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_27, 114); - String::append_char(__local_27, 117); - String::append_char(__local_27, 110); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_27, 114); + String::push(__local_27, 117); + String::push(__local_27, 110); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_620 = __local_28; i32::fmt_decimal(32, __local_620); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: a[257] == 420 "), used: 26 }); - String::append_char(__local_27, 97); - String::append_char(__local_27, 91); - String::append_char(__local_27, 50); - String::append_char(__local_27, 53); - String::append_char(__local_27, 55); - String::append_char(__local_27, 93); - String::append_char(__local_27, 58); - String::append_char(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 91); + String::push(__local_27, 50); + String::push(__local_27, 53); + String::push(__local_27, 55); + String::push(__local_27, 93); + String::push(__local_27, 58); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_625 = __local_28; i32::fmt_decimal(__v0_11, __local_625); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -401,34 +401,34 @@ condition: a[257] == 420 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_29, 114); - String::append_char(__local_29, 117); - String::append_char(__local_29, 110); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_29, 114); + String::push(__local_29, 117); + String::push(__local_29, 110); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_633 = __local_30; i32::fmt_decimal(33, __local_633); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: a[258] == 1000 "), used: 27 }); - String::append_char(__local_29, 97); - String::append_char(__local_29, 91); - String::append_char(__local_29, 50); - String::append_char(__local_29, 53); - String::append_char(__local_29, 56); - String::append_char(__local_29, 93); - String::append_char(__local_29, 58); - String::append_char(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 91); + String::push(__local_29, 50); + String::push(__local_29, 53); + String::push(__local_29, 56); + String::push(__local_29, 93); + String::push(__local_29, 58); + String::push(__local_29, 32); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_638 = __local_30; i32::fmt_decimal(__v0_13, __local_638); - String::append_char(__local_29, 10); + String::push(__local_29, 10); break __tmpl: __local_29; }); unreachable; @@ -444,34 +444,34 @@ condition: a[258] == 1000 if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_31, 114); - String::append_char(__local_31, 117); - String::append_char(__local_31, 110); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_31, 114); + String::push(__local_31, 117); + String::push(__local_31, 110); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_646 = __local_32; i32::fmt_decimal(34, __local_646); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: a[259] == 9990 "), used: 27 }); - String::append_char(__local_31, 97); - String::append_char(__local_31, 91); - String::append_char(__local_31, 50); - String::append_char(__local_31, 53); - String::append_char(__local_31, 57); - String::append_char(__local_31, 93); - String::append_char(__local_31, 58); - String::append_char(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 91); + String::push(__local_31, 50); + String::push(__local_31, 53); + String::push(__local_31, 57); + String::push(__local_31, 93); + String::push(__local_31, 58); + String::push(__local_31, 32); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_651 = __local_32; i32::fmt_decimal(__v0_15, __local_651); - String::append_char(__local_31, 10); + String::push(__local_31, 10); break __tmpl: __local_31; }); unreachable; @@ -481,45 +481,45 @@ condition: a[259] == 9990 if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_33, 114); - String::append_char(__local_33, 117); - String::append_char(__local_33, 110); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_33, 114); + String::push(__local_33, 117); + String::push(__local_33, 110); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/array_large_literal_dynamic.wado"), used: 61 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_658 = __local_34; i32::fmt_decimal(35, __local_658); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: a.len() == 260 "), used: 27 }); - String::append(__local_33, String { repr: array.new_data("a.len(): "), used: 9 }); + String::push_str(__local_33, String { repr: array.new_data("a.len(): "), used: 9 }); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_663 = __local_34; i32::fmt_decimal(__v0_17, __local_663); - String::append_char(__local_33, 10); + String::push(__local_33, 10); break __tmpl: __local_33; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_35 = String { repr: builtin::array_new(156), used: 0 }; - String::append_char(__local_35, 108); - String::append_char(__local_35, 101); - String::append_char(__local_35, 110); - String::append_char(__local_35, 61); + String::push(__local_35, 108); + String::push(__local_35, 101); + String::push(__local_35, 110); + String::push(__local_35, 61); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_669 = __local_36; i32::fmt_decimal(a.used, __local_669); - String::append_char(__local_35, 32); - String::append_char(__local_35, 91); - String::append_char(__local_35, 48); - String::append_char(__local_35, 93); - String::append_char(__local_35, 61); + String::push(__local_35, 32); + String::push(__local_35, 91); + String::push(__local_35, 48); + String::push(__local_35, 93); + String::push(__local_35, 61); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_675 = __local_36; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_338: block -> i32 { @@ -529,13 +529,13 @@ condition: a.len() == 260 }; break __inline_Array_i32__IndexValue__index_value_338: builtin::array_get(a.repr, 0); }, __local_675); - String::append_char(__local_35, 32); - String::append_char(__local_35, 91); - String::append_char(__local_35, 50); - String::append_char(__local_35, 53); - String::append_char(__local_35, 53); - String::append_char(__local_35, 93); - String::append_char(__local_35, 61); + String::push(__local_35, 32); + String::push(__local_35, 91); + String::push(__local_35, 50); + String::push(__local_35, 53); + String::push(__local_35, 53); + String::push(__local_35, 93); + String::push(__local_35, 61); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_682 = __local_36; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_342: block -> i32 { @@ -545,13 +545,13 @@ condition: a.len() == 260 }; break __inline_Array_i32__IndexValue__index_value_342: builtin::array_get(a.repr, 255); }, __local_682); - String::append_char(__local_35, 32); - String::append_char(__local_35, 91); - String::append_char(__local_35, 50); - String::append_char(__local_35, 53); - String::append_char(__local_35, 54); - String::append_char(__local_35, 93); - String::append_char(__local_35, 61); + String::push(__local_35, 32); + String::push(__local_35, 91); + String::push(__local_35, 50); + String::push(__local_35, 53); + String::push(__local_35, 54); + String::push(__local_35, 93); + String::push(__local_35, 61); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_689 = __local_36; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_346: block -> i32 { @@ -561,13 +561,13 @@ condition: a.len() == 260 }; break __inline_Array_i32__IndexValue__index_value_346: builtin::array_get(a.repr, 256); }, __local_689); - String::append_char(__local_35, 32); - String::append_char(__local_35, 91); - String::append_char(__local_35, 50); - String::append_char(__local_35, 53); - String::append_char(__local_35, 55); - String::append_char(__local_35, 93); - String::append_char(__local_35, 61); + String::push(__local_35, 32); + String::push(__local_35, 91); + String::push(__local_35, 50); + String::push(__local_35, 53); + String::push(__local_35, 55); + String::push(__local_35, 93); + String::push(__local_35, 61); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_696 = __local_36; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_350: block -> i32 { @@ -577,13 +577,13 @@ condition: a.len() == 260 }; break __inline_Array_i32__IndexValue__index_value_350: builtin::array_get(a.repr, 257); }, __local_696); - String::append_char(__local_35, 32); - String::append_char(__local_35, 91); - String::append_char(__local_35, 50); - String::append_char(__local_35, 53); - String::append_char(__local_35, 56); - String::append_char(__local_35, 93); - String::append_char(__local_35, 61); + String::push(__local_35, 32); + String::push(__local_35, 91); + String::push(__local_35, 50); + String::push(__local_35, 53); + String::push(__local_35, 56); + String::push(__local_35, 93); + String::push(__local_35, 61); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_703 = __local_36; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_354: block -> i32 { @@ -593,13 +593,13 @@ condition: a.len() == 260 }; break __inline_Array_i32__IndexValue__index_value_354: builtin::array_get(a.repr, 258); }, __local_703); - String::append_char(__local_35, 32); - String::append_char(__local_35, 91); - String::append_char(__local_35, 50); - String::append_char(__local_35, 53); - String::append_char(__local_35, 57); - String::append_char(__local_35, 93); - String::append_char(__local_35, 61); + String::push(__local_35, 32); + String::push(__local_35, 91); + String::push(__local_35, 50); + String::push(__local_35, 53); + String::push(__local_35, 57); + String::push(__local_35, 93); + String::push(__local_35, 61); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_710 = __local_36; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_358: block -> i32 { @@ -845,7 +845,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -860,7 +860,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -887,7 +887,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -940,7 +940,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l49; }; @@ -974,20 +974,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -997,10 +997,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1010,10 +1010,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1021,10 +1021,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_literal_coerce_u8.wir.wado b/wado-compiler/tests/fixtures.golden/array_literal_coerce_u8.wir.wado index 6e39fdf60..a15d5bbdf 100644 --- a/wado-compiler/tests/fixtures.golden/array_literal_coerce_u8.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_literal_coerce_u8.wir.wado @@ -91,19 +91,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, u16); +type "functype/Array::push" = fn(ref Array, u16); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i64); +type "functype/Array::push" = fn(ref Array, i64); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -179,8 +179,8 @@ fn run() with Stdout { }; break __inline_Array_u8__IndexValue__index_value_11: builtin::array_get(a.repr, 0); }, __local_29); - String::append_char(__local_8, 44); - String::append_char(__local_8, 32); + String::push(__local_8, 44); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_36 = __local_9; i32::fmt_decimal(__inline_Array_u8__IndexValue__index_value_15: block -> u8 { @@ -190,8 +190,8 @@ fn run() with Stdout { }; break __inline_Array_u8__IndexValue__index_value_15: builtin::array_get(a.repr, 1); }, __local_36); - String::append_char(__local_8, 44); - String::append_char(__local_8, 32); + String::push(__local_8, 44); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_43 = __local_9; i32::fmt_decimal(__inline_Array_u8__IndexValue__index_value_19: block -> u8 { @@ -218,8 +218,8 @@ fn run() with Stdout { }; break __inline_Array_i64__IndexValue__index_value_30: builtin::array_get(b.repr, 0); }, __local_60); - String::append_char(__local_10, 44); - String::append_char(__local_10, 32); + String::push(__local_10, 44); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_67 = __local_11; i64::fmt_decimal(__inline_Array_i64__IndexValue__index_value_34: block -> i64 { @@ -229,8 +229,8 @@ fn run() with Stdout { }; break __inline_Array_i64__IndexValue__index_value_34: builtin::array_get(b.repr, 1); }, __local_67); - String::append_char(__local_10, 44); - String::append_char(__local_10, 32); + String::push(__local_10, 44); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_74 = __local_11; i64::fmt_decimal(__inline_Array_i64__IndexValue__index_value_38: block -> i64 { @@ -257,8 +257,8 @@ fn run() with Stdout { }; break __inline_Array_u16__IndexValue__index_value_49: builtin::array_get(c.repr, 0); }, __local_91); - String::append_char(__local_12, 44); - String::append_char(__local_12, 32); + String::push(__local_12, 44); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_98 = __local_13; i32::fmt_decimal(__inline_Array_u16__IndexValue__index_value_53: block -> u16 { @@ -268,8 +268,8 @@ fn run() with Stdout { }; break __inline_Array_u16__IndexValue__index_value_53: builtin::array_get(c.repr, 1); }, __local_98); - String::append_char(__local_12, 44); - String::append_char(__local_12, 32); + String::push(__local_12, 44); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_105 = __local_13; i32::fmt_decimal(__inline_Array_u16__IndexValue__index_value_57: block -> u16 { @@ -296,8 +296,8 @@ fn run() with Stdout { }; break __inline_Array_u8__IndexValue__index_value_68: builtin::array_get(d.repr, 0); }, __local_122); - String::append_char(__local_14, 44); - String::append_char(__local_14, 32); + String::push(__local_14, 44); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_129 = __local_15; i32::fmt_decimal(__inline_Array_u8__IndexValue__index_value_72: block -> u8 { @@ -307,8 +307,8 @@ fn run() with Stdout { }; break __inline_Array_u8__IndexValue__index_value_72: builtin::array_get(d.repr, 1); }, __local_129); - String::append_char(__local_14, 44); - String::append_char(__local_14, 32); + String::push(__local_14, 44); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_136 = __local_15; i32::fmt_decimal(__inline_Array_u8__IndexValue__index_value_76: block -> u8 { @@ -593,7 +593,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -608,7 +608,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -635,7 +635,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -677,7 +677,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -719,7 +719,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -772,7 +772,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l50; }; @@ -806,20 +806,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -829,10 +829,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -842,10 +842,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -853,10 +853,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_new.wir.wado b/wado-compiler/tests/fixtures.golden/array_new.wir.wado index 7fde88ccc..ccf924531 100644 --- a/wado-compiler/tests/fixtures.golden/array_new.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_new.wir.wado @@ -138,7 +138,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -148,19 +148,19 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, f64); +type "functype/Array::push" = fn(ref Array, f64); type "functype/Array::grow" = fn(ref Array); @@ -268,25 +268,25 @@ fn array_new_data_f64() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("array_new_data_f64"), used: 18 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("array_new_data_f64"), used: 18 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_287 = __local_14; i32::fmt_decimal(14, __local_287); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: a.len() == 128 "), used: 27 }); - String::append(__local_13, String { repr: array.new_data("a.len(): "), used: 9 }); + String::push_str(__local_13, String { repr: array.new_data("a.len(): "), used: 9 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_292 = __local_14; i32::fmt_decimal(__v0_2, __local_292); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -302,30 +302,30 @@ condition: a.len() == 128 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("array_new_data_f64"), used: 18 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("array_new_data_f64"), used: 18 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_300 = __local_16; i32::fmt_decimal(15, __local_300); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: a[0] == 1.0 "), used: 24 }); - String::append_char(__local_15, 97); - String::append_char(__local_15, 91); - String::append_char(__local_15, 48); - String::append_char(__local_15, 93); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 91); + String::push(__local_15, 48); + String::push(__local_15, 93); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_305 = __local_16; f64::inspect_into(__v0_4, __local_305); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -341,32 +341,32 @@ condition: a[0] == 1.0 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("array_new_data_f64"), used: 18 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("array_new_data_f64"), used: 18 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_311 = __local_18; i32::fmt_decimal(16, __local_311); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: a[127] == 128.0 "), used: 28 }); - String::append_char(__local_17, 97); - String::append_char(__local_17, 91); - String::append_char(__local_17, 49); - String::append_char(__local_17, 50); - String::append_char(__local_17, 55); - String::append_char(__local_17, 93); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 91); + String::push(__local_17, 49); + String::push(__local_17, 50); + String::push(__local_17, 55); + String::push(__local_17, 93); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_316 = __local_18; f64::inspect_into(__v0_6, __local_316); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -392,57 +392,57 @@ condition: a[127] == 128.0 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("array_new_data_f64"), used: 18 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("array_new_data_f64"), used: 18 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_321 = __local_20; i32::fmt_decimal(23, __local_321); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: sum == 8256.0 "), used: 26 }); - String::append_char(__local_19, 115); - String::append_char(__local_19, 117); - String::append_char(__local_19, 109); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 115); + String::push(__local_19, 117); + String::push(__local_19, 109); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_326 = __local_20; f64::inspect_into(__v0_11, __local_326); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(86), used: 0 }; - String::append_char(__local_21, 108); - String::append_char(__local_21, 101); - String::append_char(__local_21, 110); - String::append_char(__local_21, 61); + String::push(__local_21, 108); + String::push(__local_21, 101); + String::push(__local_21, 110); + String::push(__local_21, 61); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_330 = __local_22; i32::fmt_decimal(a.used, __local_330); - String::append_char(__local_21, 32); - String::append_char(__local_21, 115); - String::append_char(__local_21, 117); - String::append_char(__local_21, 109); - String::append_char(__local_21, 61); + String::push(__local_21, 32); + String::push(__local_21, 115); + String::push(__local_21, 117); + String::push(__local_21, 109); + String::push(__local_21, 61); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_21 }; __local_335 = __local_22; f64::fmt_into(sum, __local_335); - String::append_char(__local_21, 32); - String::append_char(__local_21, 102); - String::append_char(__local_21, 105); - String::append_char(__local_21, 114); - String::append_char(__local_21, 115); - String::append_char(__local_21, 116); - String::append_char(__local_21, 61); + String::push(__local_21, 32); + String::push(__local_21, 102); + String::push(__local_21, 105); + String::push(__local_21, 114); + String::push(__local_21, 115); + String::push(__local_21, 116); + String::push(__local_21, 61); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_21 }; __local_337 = __local_22; f64::fmt_into(__inline_Array_f64__IndexValue__index_value_167: block -> f64 { @@ -452,12 +452,12 @@ condition: sum == 8256.0 }; break __inline_Array_f64__IndexValue__index_value_167: builtin::array_get(a.repr, 0); }, __local_337); - String::append_char(__local_21, 32); - String::append_char(__local_21, 108); - String::append_char(__local_21, 97); - String::append_char(__local_21, 115); - String::append_char(__local_21, 116); - String::append_char(__local_21, 61); + String::push(__local_21, 32); + String::push(__local_21, 108); + String::push(__local_21, 97); + String::push(__local_21, 115); + String::push(__local_21, 116); + String::push(__local_21, 61); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_21 }; __local_341 = __local_22; f64::fmt_into(__inline_Array_f64__IndexValue__index_value_169: block -> f64 { @@ -522,25 +522,25 @@ fn array_new_data_i32() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("array_new_data_i32"), used: 18 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("array_new_data_i32"), used: 18 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_291 = __local_16; i32::fmt_decimal(32, __local_291); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: a.len() == 128 "), used: 27 }); - String::append(__local_15, String { repr: array.new_data("a.len(): "), used: 9 }); + String::push_str(__local_15, String { repr: array.new_data("a.len(): "), used: 9 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_296 = __local_16; i32::fmt_decimal(__v0_2, __local_296); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -556,30 +556,30 @@ condition: a.len() == 128 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("array_new_data_i32"), used: 18 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("array_new_data_i32"), used: 18 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_304 = __local_18; i32::fmt_decimal(33, __local_304); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: a[0] == 10 "), used: 23 }); - String::append_char(__local_17, 97); - String::append_char(__local_17, 91); - String::append_char(__local_17, 48); - String::append_char(__local_17, 93); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 91); + String::push(__local_17, 48); + String::push(__local_17, 93); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_309 = __local_18; i32::fmt_decimal(__v0_4, __local_309); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -595,30 +595,30 @@ condition: a[0] == 10 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("array_new_data_i32"), used: 18 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("array_new_data_i32"), used: 18 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_317 = __local_20; i32::fmt_decimal(34, __local_317); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: a[7] == 80 "), used: 23 }); - String::append_char(__local_19, 97); - String::append_char(__local_19, 91); - String::append_char(__local_19, 55); - String::append_char(__local_19, 93); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 91); + String::push(__local_19, 55); + String::push(__local_19, 93); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_322 = __local_20; i32::fmt_decimal(__v0_6, __local_322); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -634,32 +634,32 @@ condition: a[7] == 80 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("array_new_data_i32"), used: 18 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("array_new_data_i32"), used: 18 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_330 = __local_22; i32::fmt_decimal(35, __local_330); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: a[127] == 1280 "), used: 27 }); - String::append_char(__local_21, 97); - String::append_char(__local_21, 91); - String::append_char(__local_21, 49); - String::append_char(__local_21, 50); - String::append_char(__local_21, 55); - String::append_char(__local_21, 93); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 91); + String::push(__local_21, 49); + String::push(__local_21, 50); + String::push(__local_21, 55); + String::push(__local_21, 93); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_335 = __local_22; i32::fmt_decimal(__v0_8, __local_335); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -685,57 +685,57 @@ condition: a[127] == 1280 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("array_new_data_i32"), used: 18 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("array_new_data_i32"), used: 18 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_342 = __local_24; i32::fmt_decimal(42, __local_342); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: sum == 82560 "), used: 25 }); - String::append_char(__local_23, 115); - String::append_char(__local_23, 117); - String::append_char(__local_23, 109); - String::append_char(__local_23, 58); - String::append_char(__local_23, 32); + String::push(__local_23, 115); + String::push(__local_23, 117); + String::push(__local_23, 109); + String::push(__local_23, 58); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_347 = __local_24; i32::fmt_decimal(__v0_13, __local_347); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(86), used: 0 }; - String::append_char(__local_25, 108); - String::append_char(__local_25, 101); - String::append_char(__local_25, 110); - String::append_char(__local_25, 61); + String::push(__local_25, 108); + String::push(__local_25, 101); + String::push(__local_25, 110); + String::push(__local_25, 61); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_353 = __local_26; i32::fmt_decimal(a.used, __local_353); - String::append_char(__local_25, 32); - String::append_char(__local_25, 115); - String::append_char(__local_25, 117); - String::append_char(__local_25, 109); - String::append_char(__local_25, 61); + String::push(__local_25, 32); + String::push(__local_25, 115); + String::push(__local_25, 117); + String::push(__local_25, 109); + String::push(__local_25, 61); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_359 = __local_26; i32::fmt_decimal(sum, __local_359); - String::append_char(__local_25, 32); - String::append_char(__local_25, 102); - String::append_char(__local_25, 105); - String::append_char(__local_25, 114); - String::append_char(__local_25, 115); - String::append_char(__local_25, 116); - String::append_char(__local_25, 61); + String::push(__local_25, 32); + String::push(__local_25, 102); + String::push(__local_25, 105); + String::push(__local_25, 114); + String::push(__local_25, 115); + String::push(__local_25, 116); + String::push(__local_25, 61); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_364 = __local_26; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_181: block -> i32 { @@ -745,12 +745,12 @@ condition: sum == 82560 }; break __inline_Array_i32__IndexValue__index_value_181: builtin::array_get(a.repr, 0); }, __local_364); - String::append_char(__local_25, 32); - String::append_char(__local_25, 108); - String::append_char(__local_25, 97); - String::append_char(__local_25, 115); - String::append_char(__local_25, 116); - String::append_char(__local_25, 61); + String::push(__local_25, 32); + String::push(__local_25, 108); + String::push(__local_25, 97); + String::push(__local_25, 115); + String::push(__local_25, 116); + String::push(__local_25, 61); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_371 = __local_26; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_185: block -> i32 { @@ -821,25 +821,25 @@ fn array_new_data_mixed() with Stdout { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_294 = __local_18; i32::fmt_decimal(53, __local_294); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: a.len() == 128 "), used: 27 }); - String::append(__local_17, String { repr: array.new_data("a.len(): "), used: 9 }); + String::push_str(__local_17, String { repr: array.new_data("a.len(): "), used: 9 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_299 = __local_18; i32::fmt_decimal(__v0_3, __local_299); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -855,30 +855,30 @@ condition: a.len() == 128 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_307 = __local_20; i32::fmt_decimal(54, __local_307); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: a[0] == 1 "), used: 22 }); - String::append_char(__local_19, 97); - String::append_char(__local_19, 91); - String::append_char(__local_19, 48); - String::append_char(__local_19, 93); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 91); + String::push(__local_19, 48); + String::push(__local_19, 93); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_312 = __local_20; i32::fmt_decimal(__v0_5, __local_312); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -894,32 +894,32 @@ condition: a[0] == 1 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_320 = __local_22; i32::fmt_decimal(55, __local_320); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: a[127] == 42 "), used: 25 }); - String::append_char(__local_21, 97); - String::append_char(__local_21, 91); - String::append_char(__local_21, 49); - String::append_char(__local_21, 50); - String::append_char(__local_21, 55); - String::append_char(__local_21, 93); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 91); + String::push(__local_21, 49); + String::push(__local_21, 50); + String::push(__local_21, 55); + String::push(__local_21, 93); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_325 = __local_22; i32::fmt_decimal(__v0_7, __local_325); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -933,25 +933,25 @@ condition: a[127] == 42 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_591 = __local_24; i32::fmt_decimal(61, __local_591); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: b.len() == 128 "), used: 27 }); - String::append(__local_23, String { repr: array.new_data("b.len(): "), used: 9 }); + String::push_str(__local_23, String { repr: array.new_data("b.len(): "), used: 9 }); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_596 = __local_24; i32::fmt_decimal(__v0_11, __local_596); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -967,30 +967,30 @@ condition: b.len() == 128 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_604 = __local_26; i32::fmt_decimal(62, __local_604); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: b[0] == 100 "), used: 24 }); - String::append_char(__local_25, 98); - String::append_char(__local_25, 91); - String::append_char(__local_25, 48); - String::append_char(__local_25, 93); - String::append_char(__local_25, 58); - String::append_char(__local_25, 32); + String::push(__local_25, 98); + String::push(__local_25, 91); + String::push(__local_25, 48); + String::push(__local_25, 93); + String::push(__local_25, 58); + String::push(__local_25, 32); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_609 = __local_26; i32::fmt_decimal(__v0_13, __local_609); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -1006,45 +1006,45 @@ condition: b[0] == 100 if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("array_new_data_mixed"), used: 20 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_617 = __local_28; i32::fmt_decimal(63, __local_617); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: b[127] == 12800 "), used: 28 }); - String::append_char(__local_27, 98); - String::append_char(__local_27, 91); - String::append_char(__local_27, 49); - String::append_char(__local_27, 50); - String::append_char(__local_27, 55); - String::append_char(__local_27, 93); - String::append_char(__local_27, 58); - String::append_char(__local_27, 32); + String::push(__local_27, 98); + String::push(__local_27, 91); + String::push(__local_27, 49); + String::push(__local_27, 50); + String::push(__local_27, 55); + String::push(__local_27, 93); + String::push(__local_27, 58); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_622 = __local_28; i32::fmt_decimal(__v0_15, __local_622); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(69), used: 0 }; - String::append_char(__local_29, 97); - String::append_char(__local_29, 91); - String::append_char(__local_29, 49); - String::append_char(__local_29, 50); - String::append_char(__local_29, 55); - String::append_char(__local_29, 93); - String::append_char(__local_29, 61); + String::push(__local_29, 97); + String::push(__local_29, 91); + String::push(__local_29, 49); + String::push(__local_29, 50); + String::push(__local_29, 55); + String::push(__local_29, 93); + String::push(__local_29, 61); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_628 = __local_30; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_313: block -> i32 { @@ -1054,12 +1054,12 @@ condition: b[127] == 12800 }; break __inline_Array_i32__IndexValue__index_value_313: builtin::array_get(a.repr, 127); }, __local_628); - String::append_char(__local_29, 32); - String::append_char(__local_29, 98); - String::append_char(__local_29, 91); - String::append_char(__local_29, 48); - String::append_char(__local_29, 93); - String::append_char(__local_29, 61); + String::push(__local_29, 32); + String::push(__local_29, 98); + String::push(__local_29, 91); + String::push(__local_29, 48); + String::push(__local_29, 93); + String::push(__local_29, 61); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_635 = __local_30; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_317: block -> i32 { @@ -1069,14 +1069,14 @@ condition: b[127] == 12800 }; break __inline_Array_i32__IndexValue__index_value_317: builtin::array_get(b.repr, 0); }, __local_635); - String::append_char(__local_29, 32); - String::append_char(__local_29, 98); - String::append_char(__local_29, 91); - String::append_char(__local_29, 49); - String::append_char(__local_29, 50); - String::append_char(__local_29, 55); - String::append_char(__local_29, 93); - String::append_char(__local_29, 61); + String::push(__local_29, 32); + String::push(__local_29, 98); + String::push(__local_29, 91); + String::push(__local_29, 49); + String::push(__local_29, 50); + String::push(__local_29, 55); + String::push(__local_29, 93); + String::push(__local_29, 61); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_642 = __local_30; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_321: block -> i32 { @@ -1135,25 +1135,25 @@ fn array_new_data_u8() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("array_new_data_u8"), used: 17 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("array_new_data_u8"), used: 17 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_300 = __local_12; i32::fmt_decimal(73, __local_300); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: a.len() == 132 "), used: 27 }); - String::append(__local_11, String { repr: array.new_data("a.len(): "), used: 9 }); + String::push_str(__local_11, String { repr: array.new_data("a.len(): "), used: 9 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_305 = __local_12; i32::fmt_decimal(__v0, __local_305); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1168,17 +1168,17 @@ condition: a.len() == 132 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("array_new_data_u8"), used: 17 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("array_new_data_u8"), used: 17 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(74, __local_14); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: a[0] as i32 == 0 "), used: 29 }); break __tmpl: __local_13; @@ -1195,17 +1195,17 @@ condition: a[0] as i32 == 0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("array_new_data_u8"), used: 17 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("array_new_data_u8"), used: 17 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(75, __local_16); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: a[15] as i32 == 15 "), used: 31 }); break __tmpl: __local_15; @@ -1222,17 +1222,17 @@ condition: a[15] as i32 == 15 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("array_new_data_u8"), used: 17 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("array_new_data_u8"), used: 17 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; i32::fmt_decimal(76, __local_18); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: a[127] as i32 == 127 "), used: 33 }); break __tmpl: __local_17; @@ -1249,17 +1249,17 @@ condition: a[127] as i32 == 127 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("array_new_data_u8"), used: 17 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("array_new_data_u8"), used: 17 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; i32::fmt_decimal(77, __local_20); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: a[128] as i32 == 255 "), used: 33 }); break __tmpl: __local_19; @@ -1276,17 +1276,17 @@ condition: a[128] as i32 == 255 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("array_new_data_u8"), used: 17 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("array_new_data_u8"), used: 17 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; i32::fmt_decimal(78, __local_22); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: a[129] as i32 == 128 "), used: 33 }); break __tmpl: __local_21; @@ -1303,17 +1303,17 @@ condition: a[129] as i32 == 128 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("array_new_data_u8"), used: 17 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("array_new_data_u8"), used: 17 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; i32::fmt_decimal(79, __local_24); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: a[130] as i32 == 64 "), used: 32 }); break __tmpl: __local_23; @@ -1330,17 +1330,17 @@ condition: a[130] as i32 == 64 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("array_new_data_u8"), used: 17 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("array_new_data_u8"), used: 17 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/array_new.wado"), used: 43 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; i32::fmt_decimal(80, __local_26); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: a[131] as i32 == 32 "), used: 32 }); break __tmpl: __local_25; @@ -1349,18 +1349,18 @@ condition: a[131] as i32 == 32 }; "core:cli/println"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(87), used: 0 }; - String::append_char(__local_27, 108); - String::append_char(__local_27, 101); - String::append_char(__local_27, 110); - String::append_char(__local_27, 61); + String::push(__local_27, 108); + String::push(__local_27, 101); + String::push(__local_27, 110); + String::push(__local_27, 61); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_367 = __local_28; i32::fmt_decimal(a.used, __local_367); - String::append_char(__local_27, 32); - String::append_char(__local_27, 91); - String::append_char(__local_27, 48); - String::append_char(__local_27, 93); - String::append_char(__local_27, 61); + String::push(__local_27, 32); + String::push(__local_27, 91); + String::push(__local_27, 48); + String::push(__local_27, 93); + String::push(__local_27, 61); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_373 = __local_28; i32::fmt_decimal(__inline_Array_u8__IndexValue__index_value_185: block -> u8 { @@ -1370,13 +1370,13 @@ condition: a[131] as i32 == 32 }; break __inline_Array_u8__IndexValue__index_value_185: builtin::array_get(a.repr, 0); }, __local_373); - String::append_char(__local_27, 32); - String::append_char(__local_27, 91); - String::append_char(__local_27, 49); - String::append_char(__local_27, 50); - String::append_char(__local_27, 56); - String::append_char(__local_27, 93); - String::append_char(__local_27, 61); + String::push(__local_27, 32); + String::push(__local_27, 91); + String::push(__local_27, 49); + String::push(__local_27, 50); + String::push(__local_27, 56); + String::push(__local_27, 93); + String::push(__local_27, 61); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_380 = __local_28; i32::fmt_decimal(__inline_Array_u8__IndexValue__index_value_189: block -> u8 { @@ -1386,13 +1386,13 @@ condition: a[131] as i32 == 32 }; break __inline_Array_u8__IndexValue__index_value_189: builtin::array_get(a.repr, 128); }, __local_380); - String::append_char(__local_27, 32); - String::append_char(__local_27, 91); - String::append_char(__local_27, 49); - String::append_char(__local_27, 51); - String::append_char(__local_27, 49); - String::append_char(__local_27, 93); - String::append_char(__local_27, 61); + String::push(__local_27, 32); + String::push(__local_27, 91); + String::push(__local_27, 49); + String::push(__local_27, 51); + String::push(__local_27, 49); + String::push(__local_27, 93); + String::push(__local_27, 61); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_387 = __local_28; i32::fmt_decimal(__inline_Array_u8__IndexValue__index_value_193: block -> u8 { @@ -2191,8 +2191,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2247,13 +2247,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -2261,25 +2261,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -2287,7 +2287,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -2329,8 +2329,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2362,7 +2362,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -2491,27 +2491,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2632,9 +2632,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -2701,9 +2701,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2713,8 +2713,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2769,13 +2769,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2810,9 +2810,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2865,7 +2865,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2880,7 +2880,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2907,7 +2907,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2959,7 +2959,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3011,7 +3011,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3064,7 +3064,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l238; }; @@ -3222,20 +3222,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3245,10 +3245,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3258,10 +3258,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3269,10 +3269,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_of_generic_struct.wir.wado b/wado-compiler/tests/fixtures.golden/array_of_generic_struct.wir.wado index 5b9c02fb6..a4cccc6dc 100644 --- a/wado-compiler/tests/fixtures.golden/array_of_generic_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_of_generic_struct.wir.wado @@ -79,11 +79,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref "core:internal/Box"); +type "functype/Array>::push" = fn(ref Array>, ref "core:internal/Box"); type "functype/Array>::grow" = fn(ref Array>); @@ -127,7 +127,7 @@ fn __test_0_container_of_boxes() { break __seq_lit: __local_10; }; item = "core:internal/Box" { value: 42 }; - Array>::append(__sroa_c_items, item); + Array>::push(__sroa_c_items, item); __v0 = __inline_Array_Box_i32___IndexValue__index_value_15: block -> ref "core:internal/Box" { if 0 >= __sroa_c_items.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -139,25 +139,25 @@ fn __test_0_container_of_boxes() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_0_container_of_boxes"), used: 27 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/array_of_generic_struct.wado"), used: 57 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_0_container_of_boxes"), used: 27 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/array_of_generic_struct.wado"), used: 57 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_33 = __local_8; i32::fmt_decimal(31, __local_33); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: c.items[0].value == 42 "), used: 35 }); - String::append(__local_7, String { repr: array.new_data("c.items[0].value: "), used: 18 }); + String::push_str(__local_7, String { repr: array.new_data("c.items[0].value: "), used: 18 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_38 = __local_8; i32::fmt_decimal(__v0, __local_38); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -189,32 +189,32 @@ fn __test_1_array_of_boxes() { __local_0 = Array> { repr: builtin::array_new">(0), used: 0 }; break __seq_lit: __local_0; }; - Array>::append(arr, "core:internal/Box" { value: 10 }); - Array>::append(arr, "core:internal/Box" { value: 20 }); + Array>::push(arr, "core:internal/Box" { value: 10 }); + Array>::push(arr, "core:internal/Box" { value: 20 }); __v0_2 = arr.used; __cond_3 = __v0_2 == 2; if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_1_array_of_boxes"), used: 23 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/array_of_generic_struct.wado"), used: 57 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_1_array_of_boxes"), used: 23 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/array_of_generic_struct.wado"), used: 57 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_24 = __local_9; i32::fmt_decimal(38, __local_24); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: arr.len() == 2 "), used: 27 }); - String::append(__local_8, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_8, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_29 = __local_9; i32::fmt_decimal(__v0_2, __local_29); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -230,25 +230,25 @@ condition: arr.len() == 2 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_1_array_of_boxes"), used: 23 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/array_of_generic_struct.wado"), used: 57 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_1_array_of_boxes"), used: 23 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/array_of_generic_struct.wado"), used: 57 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_37 = __local_11; i32::fmt_decimal(39, __local_37); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: arr[0].value == 10 "), used: 31 }); - String::append(__local_10, String { repr: array.new_data("arr[0].value: "), used: 14 }); + String::push_str(__local_10, String { repr: array.new_data("arr[0].value: "), used: 14 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_42 = __local_11; i32::fmt_decimal(__v0_4, __local_42); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -264,25 +264,25 @@ condition: arr[0].value == 10 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_1_array_of_boxes"), used: 23 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/array_of_generic_struct.wado"), used: 57 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_1_array_of_boxes"), used: 23 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/array_of_generic_struct.wado"), used: 57 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_50 = __local_13; i32::fmt_decimal(40, __local_50); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: arr[1].value == 20 "), used: 31 }); - String::append(__local_12, String { repr: array.new_data("arr[1].value: "), used: 14 }); + String::push_str(__local_12, String { repr: array.new_data("arr[1].value: "), used: 14 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_55 = __local_13; i32::fmt_decimal(__v0_6, __local_55); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -490,7 +490,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -505,7 +505,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -532,7 +532,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -585,7 +585,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -619,20 +619,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -642,10 +642,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -655,10 +655,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -666,10 +666,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_param_coercion.wir.wado b/wado-compiler/tests/fixtures.golden/array_param_coercion.wir.wado index 7d13b76dc..d7056ab10 100644 --- a/wado-compiler/tests/fixtures.golden/array_param_coercion.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_param_coercion.wir.wado @@ -81,11 +81,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -386,7 +386,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -401,7 +401,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -428,7 +428,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -481,7 +481,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -515,20 +515,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -538,10 +538,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -551,10 +551,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -562,10 +562,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_return.wir.wado b/wado-compiler/tests/fixtures.golden/array_return.wir.wado index 1cae07535..ca3c97e94 100644 --- a/wado-compiler/tests/fixtures.golden/array_return.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_return.wir.wado @@ -81,11 +81,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -142,8 +142,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_5: builtin::array_get(a.repr, 0); }, __local_7); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_14 = __local_2; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_9: block -> i32 { @@ -153,8 +153,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_9: builtin::array_get(a.repr, 1); }, __local_14); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_21 = __local_2; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_13: block -> i32 { @@ -400,7 +400,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -415,7 +415,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -442,7 +442,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -495,7 +495,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -529,20 +529,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -552,10 +552,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -565,10 +565,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -576,10 +576,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_specialized.wir.wado b/wado-compiler/tests/fixtures.golden/array_specialized.wir.wado index 72b84fe3a..ce3616f4d 100644 --- a/wado-compiler/tests/fixtures.golden/array_specialized.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_specialized.wir.wado @@ -302,7 +302,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -312,67 +312,67 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, u32); +type "functype/Array::push" = fn(ref Array, u32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, u16); +type "functype/Array::push" = fn(ref Array, u16); type "functype/Array::grow" = fn(ref Array); type "functype/ArrayIter>^Iterator::next" = fn(ref "core:allocator/ArrayIter>") -> ref null "tuple/[bool, i32, String]"; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[bool, i32, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[bool, i32, String]"); type "functype/Array>::grow" = fn(ref Array>); type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref null String; -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i8); +type "functype/Array::push" = fn(ref Array, i8); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i64); +type "functype/Array::push" = fn(ref Array, i64); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i16); +type "functype/Array::push" = fn(ref Array, i16); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, f64); +type "functype/Array::push" = fn(ref Array, f64); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, f32); +type "functype/Array::push" = fn(ref Array, f32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, char); +type "functype/Array::push" = fn(ref Array, char); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, bool); +type "functype/Array::push" = fn(ref Array, bool); type "functype/Array::grow" = fn(ref Array); @@ -476,9 +476,9 @@ fn array_specialized_bool() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 1); - Array::append(arr, 0); - Array::append(arr, 1); + Array::push(arr, 1); + Array::push(arr, 0); + Array::push(arr, 1); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b0: block { l1: loop { @@ -516,9 +516,9 @@ fn array_specialized_char() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 65); - Array::append(arr, 66); - Array::append(arr, 67); + Array::push(arr, 65); + Array::push(arr, 66); + Array::push(arr, 67); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b4: block { l5: loop { @@ -552,9 +552,9 @@ fn array_specialized_f32() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, builtin::f32_demote_f64(1.5)); - Array::append(arr, builtin::f32_demote_f64(2.5)); - Array::append(arr, builtin::f32_demote_f64(3.5)); + Array::push(arr, builtin::f32_demote_f64(1.5)); + Array::push(arr, builtin::f32_demote_f64(2.5)); + Array::push(arr, builtin::f32_demote_f64(3.5)); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b7: block { l8: loop { @@ -588,9 +588,9 @@ fn array_specialized_f64() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 1.5); - Array::append(arr, 2.5); - Array::append(arr, 3.5); + Array::push(arr, 1.5); + Array::push(arr, 2.5); + Array::push(arr, 3.5); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b10: block { l11: loop { @@ -624,9 +624,9 @@ fn array_specialized_i16() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 1000); - Array::append(arr, -2000); - Array::append(arr, 3000); + Array::push(arr, 1000); + Array::push(arr, -2000); + Array::push(arr, 3000); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b13: block { l14: loop { @@ -660,9 +660,9 @@ fn array_specialized_i32() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 100000); - Array::append(arr, -200000); - Array::append(arr, 300000); + Array::push(arr, 100000); + Array::push(arr, -200000); + Array::push(arr, 300000); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b16: block { l17: loop { @@ -696,9 +696,9 @@ fn array_specialized_i64() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 10000000000_i64); - Array::append(arr, -20000000000_i64); - Array::append(arr, 30000000000_i64); + Array::push(arr, 10000000000_i64); + Array::push(arr, -20000000000_i64); + Array::push(arr, 30000000000_i64); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b19: block { l20: loop { @@ -732,9 +732,9 @@ fn array_specialized_i8() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 1); - Array::append(arr, -2); - Array::append(arr, 3); + Array::push(arr, 1); + Array::push(arr, -2); + Array::push(arr, 3); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b22: block { l23: loop { @@ -767,9 +767,9 @@ fn array_specialized_string() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, String { repr: array.new_data("hello"), used: 5 }); - Array::append(arr, String { repr: array.new_data("world"), used: 5 }); - Array::append(arr, String { repr: array.new_data("!"), used: 1 }); + Array::push(arr, String { repr: array.new_data("hello"), used: 5 }); + Array::push(arr, String { repr: array.new_data("world"), used: 5 }); + Array::push(arr, String { repr: array.new_data("!"), used: 1 }); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b25: block { l26: loop { @@ -799,9 +799,9 @@ fn array_specialized_tuple() with Stdout { __local_0 = Array> { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array>::append(arr, "tuple/[bool, i32, String]" { 0: 1, 1: 1, 2: String { repr: array.new_data("one"), used: 3 } }); - Array>::append(arr, "tuple/[bool, i32, String]" { 0: 0, 1: 2, 2: String { repr: array.new_data("two"), used: 3 } }); - Array>::append(arr, "tuple/[bool, i32, String]" { 0: 1, 1: 3, 2: String { repr: array.new_data("three"), used: 5 } }); + Array>::push(arr, "tuple/[bool, i32, String]" { 0: 1, 1: 1, 2: String { repr: array.new_data("one"), used: 3 } }); + Array>::push(arr, "tuple/[bool, i32, String]" { 0: 0, 1: 2, 2: String { repr: array.new_data("two"), used: 3 } }); + Array>::push(arr, "tuple/[bool, i32, String]" { 0: 1, 1: 3, 2: String { repr: array.new_data("three"), used: 5 } }); __iter_2 = "core:allocator/ArrayIter>" { repr: arr.repr, used: arr.used, index: 0 }; b28: block { l29: loop { @@ -817,12 +817,12 @@ fn array_specialized_tuple() with Stdout { } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_4, 32); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_19 = __local_5; i32::fmt_decimal(x.1, __local_19); - String::append_char(__local_4, 32); - String::append(__local_4, x.2); + String::push(__local_4, 32); + String::push_str(__local_4, x.2); break __tmpl: __local_4; }); } else { @@ -844,9 +844,9 @@ fn array_specialized_u16() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 1000); - Array::append(arr, 2000); - Array::append(arr, 3000); + Array::push(arr, 1000); + Array::push(arr, 2000); + Array::push(arr, 3000); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b32: block { l33: loop { @@ -880,9 +880,9 @@ fn array_specialized_u32() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 100000); - Array::append(arr, 200000); - Array::append(arr, 300000); + Array::push(arr, 100000); + Array::push(arr, 200000); + Array::push(arr, 300000); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b35: block { l36: loop { @@ -916,9 +916,9 @@ fn array_specialized_u64() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 10000000000_i64); - Array::append(arr, 20000000000_i64); - Array::append(arr, 30000000000_i64); + Array::push(arr, 10000000000_i64); + Array::push(arr, 20000000000_i64); + Array::push(arr, 30000000000_i64); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b38: block { l39: loop { @@ -952,9 +952,9 @@ fn array_specialized_u8() with Stdout { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 1); - Array::append(arr, 2); - Array::append(arr, 3); + Array::push(arr, 1); + Array::push(arr, 2); + Array::push(arr, 3); __iter_2 = "core:allocator/ArrayIter" { repr: arr.repr, used: arr.used, index: 0 }; b41: block { l42: loop { @@ -1891,8 +1891,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1947,8 +1947,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1980,7 +1980,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -2109,27 +2109,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2400,9 +2400,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -2467,9 +2467,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -2523,13 +2523,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2564,9 +2564,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2577,10 +2577,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -2632,7 +2632,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2647,7 +2647,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2684,7 +2684,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2736,7 +2736,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2788,7 +2788,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2840,7 +2840,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2892,7 +2892,7 @@ fn ArrayIter>^Iterator::next(self) { return item; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2944,7 +2944,7 @@ fn ArrayIter^Iterator::next(self) { return item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2996,7 +2996,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3048,7 +3048,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3100,7 +3100,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3152,7 +3152,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3204,7 +3204,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3256,7 +3256,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3308,7 +3308,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3360,7 +3360,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3413,7 +3413,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l296; }; @@ -3433,7 +3433,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3441,17 +3441,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3605,20 +3605,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3628,10 +3628,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3641,10 +3641,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3652,10 +3652,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_string.wir.wado b/wado-compiler/tests/fixtures.golden/array_string.wir.wado index 59d2ac0e9..24bbdbc3a 100644 --- a/wado-compiler/tests/fixtures.golden/array_string.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_string.wir.wado @@ -68,9 +68,9 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -98,15 +98,15 @@ fn join_names(names) { let __local_1: ref String; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(37), used: 0 }; - String::append(__local_1, __inline_Array_String__IndexValue__index_value_1: block -> ref String { + String::push_str(__local_1, __inline_Array_String__IndexValue__index_value_1: block -> ref String { if 0 >= names.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; }; break __inline_Array_String__IndexValue__index_value_1: builtin::array_get(names.repr, 0); }); - String::append(__local_1, String { repr: array.new_data(" and "), used: 5 }); - String::append(__local_1, __inline_Array_String__IndexValue__index_value_2: block -> ref String { + String::push_str(__local_1, String { repr: array.new_data(" and "), used: 5 }); + String::push_str(__local_1, __inline_Array_String__IndexValue__index_value_2: block -> ref String { if 1 >= names.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; @@ -127,23 +127,23 @@ fn array_string() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(52), used: 0 }; - String::append(__local_2, __inline_Array_String__IndexValue__index_value_7: block -> ref String { + String::push_str(__local_2, __inline_Array_String__IndexValue__index_value_7: block -> ref String { if 0 >= names.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; }; break __inline_Array_String__IndexValue__index_value_7: builtin::array_get(names.repr, 0); }); - String::append(__local_2, String { repr: array.new_data(", "), used: 2 }); - String::append(__local_2, __inline_Array_String__IndexValue__index_value_8: block -> ref String { + String::push_str(__local_2, String { repr: array.new_data(", "), used: 2 }); + String::push_str(__local_2, __inline_Array_String__IndexValue__index_value_8: block -> ref String { if 1 >= names.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; }; break __inline_Array_String__IndexValue__index_value_8: builtin::array_get(names.repr, 1); }); - String::append(__local_2, String { repr: array.new_data(", "), used: 2 }); - String::append(__local_2, __inline_Array_String__IndexValue__index_value_9: block -> ref String { + String::push_str(__local_2, String { repr: array.new_data(", "), used: 2 }); + String::push_str(__local_2, __inline_Array_String__IndexValue__index_value_9: block -> ref String { if 2 >= names.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; @@ -164,15 +164,15 @@ fn array_string_cast() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_2, __inline_Array_String__IndexValue__index_value_6: block -> ref String { + String::push_str(__local_2, __inline_Array_String__IndexValue__index_value_6: block -> ref String { if 0 >= names.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; }; break __inline_Array_String__IndexValue__index_value_6: builtin::array_get(names.repr, 0); }); - String::append(__local_2, String { repr: array.new_data(" "), used: 1 }); - String::append(__local_2, __inline_Array_String__IndexValue__index_value_7: block -> ref String { + String::push_str(__local_2, String { repr: array.new_data(" "), used: 1 }); + String::push_str(__local_2, __inline_Array_String__IndexValue__index_value_7: block -> ref String { if 1 >= names.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; @@ -354,7 +354,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -369,7 +369,7 @@ fn String::append(self, other) { self.used = new_used; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/array_tuple_unit.wir.wado b/wado-compiler/tests/fixtures.golden/array_tuple_unit.wir.wado index 94f1ddf16..a62126ee4 100644 --- a/wado-compiler/tests/fixtures.golden/array_tuple_unit.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_tuple_unit.wir.wado @@ -81,13 +81,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayIter>^Iterator::next" = fn(ref "core:allocator/ArrayIter>") -> ref null "tuple/[i32, unit]"; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[i32, unit]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[i32, unit]"); type "functype/Array>::grow" = fn(ref Array>); @@ -343,7 +343,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -358,7 +358,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -395,7 +395,7 @@ fn ArrayIter>^Iterator::next(self) { return item; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -448,7 +448,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -482,20 +482,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -505,10 +505,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -518,10 +518,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -529,10 +529,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/array_type_annotation.wir.wado b/wado-compiler/tests/fixtures.golden/array_type_annotation.wir.wado index de139782d..42f2f4df7 100644 --- a/wado-compiler/tests/fixtures.golden/array_type_annotation.wir.wado +++ b/wado-compiler/tests/fixtures.golden/array_type_annotation.wir.wado @@ -79,11 +79,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -136,8 +136,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_11: builtin::array_get(a.repr, 0); }, __local_17); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_24 = __local_3; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_15: block -> i32 { @@ -147,8 +147,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_15: builtin::array_get(a.repr, 1); }, __local_24); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_31 = __local_3; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_19: block -> i32 { @@ -394,7 +394,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -409,7 +409,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -436,7 +436,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -489,7 +489,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -523,20 +523,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -546,10 +546,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -559,10 +559,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -570,10 +570,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_fail_intermediate.wir.wado b/wado-compiler/tests/fixtures.golden/assert_fail_intermediate.wir.wado index 0fbf54043..37055fa47 100644 --- a/wado-compiler/tests/fixtures.golden/assert_fail_intermediate.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_fail_intermediate.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,47 +102,47 @@ fn run() with Stdout, Stderr { let __local_27: ref Formatter; "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(160), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_fail_intermediate.wado"), used: 58 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_fail_intermediate.wado"), used: 58 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(6, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: x + y > 10 "), used: 23 }); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; i32::fmt_decimal(3, __local_17); - String::append_char(__local_6, 10); - String::append_char(__local_6, 121); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 10); + String::push(__local_6, 121); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_22 = __local_7; i32::fmt_decimal(4, __local_22); - String::append_char(__local_6, 10); - String::append_char(__local_6, 120); - String::append_char(__local_6, 32); - String::append_char(__local_6, 43); - String::append_char(__local_6, 32); - String::append_char(__local_6, 121); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 10); + String::push(__local_6, 120); + String::push(__local_6, 32); + String::push(__local_6, 43); + String::push(__local_6, 32); + String::push(__local_6, 121); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_27 = __local_7; i32::fmt_decimal(7, __local_27); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -344,7 +344,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -359,7 +359,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -397,7 +397,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -431,20 +431,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -454,10 +454,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -467,10 +467,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -478,10 +478,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_fail_side_effect.wir.wado b/wado-compiler/tests/fixtures.golden/assert_fail_side_effect.wir.wado index 9a9a51b5f..4efa522aa 100644 --- a/wado-compiler/tests/fixtures.golden/assert_fail_side_effect.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_fail_side_effect.wir.wado @@ -72,9 +72,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -117,27 +117,27 @@ fn run() with Stdout, Stderr { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_2, 114); - String::append_char(__local_2, 117); - String::append_char(__local_2, 110); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_fail_side_effect.wado"), used: 57 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_2, 114); + String::push(__local_2, 117); + String::push(__local_2, 110); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_fail_side_effect.wado"), used: 57 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_8 = __local_3; i32::fmt_decimal(13, __local_8); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: get_value() > 10 "), used: 29 }); - String::append(__local_2, String { repr: array.new_data("get_value(): "), used: 13 }); + String::push_str(__local_2, String { repr: array.new_data("get_value(): "), used: 13 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_13 = __local_3; i32::fmt_decimal(__v0, __local_13); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -376,7 +376,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -391,7 +391,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -429,7 +429,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -463,20 +463,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -486,10 +486,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -499,10 +499,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -510,10 +510,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_fail_simple.wir.wado b/wado-compiler/tests/fixtures.golden/assert_fail_simple.wir.wado index 22cac5c8d..692bd652b 100644 --- a/wado-compiler/tests/fixtures.golden/assert_fail_simple.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_fail_simple.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,29 +100,29 @@ fn run() with Stdout, Stderr { let __local_14: ref Formatter; "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_fail_simple.wado"), used: 52 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_3, 114); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_fail_simple.wado"), used: 52 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(5, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: x > 10 "), used: 19 }); - String::append_char(__local_3, 120); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 120); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; i32::fmt_decimal(5, __local_14); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -324,7 +324,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -339,7 +339,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -377,7 +377,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -411,20 +411,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -434,10 +434,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -458,10 +458,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_fail_with_message.wir.wado b/wado-compiler/tests/fixtures.golden/assert_fail_with_message.wir.wado index 3e7a94519..939474223 100644 --- a/wado-compiler/tests/fixtures.golden/assert_fail_with_message.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_fail_with_message.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,32 +100,32 @@ fn run() with Stdout, Stderr { let __local_14: ref Formatter; "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_fail_with_message.wado"), used: 58 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_3, 114); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_fail_with_message.wado"), used: 58 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(5, __local_9); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("value must be positive"), used: 22 }); - String::append(__local_3, String { repr: array.new_data(" + String::push(__local_3, 58); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("value must be positive"), used: 22 }); + String::push_str(__local_3, String { repr: array.new_data(" condition: x > 0 "), used: 18 }); - String::append_char(__local_3, 120); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 120); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; i32::fmt_decimal(-5, __local_14); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -327,7 +327,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -342,7 +342,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -380,7 +380,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -414,20 +414,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -437,10 +437,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -450,10 +450,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -461,10 +461,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_inspect_char.wir.wado b/wado-compiler/tests/fixtures.golden/assert_inspect_char.wir.wado index 44ed79d92..1560244ad 100644 --- a/wado-compiler/tests/fixtures.golden/assert_inspect_char.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_inspect_char.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -104,28 +104,28 @@ fn run() with Stdout, Stderr { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_char.wado"), used: 53 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_3, 114); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_char.wado"), used: 53 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(6, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: c == 'z' "), used: 21 }); - String::append_char(__local_3, 99); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 99); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Inspect::inspect(97, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -296,27 +296,27 @@ fn i32::fmt_decimal(self, f) { fn char^Inspect::inspect(self, f) { let c: char; - String::append_char(f.buf, 39); + String::push(f.buf, 39); c = self; if c == 39 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 39); + String::push(f.buf, 92); + String::push(f.buf, 39); } else if c == 92 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 92); + String::push(f.buf, 92); + String::push(f.buf, 92); } else if c == 10 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 110); + String::push(f.buf, 92); + String::push(f.buf, 110); } else if c == 13 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 114); + String::push(f.buf, 92); + String::push(f.buf, 114); } else if c == 9 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 116); + String::push(f.buf, 92); + String::push(f.buf, 116); } else { - String::append_char(f.buf, c); + String::push(f.buf, c); }; - String::append_char(f.buf, 39); + String::push(f.buf, 39); } fn String::grow(self, min_capacity) { @@ -353,7 +353,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -368,7 +368,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -406,7 +406,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l29; }; @@ -440,20 +440,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -463,10 +463,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -476,10 +476,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -487,10 +487,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_inspect_enum.wir.wado b/wado-compiler/tests/fixtures.golden/assert_inspect_enum.wir.wado index 5ce11429d..280d94846 100644 --- a/wado-compiler/tests/fixtures.golden/assert_inspect_enum.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_inspect_enum.wir.wado @@ -66,9 +66,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Color^Inspect::inspect" = fn(enum:Color, ref Formatter); @@ -112,32 +112,32 @@ fn run() with Stdout, Stderr { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_enum.wado"), used: 53 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_enum.wado"), used: 53 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(12, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: c == Color::Blue "), used: 29 }); - String::append_char(__local_4, 99); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 99); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; Color^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); - String::append(__local_4, String { repr: array.new_data("Color::Blue: "), used: 13 }); + String::push(__local_4, 10); + String::push_str(__local_4, String { repr: array.new_data("Color::Blue: "), used: 13 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; Color^Inspect::inspect(__v1, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -340,7 +340,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -355,7 +355,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -388,13 +388,13 @@ fn Color^Inspect::inspect(self, f) { let __local_7: ref String; if self == 0 { __local_3 = String { repr: array.new_data("Color::Red"), used: 10 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); } else if self == 1 { __local_5 = String { repr: array.new_data("Color::Green"), used: 12 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if self == 2 { __local_7 = String { repr: array.new_data("Color::Blue"), used: 11 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -409,7 +409,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -443,20 +443,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -466,10 +466,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -479,10 +479,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -490,10 +490,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_inspect_float.wir.wado b/wado-compiler/tests/fixtures.golden/assert_inspect_float.wir.wado index 4fdb9c83f..c12c67496 100644 --- a/wado-compiler/tests/fixtures.golden/assert_inspect_float.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_inspect_float.wir.wado @@ -89,7 +89,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -99,9 +99,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -165,29 +165,29 @@ fn run() with Stdout, Stderr { }; "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_float.wado"), used: 54 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_3, 114); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_float.wado"), used: 54 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_8 = __local_4; i32::fmt_decimal(6, __local_8); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: f > 5.0 "), used: 20 }); - String::append_char(__local_3, 102); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 102); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_13 = __local_4; f64::inspect_into(3, __local_13); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -918,8 +918,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -974,13 +974,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -988,25 +988,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1014,7 +1014,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1056,8 +1056,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1089,7 +1089,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1218,27 +1218,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1361,9 +1361,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1373,8 +1373,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1429,13 +1429,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1470,9 +1470,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1525,7 +1525,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1540,7 +1540,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1578,7 +1578,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l161; }; @@ -1736,20 +1736,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1759,10 +1759,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1772,10 +1772,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1783,10 +1783,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_inspect_if.wir.wado b/wado-compiler/tests/fixtures.golden/assert_inspect_if.wir.wado index 2ab0e06b1..5a590e5c7 100644 --- a/wado-compiler/tests/fixtures.golden/assert_inspect_if.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_inspect_if.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,33 +100,33 @@ fn run() with Stdout, Stderr { let __local_15: ref Formatter; "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_if.wado"), used: 51 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_if.wado"), used: 51 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(7, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: if x > 0 { x * 2; } else { 0; } > limit "), used: 52 }); - String::append_char(__local_4, 108); - String::append_char(__local_4, 105); - String::append_char(__local_4, 109); - String::append_char(__local_4, 105); - String::append_char(__local_4, 116); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 108); + String::push(__local_4, 105); + String::push(__local_4, 109); + String::push(__local_4, 105); + String::push(__local_4, 116); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(10, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -328,7 +328,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -343,7 +343,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -381,7 +381,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -415,20 +415,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -438,10 +438,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -451,10 +451,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -462,10 +462,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_inspect_matches.wir.wado b/wado-compiler/tests/fixtures.golden/assert_inspect_matches.wir.wado index 1201c22b0..46c8452f9 100644 --- a/wado-compiler/tests/fixtures.golden/assert_inspect_matches.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_inspect_matches.wir.wado @@ -85,9 +85,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -132,19 +132,19 @@ fn run() with Stdout, Stderr { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_2, 114); - String::append_char(__local_2, 117); - String::append_char(__local_2, 110); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_matches.wado"), used: 56 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_2, 114); + String::push(__local_2, 117); + String::push(__local_2, 110); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_matches.wado"), used: 56 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(12, __local_3); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: s matches { Rectangle(_) } "), used: 39 }); break __tmpl: __local_2; @@ -349,7 +349,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -364,7 +364,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -402,7 +402,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -436,20 +436,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -459,10 +459,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -472,10 +472,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -483,10 +483,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_inspect_mut_ref.wir.wado b/wado-compiler/tests/fixtures.golden/assert_inspect_mut_ref.wir.wado index ae8408a23..dee7b9e21 100644 --- a/wado-compiler/tests/fixtures.golden/assert_inspect_mut_ref.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_inspect_mut_ref.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -117,43 +117,43 @@ fn run() with Stdout, Stderr { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_mut_ref.wado"), used: 56 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_5, 114); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_mut_ref.wado"), used: 56 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(7, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: *mr == 99 "), used: 22 }); - String::append_char(__local_5, 109); - String::append_char(__local_5, 114); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 109); + String::push(__local_5, 114); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_15 = __v0; __local_16 = __local_6; __local_19 = String { repr: array.new_data("&mut "), used: 5 }; - String::append(__local_16.buf, __local_19); + String::push_str(__local_16.buf, __local_19); __local_17 = __local_15; i32::fmt_decimal(__local_17.value, __local_16); - String::append_char(__local_5, 10); - String::append_char(__local_5, 42); - String::append_char(__local_5, 109); - String::append_char(__local_5, 114); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 10); + String::push(__local_5, 42); + String::push(__local_5, 109); + String::push(__local_5, 114); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_26 = __local_6; i32::fmt_decimal(__v1, __local_26); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -356,7 +356,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -371,7 +371,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -409,7 +409,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -443,20 +443,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -466,10 +466,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -479,10 +479,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -490,10 +490,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_inspect_ref.wir.wado b/wado-compiler/tests/fixtures.golden/assert_inspect_ref.wir.wado index 166a31a56..d1c81be74 100644 --- a/wado-compiler/tests/fixtures.golden/assert_inspect_ref.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_inspect_ref.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -116,40 +116,40 @@ fn run() with Stdout, Stderr { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_ref.wado"), used: 52 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_5, 114); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_ref.wado"), used: 52 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(7, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: *r == 99 "), used: 21 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 114); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_16 = __local_6; __local_19 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_16.buf, __local_19); + String::push_str(__local_16.buf, __local_19); __local_17 = __v0; i32::fmt_decimal(__local_17.value, __local_16); - String::append_char(__local_5, 10); - String::append_char(__local_5, 42); - String::append_char(__local_5, 114); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 10); + String::push(__local_5, 42); + String::push(__local_5, 114); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_26 = __local_6; i32::fmt_decimal(__v1, __local_26); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -352,7 +352,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -367,7 +367,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -405,7 +405,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -439,20 +439,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -462,10 +462,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -475,10 +475,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -486,10 +486,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_inspect_string.wir.wado b/wado-compiler/tests/fixtures.golden/assert_inspect_string.wir.wado index 6cf7d268e..3dffabdec 100644 --- a/wado-compiler/tests/fixtures.golden/assert_inspect_string.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_inspect_string.wir.wado @@ -70,13 +70,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -120,28 +120,28 @@ fn run() with Stdout, Stderr { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_string.wado"), used: 55 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_3, 114); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_string.wado"), used: 55 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(6, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: s == \"hello\" "), used: 25 }); - String::append_char(__local_3, 115); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 115); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -344,7 +344,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -432,7 +432,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -470,7 +470,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l33; }; @@ -504,20 +504,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -527,10 +527,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -540,10 +540,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -551,10 +551,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -566,7 +566,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -583,22 +583,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b52; @@ -606,7 +606,7 @@ fn String^Inspect::inspect(self, f) { continue l53; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/assert_inspect_struct.wir.wado b/wado-compiler/tests/fixtures.golden/assert_inspect_struct.wir.wado index 14d9fa1b2..a4fdb03e4 100644 --- a/wado-compiler/tests/fixtures.golden/assert_inspect_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_inspect_struct.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,31 +100,31 @@ fn run() with Stdout, Stderr { let __local_14: ref Formatter; "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_struct.wado"), used: 55 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_3, 114); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_struct.wado"), used: 55 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(11, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: p.x > 10 "), used: 21 }); - String::append_char(__local_3, 112); - String::append_char(__local_3, 46); - String::append_char(__local_3, 120); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 112); + String::push(__local_3, 46); + String::push(__local_3, 120); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; i32::fmt_decimal(3, __local_14); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -326,7 +326,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -341,7 +341,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -379,7 +379,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -413,20 +413,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -449,10 +449,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -460,10 +460,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assert_inspect_variant.wir.wado b/wado-compiler/tests/fixtures.golden/assert_inspect_variant.wir.wado index b6ae0abe5..3255594fd 100644 --- a/wado-compiler/tests/fixtures.golden/assert_inspect_variant.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assert_inspect_variant.wir.wado @@ -74,9 +74,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -120,32 +120,32 @@ fn run() with Stdout, Stderr { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(146), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_variant.wado"), used: 56 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_5, 114); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/assert_inspect_variant.wado"), used: 56 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(7, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: v == expected "), used: 26 }); - String::append_char(__local_5, 118); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 118); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; Option^Inspect::inspect(v, __local_6); - String::append_char(__local_5, 10); - String::append(__local_5, String { repr: array.new_data("expected: "), used: 10 }); + String::push(__local_5, 10); + String::push_str(__local_5, String { repr: array.new_data("expected: "), used: 10 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; Option^Inspect::inspect(expected, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -348,7 +348,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -363,7 +363,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -396,13 +396,13 @@ fn Option^Inspect::inspect(self, f) { let __local_11: ref String; if ref.test Option::Some(self) { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); i32::fmt_decimal(ref.cast Option::Some(self).payload_0, f); __local_9 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); } else if self.discriminant == 1 { __local_11 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_11); + String::push_str(f.buf, __local_11); }; } @@ -453,7 +453,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l32; }; @@ -487,20 +487,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -510,10 +510,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -523,10 +523,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -534,10 +534,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/assoc_type_generic_param_projection.wir.wado b/wado-compiler/tests/fixtures.golden/assoc_type_generic_param_projection.wir.wado index 99b4d2af5..cbf071c3b 100644 --- a/wado-compiler/tests/fixtures.golden/assoc_type_generic_param_projection.wir.wado +++ b/wado-compiler/tests/fixtures.golden/assoc_type_generic_param_projection.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -304,7 +304,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -319,7 +319,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -357,7 +357,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -391,20 +391,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -414,10 +414,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -427,10 +427,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -438,10 +438,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/associated_const.wir.wado b/wado-compiler/tests/fixtures.golden/associated_const.wir.wado index f0e704cfe..ac71b7706 100644 --- a/wado-compiler/tests/fixtures.golden/associated_const.wir.wado +++ b/wado-compiler/tests/fixtures.golden/associated_const.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -138,112 +138,112 @@ fn associated_const_integers() with Stdout { let __local_31: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_0, String { repr: array.new_data("i8::MAX = "), used: 10 }); + String::push_str(__local_0, String { repr: array.new_data("i8::MAX = "), used: 10 }); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(127, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_2, String { repr: array.new_data("i8::MIN = "), used: 10 }); + String::push_str(__local_2, String { repr: array.new_data("i8::MIN = "), used: 10 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(-128, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_4, String { repr: array.new_data("u8::MAX = "), used: 10 }); + String::push_str(__local_4, String { repr: array.new_data("u8::MAX = "), used: 10 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(255, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_6, String { repr: array.new_data("u8::MIN = "), used: 10 }); + String::push_str(__local_6, String { repr: array.new_data("u8::MIN = "), used: 10 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(0, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_8, String { repr: array.new_data("i16::MAX = "), used: 11 }); + String::push_str(__local_8, String { repr: array.new_data("i16::MAX = "), used: 11 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(32767, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_10, String { repr: array.new_data("i16::MIN = "), used: 11 }); + String::push_str(__local_10, String { repr: array.new_data("i16::MIN = "), used: 11 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(-32768, __local_11); break __tmpl: __local_10; }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_12, String { repr: array.new_data("u16::MAX = "), used: 11 }); + String::push_str(__local_12, String { repr: array.new_data("u16::MAX = "), used: 11 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(65535, __local_13); break __tmpl: __local_12; }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_14, String { repr: array.new_data("u16::MIN = "), used: 11 }); + String::push_str(__local_14, String { repr: array.new_data("u16::MIN = "), used: 11 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(0, __local_15); break __tmpl: __local_14; }); "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_16, String { repr: array.new_data("i32::MAX = "), used: 11 }); + String::push_str(__local_16, String { repr: array.new_data("i32::MAX = "), used: 11 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(2147483647, __local_17); break __tmpl: __local_16; }); "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_18, String { repr: array.new_data("i32::MIN = "), used: 11 }); + String::push_str(__local_18, String { repr: array.new_data("i32::MIN = "), used: 11 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(-2147483648, __local_19); break __tmpl: __local_18; }); "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_20, String { repr: array.new_data("u32::MAX = "), used: 11 }); + String::push_str(__local_20, String { repr: array.new_data("u32::MAX = "), used: 11 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; u32::fmt_decimal(-1, __local_21); break __tmpl: __local_20; }); "core:cli/println"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_22, String { repr: array.new_data("u32::MIN = "), used: 11 }); + String::push_str(__local_22, String { repr: array.new_data("u32::MIN = "), used: 11 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; u32::fmt_decimal(0, __local_23); break __tmpl: __local_22; }); "core:cli/println"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_24, String { repr: array.new_data("i64::MAX = "), used: 11 }); + String::push_str(__local_24, String { repr: array.new_data("i64::MAX = "), used: 11 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i64::fmt_decimal(9223372036854775807_i64, __local_25); break __tmpl: __local_24; }); "core:cli/println"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_26, String { repr: array.new_data("i64::MIN = "), used: 11 }); + String::push_str(__local_26, String { repr: array.new_data("i64::MIN = "), used: 11 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; i64::fmt_decimal(-9223372036854775808_i64, __local_27); break __tmpl: __local_26; }); "core:cli/println"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_28, String { repr: array.new_data("u64::MAX = "), used: 11 }); + String::push_str(__local_28, String { repr: array.new_data("u64::MAX = "), used: 11 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; u64::fmt_decimal(-1_i64, __local_29); break __tmpl: __local_28; }); "core:cli/println"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_30, String { repr: array.new_data("u64::MIN = "), used: 11 }); + String::push_str(__local_30, String { repr: array.new_data("u64::MIN = "), used: 11 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; u64::fmt_decimal(0_i64, __local_31); break __tmpl: __local_30; @@ -263,21 +263,21 @@ fn associated_const_user_defined() with Stdout { let __local_35: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(57), used: 0 }; - String::append_char(__local_2, 114); - String::append_char(__local_2, 101); - String::append_char(__local_2, 100); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 114); + String::push(__local_2, 101); + String::push(__local_2, 100); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_9 = __local_3; i32::fmt_decimal(255, __local_9); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_14 = __local_3; i32::fmt_decimal(0, __local_14); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_19 = __local_3; i32::fmt_decimal(0, __local_19); @@ -285,23 +285,23 @@ fn associated_const_user_defined() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(59), used: 0 }; - String::append_char(__local_4, 119); - String::append_char(__local_4, 104); - String::append_char(__local_4, 105); - String::append_char(__local_4, 116); - String::append_char(__local_4, 101); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 119); + String::push(__local_4, 104); + String::push(__local_4, 105); + String::push(__local_4, 116); + String::push(__local_4, 101); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_25 = __local_5; i32::fmt_decimal(255, __local_25); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); + String::push(__local_4, 44); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_30 = __local_5; i32::fmt_decimal(255, __local_30); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); + String::push(__local_4, 44); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_35 = __local_5; i32::fmt_decimal(255, __local_35); @@ -658,7 +658,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -673,7 +673,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -711,7 +711,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l38; }; @@ -745,20 +745,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -768,10 +768,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -781,10 +781,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -792,10 +792,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/associated_type_1.wir.wado b/wado-compiler/tests/fixtures.golden/associated_type_1.wir.wado index 096c72161..ab3e6cb42 100644 --- a/wado-compiler/tests/fixtures.golden/associated_type_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/associated_type_1.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,13 +102,13 @@ fn associated_type_basic() with Stdout { let __local_3: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 86); - String::append_char(__local_2, 97); - String::append_char(__local_2, 108); - String::append_char(__local_2, 117); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 86); + String::push(__local_2, 97); + String::push(__local_2, 108); + String::push(__local_2, 117); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(42, __local_3); break __tmpl: __local_2; @@ -120,13 +120,13 @@ fn associated_type_index_assign() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_1, 86); - String::append_char(__local_1, 97); - String::append_char(__local_1, 108); - String::append_char(__local_1, 117); - String::append_char(__local_1, 101); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 86); + String::push(__local_1, 97); + String::push(__local_1, 108); + String::push(__local_1, 117); + String::push(__local_1, 101); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(42, __local_2); break __tmpl: __local_1; @@ -334,7 +334,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -349,7 +349,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -387,7 +387,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -421,20 +421,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -444,10 +444,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -457,10 +457,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -468,10 +468,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/associated_type_2.wir.wado b/wado-compiler/tests/fixtures.golden/associated_type_2.wir.wado index d3a853cd4..0a4c03e58 100644 --- a/wado-compiler/tests/fixtures.golden/associated_type_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/associated_type_2.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,13 +102,13 @@ fn associated_type_index_mut() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_1, 86); - String::append_char(__local_1, 97); - String::append_char(__local_1, 108); - String::append_char(__local_1, 117); - String::append_char(__local_1, 101); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 86); + String::push(__local_1, 97); + String::push(__local_1, 108); + String::push(__local_1, 117); + String::push(__local_1, 101); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(2, __local_2); break __tmpl: __local_1; @@ -120,13 +120,13 @@ fn associated_type_index_trait() with Stdout { let __local_4: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_3, 86); - String::append_char(__local_3, 97); - String::append_char(__local_3, 108); - String::append_char(__local_3, 117); - String::append_char(__local_3, 101); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 86); + String::push(__local_3, 97); + String::push(__local_3, 108); + String::push(__local_3, 117); + String::push(__local_3, 101); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(42, __local_4); break __tmpl: __local_3; @@ -334,7 +334,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -349,7 +349,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -387,7 +387,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -421,20 +421,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -444,10 +444,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -457,10 +457,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -468,10 +468,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/auto_deref.wir.wado b/wado-compiler/tests/fixtures.golden/auto_deref.wir.wado index 0e285c7e5..72a8c8cb4 100644 --- a/wado-compiler/tests/fixtures.golden/auto_deref.wir.wado +++ b/wado-compiler/tests/fixtures.golden/auto_deref.wir.wado @@ -99,13 +99,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayRefIter^Iterator::next" = fn(ref "core:allocator/ArrayRefIter") -> ref null "core:internal/Box"; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -188,29 +188,29 @@ fn auto_deref_for_of() with Stdout { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("auto_deref_for_of"), used: 17 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("auto_deref_for_of"), used: 17 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_35 = __local_16; i32::fmt_decimal(39, __local_35); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: sum == 6 "), used: 21 }); - String::append_char(__local_15, 115); - String::append_char(__local_15, 117); - String::append_char(__local_15, 109); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 115); + String::push(__local_15, 117); + String::push(__local_15, 109); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_40 = __local_16; i32::fmt_decimal(__v0_6, __local_40); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -236,31 +236,31 @@ condition: sum == 6 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("auto_deref_for_of"), used: 17 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("auto_deref_for_of"), used: 17 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_48 = __local_18; i32::fmt_decimal(48, __local_48); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: count == 3 "), used: 23 }); - String::append_char(__local_17, 99); - String::append_char(__local_17, 111); - String::append_char(__local_17, 117); - String::append_char(__local_17, 110); - String::append_char(__local_17, 116); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 99); + String::push(__local_17, 111); + String::push(__local_17, 117); + String::push(__local_17, 110); + String::push(__local_17, 116); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_53 = __local_18; i32::fmt_decimal(__v0_13, __local_53); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -302,25 +302,25 @@ fn auto_deref_method() with Stdout { if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_39 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_39, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_39, String { repr: array.new_data("auto_deref_method"), used: 17 }); - String::append_char(__local_39, 32); - String::append_char(__local_39, 97); - String::append_char(__local_39, 116); - String::append_char(__local_39, 32); - String::append(__local_39, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); - String::append_char(__local_39, 58); + String::push_str(__local_39, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_39, String { repr: array.new_data("auto_deref_method"), used: 17 }); + String::push(__local_39, 32); + String::push(__local_39, 97); + String::push(__local_39, 116); + String::push(__local_39, 32); + String::push_str(__local_39, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); + String::push(__local_39, 58); __local_40 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_39 }; __local_93 = __local_40; i32::fmt_decimal(68, __local_93); - String::append(__local_39, String { repr: array.new_data(" + String::push_str(__local_39, String { repr: array.new_data(" condition: box_ref.get() == 42 "), used: 32 }); - String::append(__local_39, String { repr: array.new_data("box_ref.get(): "), used: 15 }); + String::push_str(__local_39, String { repr: array.new_data("box_ref.get(): "), used: 15 }); __local_40 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_39 }; __local_98 = __local_40; i32::fmt_decimal(__v0_11, __local_98); - String::append_char(__local_39, 10); + String::push(__local_39, 10); break __tmpl: __local_39; }); unreachable; @@ -331,25 +331,25 @@ condition: box_ref.get() == 42 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_41 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_41, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_41, String { repr: array.new_data("auto_deref_method"), used: 17 }); - String::append_char(__local_41, 32); - String::append_char(__local_41, 97); - String::append_char(__local_41, 116); - String::append_char(__local_41, 32); - String::append(__local_41, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); - String::append_char(__local_41, 58); + String::push_str(__local_41, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_41, String { repr: array.new_data("auto_deref_method"), used: 17 }); + String::push(__local_41, 32); + String::push(__local_41, 97); + String::push(__local_41, 116); + String::push(__local_41, 32); + String::push_str(__local_41, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); + String::push(__local_41, 58); __local_42 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_41 }; __local_106 = __local_42; i32::fmt_decimal(74, __local_106); - String::append(__local_41, String { repr: array.new_data(" + String::push_str(__local_41, String { repr: array.new_data(" condition: inner.len() == 5 "), used: 29 }); - String::append(__local_41, String { repr: array.new_data("inner.len(): "), used: 13 }); + String::push_str(__local_41, String { repr: array.new_data("inner.len(): "), used: 13 }); __local_42 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_41 }; __local_111 = __local_42; i32::fmt_decimal(__v0_16, __local_111); - String::append_char(__local_41, 10); + String::push(__local_41, 10); break __tmpl: __local_41; }); unreachable; @@ -360,25 +360,25 @@ condition: inner.len() == 5 if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_43 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_43, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_43, String { repr: array.new_data("auto_deref_method"), used: 17 }); - String::append_char(__local_43, 32); - String::append_char(__local_43, 97); - String::append_char(__local_43, 116); - String::append_char(__local_43, 32); - String::append(__local_43, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); - String::append_char(__local_43, 58); + String::push_str(__local_43, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_43, String { repr: array.new_data("auto_deref_method"), used: 17 }); + String::push(__local_43, 32); + String::push(__local_43, 97); + String::push(__local_43, 116); + String::push(__local_43, 32); + String::push_str(__local_43, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); + String::push(__local_43, 58); __local_44 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_43 }; __local_118 = __local_44; i32::fmt_decimal(79, __local_118); - String::append(__local_43, String { repr: array.new_data(" + String::push_str(__local_43, String { repr: array.new_data(" condition: s_ref.len() == 5 "), used: 29 }); - String::append(__local_43, String { repr: array.new_data("s_ref.len(): "), used: 13 }); + String::push_str(__local_43, String { repr: array.new_data("s_ref.len(): "), used: 13 }); __local_44 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_43 }; __local_123 = __local_44; i32::fmt_decimal(__v0_20, __local_123); - String::append_char(__local_43, 10); + String::push(__local_43, 10); break __tmpl: __local_43; }); unreachable; @@ -394,27 +394,27 @@ condition: s_ref.len() == 5 if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_45 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_45, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_45, String { repr: array.new_data("auto_deref_method"), used: 17 }); - String::append_char(__local_45, 32); - String::append_char(__local_45, 97); - String::append_char(__local_45, 116); - String::append_char(__local_45, 32); - String::append(__local_45, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); - String::append_char(__local_45, 58); + String::push_str(__local_45, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_45, String { repr: array.new_data("auto_deref_method"), used: 17 }); + String::push(__local_45, 32); + String::push(__local_45, 97); + String::push(__local_45, 116); + String::push(__local_45, 32); + String::push_str(__local_45, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref.wado"), used: 44 }); + String::push(__local_45, 58); __local_46 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_45 }; __local_132 = __local_46; i32::fmt_decimal(83, __local_132); - String::append(__local_45, String { repr: array.new_data(" + String::push_str(__local_45, String { repr: array.new_data(" condition: b == 'h' as u8 "), used: 27 }); - String::append_char(__local_45, 98); - String::append_char(__local_45, 58); - String::append_char(__local_45, 32); + String::push(__local_45, 98); + String::push(__local_45, 58); + String::push(__local_45, 32); __local_46 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_45 }; __local_137 = __local_46; i32::fmt_decimal(byte, __local_137); - String::append_char(__local_45, 10); + String::push(__local_45, 10); break __tmpl: __local_45; }); unreachable; @@ -662,7 +662,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -721,7 +721,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -758,7 +758,7 @@ fn ArrayRefIter^Iterator::next(self) { return val; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -811,7 +811,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l46; }; @@ -845,20 +845,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -868,10 +868,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -881,10 +881,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -892,10 +892,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/auto_deref_template.wir.wado b/wado-compiler/tests/fixtures.golden/auto_deref_template.wir.wado index 50e91216e..45ef03b16 100644 --- a/wado-compiler/tests/fixtures.golden/auto_deref_template.wir.wado +++ b/wado-compiler/tests/fixtures.golden/auto_deref_template.wir.wado @@ -86,13 +86,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -168,13 +168,13 @@ fn run() with Stdout { rx = x; s1 = __tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_19, 118); - String::append_char(__local_19, 97); - String::append_char(__local_19, 108); - String::append_char(__local_19, 117); - String::append_char(__local_19, 101); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 118); + String::push(__local_19, 97); + String::push(__local_19, 108); + String::push(__local_19, 117); + String::push(__local_19, 101); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; i32::fmt_decimal(rx.value, __local_20); break __tmpl: __local_19; @@ -184,29 +184,29 @@ fn run() with Stdout { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 114); - String::append_char(__local_21, 117); - String::append_char(__local_21, 110); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref_template.wado"), used: 53 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 114); + String::push(__local_21, 117); + String::push(__local_21, 110); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref_template.wado"), used: 53 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_44 = __local_22; i32::fmt_decimal(14, __local_44); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: s1 == \"value: 42\" "), used: 30 }); - String::append_char(__local_21, 115); - String::append_char(__local_21, 49); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 115); + String::push(__local_21, 49); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; String^Inspect::inspect(__v0_3, __local_22); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -214,14 +214,14 @@ condition: s1 == \"value: 42\" rrx = rx; s2 = __tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_23, 100); - String::append_char(__local_23, 111); - String::append_char(__local_23, 117); - String::append_char(__local_23, 98); - String::append_char(__local_23, 108); - String::append_char(__local_23, 101); - String::append_char(__local_23, 58); - String::append_char(__local_23, 32); + String::push(__local_23, 100); + String::push(__local_23, 111); + String::push(__local_23, 117); + String::push(__local_23, 98); + String::push(__local_23, 108); + String::push(__local_23, 101); + String::push(__local_23, 58); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; i32::fmt_decimal(rrx.value, __local_24); break __tmpl: __local_23; @@ -231,29 +231,29 @@ condition: s1 == \"value: 42\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_25, 114); - String::append_char(__local_25, 117); - String::append_char(__local_25, 110); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref_template.wado"), used: 53 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_25, 114); + String::push(__local_25, 117); + String::push(__local_25, 110); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref_template.wado"), used: 53 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_57 = __local_26; i32::fmt_decimal(19, __local_57); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: s2 == \"double: 42\" "), used: 31 }); - String::append_char(__local_25, 115); - String::append_char(__local_25, 50); - String::append_char(__local_25, 58); - String::append_char(__local_25, 32); + String::push(__local_25, 115); + String::push(__local_25, 50); + String::push(__local_25, 58); + String::push(__local_25, 32); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; String^Inspect::inspect(__v0_7, __local_26); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -261,13 +261,13 @@ condition: s2 == \"double: 42\" name = String { repr: array.new_data("Alice"), used: 5 }; s3 = __tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_27, 104); - String::append_char(__local_27, 101); - String::append_char(__local_27, 108); - String::append_char(__local_27, 108); - String::append_char(__local_27, 111); - String::append_char(__local_27, 32); - String::append(__local_27, name); + String::push(__local_27, 104); + String::push(__local_27, 101); + String::push(__local_27, 108); + String::push(__local_27, 108); + String::push(__local_27, 111); + String::push(__local_27, 32); + String::push_str(__local_27, name); break __tmpl: __local_27; }; __v0_12 = s3; @@ -275,29 +275,29 @@ condition: s2 == \"double: 42\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_28, 114); - String::append_char(__local_28, 117); - String::append_char(__local_28, 110); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref_template.wado"), used: 53 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_28, 114); + String::push(__local_28, 117); + String::push(__local_28, 110); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref_template.wado"), used: 53 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_65 = __local_29; i32::fmt_decimal(25, __local_65); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: s3 == \"hello Alice\" "), used: 32 }); - String::append_char(__local_28, 115); - String::append_char(__local_28, 51); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 115); + String::push(__local_28, 51); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; String^Inspect::inspect(__v0_12, __local_29); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -306,12 +306,12 @@ condition: s3 == \"hello Alice\" rb = b; s4 = __tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_30, 102); - String::append_char(__local_30, 108); - String::append_char(__local_30, 97); - String::append_char(__local_30, 103); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 102); + String::push(__local_30, 108); + String::push(__local_30, 97); + String::push(__local_30, 103); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; Formatter::pad(__local_31, if rb.value -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -325,29 +325,29 @@ condition: s3 == \"hello Alice\" if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_32, 114); - String::append_char(__local_32, 117); - String::append_char(__local_32, 110); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref_template.wado"), used: 53 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_32, 114); + String::push(__local_32, 117); + String::push(__local_32, 110); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/auto_deref_template.wado"), used: 53 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_78 = __local_33; i32::fmt_decimal(31, __local_78); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: s4 == \"flag: true\" "), used: 31 }); - String::append_char(__local_32, 115); - String::append_char(__local_32, 52); - String::append_char(__local_32, 58); - String::append_char(__local_32, 32); + String::push(__local_32, 115); + String::push(__local_32, 52); + String::push(__local_32, 58); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; String^Inspect::inspect(__v0_17, __local_33); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -587,7 +587,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -675,7 +675,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -713,7 +713,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l38; }; @@ -733,7 +733,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -741,17 +741,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -781,20 +781,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -804,10 +804,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -817,10 +817,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -828,10 +828,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -843,7 +843,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -860,22 +860,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b61; @@ -883,7 +883,7 @@ fn String^Inspect::inspect(self, f) { continue l62; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/base64_decode.wir.wado b/wado-compiler/tests/fixtures.golden/base64_decode.wir.wado index 7eca6cba6..0acb106a0 100644 --- a/wado-compiler/tests/fixtures.golden/base64_decode.wir.wado +++ b/wado-compiler/tests/fixtures.golden/base64_decode.wir.wado @@ -87,7 +87,7 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/core:base64/Array::append" = fn(ref Array, u8); +type "functype/core:base64/Array::push" = fn(ref Array, u8); type "functype/core:base64/Array::grow" = fn(ref Array); @@ -95,17 +95,17 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/StrUtf8ByteIter^Iterator::collect" = fn(ref StrUtf8ByteIter) -> ref Array; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -217,19 +217,19 @@ fn run() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 114); - String::append_char(__local_19, 117); - String::append_char(__local_19, 110); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 114); + String::push(__local_19, 117); + String::push(__local_19, 110); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; i32::fmt_decimal(8, __local_20); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: decode(\"SGVsbG8=\") matches { Some(d) && d == hello } "), used: 65 }); break __tmpl: __local_19; @@ -252,19 +252,19 @@ condition: decode(\"SGVsbG8=\") matches { Some(d) && d == hello } if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 114); - String::append_char(__local_21, 117); - String::append_char(__local_21, 110); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 114); + String::push(__local_21, 117); + String::push(__local_21, 110); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; i32::fmt_decimal(11, __local_22); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: decode(\"SGVsbG8\") matches { Some(d) && d == hello } "), used: 64 }); break __tmpl: __local_21; @@ -287,19 +287,19 @@ condition: decode(\"SGVsbG8\") matches { Some(d) && d == hello } if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_23, 114); - String::append_char(__local_23, 117); - String::append_char(__local_23, 110); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_23, 114); + String::push(__local_23, 117); + String::push(__local_23, 110); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; i32::fmt_decimal(14, __local_24); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: decode(\"\") matches { Some(d) && d.len() == 0 } "), used: 59 }); break __tmpl: __local_23; @@ -327,19 +327,19 @@ condition: decode(\"\") matches { Some(d) && d.len() == 0 } if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_25, 114); - String::append_char(__local_25, 117); - String::append_char(__local_25, 110); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_25, 114); + String::push(__local_25, 117); + String::push(__local_25, 110); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; i32::fmt_decimal(18, __local_26); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: decode(encode(&data)) matches { Some(d) && d == data } "), used: 67 }); break __tmpl: __local_25; @@ -363,19 +363,19 @@ condition: decode(encode(&data)) matches { Some(d) && d == data } if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_27, 114); - String::append_char(__local_27, 117); - String::append_char(__local_27, 110); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_27, 114); + String::push(__local_27, 117); + String::push(__local_27, 110); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; i32::fmt_decimal(21, __local_28); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: decode(encode_url(&data)) matches { Some(d) && d == data } "), used: 71 }); break __tmpl: __local_27; @@ -401,19 +401,19 @@ condition: decode(encode_url(&data)) matches { Some(d) && d == data } if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_29, 114); - String::append_char(__local_29, 117); - String::append_char(__local_29, 110); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_29, 114); + String::push(__local_29, 117); + String::push(__local_29, 110); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; i32::fmt_decimal(25, __local_30); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: decode_bytes(&raw) matches { Some(d) && d == hello } "), used: 65 }); break __tmpl: __local_29; @@ -435,19 +435,19 @@ condition: decode_bytes(&raw) matches { Some(d) && d == hello } if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_31, 114); - String::append_char(__local_31, 117); - String::append_char(__local_31, 110); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_31, 114); + String::push(__local_31, 117); + String::push(__local_31, 110); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; i32::fmt_decimal(28, __local_32); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: decode(\"abc+def_ghi\") matches { Some(_) } "), used: 54 }); break __tmpl: __local_31; @@ -467,19 +467,19 @@ condition: decode(\"abc+def_ghi\") matches { Some(_) } if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_33, 114); - String::append_char(__local_33, 117); - String::append_char(__local_33, 110); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_33, 114); + String::push(__local_33, 117); + String::push(__local_33, 110); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; i32::fmt_decimal(31, __local_34); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: decode(\"!!!\") matches { None } "), used: 43 }); break __tmpl: __local_33; @@ -499,19 +499,19 @@ condition: decode(\"!!!\") matches { None } if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_35 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_35, 114); - String::append_char(__local_35, 117); - String::append_char(__local_35, 110); - String::append_char(__local_35, 32); - String::append_char(__local_35, 97); - String::append_char(__local_35, 116); - String::append_char(__local_35, 32); - String::append(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); - String::append_char(__local_35, 58); + String::push_str(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_35, 114); + String::push(__local_35, 117); + String::push(__local_35, 110); + String::push(__local_35, 32); + String::push(__local_35, 97); + String::push(__local_35, 116); + String::push(__local_35, 32); + String::push_str(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_decode.wado"), used: 47 }); + String::push(__local_35, 58); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; i32::fmt_decimal(32, __local_36); - String::append(__local_35, String { repr: array.new_data(" + String::push_str(__local_35, String { repr: array.new_data(" condition: decode(\"A\") matches { None } "), used: 41 }); break __tmpl: __local_35; @@ -718,7 +718,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_4: builtin::array_get(_licm_repr_46, __local_20); }; - String::append_char(out, __inline_Array_u8__IndexValue__index_value_5: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_5: block -> u8 { __local_22 = (b0_7 >> 2) & 63; if __local_22 >= _licm_used_47 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -726,7 +726,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_5: builtin::array_get(_licm_repr_48, __local_22); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_6: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_6: block -> u8 { __local_24 = ((b0_7 << 4) | (b1_8 >> 4)) & 63; if __local_24 >= _licm_used_47 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -734,7 +734,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_6: builtin::array_get(_licm_repr_48, __local_24); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_7: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_7: block -> u8 { __local_26 = ((b1_8 << 2) | (b2 >> 6)) & 63; if __local_26 >= _licm_used_47 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -742,7 +742,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_7: builtin::array_get(_licm_repr_48, __local_26); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_8: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_8: block -> u8 { __local_28 = b2 & 63; if __local_28 >= _licm_used_47 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -763,7 +763,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_9: builtin::array_get(data.repr, __local_30); }; - String::append_char(out, __inline_Array_u8__IndexValue__index_value_10: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_10: block -> u8 { __local_32 = (b0_10 >> 2) & 63; if __local_32 >= table.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -771,7 +771,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_10: builtin::array_get(table.repr, __local_32); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_11: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_11: block -> u8 { __local_34 = (b0_10 << 4) & 63; if __local_34 >= table.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -780,8 +780,8 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 break __inline_Array_u8__IndexValue__index_value_11: builtin::array_get(table.repr, __local_34); }); if pad { - String::append_char(out, 61); - String::append_char(out, 61); + String::push(out, 61); + String::push(out, 61); }; } else if remainder == 2 { b0_11 = __inline_Array_u8__IndexValue__index_value_12: block -> u8 { @@ -800,7 +800,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_13: builtin::array_get(data.repr, __local_38); }; - String::append_char(out, __inline_Array_u8__IndexValue__index_value_14: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_14: block -> u8 { __local_40 = (b0_11 >> 2) & 63; if __local_40 >= table.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -808,7 +808,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_14: builtin::array_get(table.repr, __local_40); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_15: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_15: block -> u8 { __local_42 = ((b0_11 << 4) | (b1_12 >> 4)) & 63; if __local_42 >= table.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -816,7 +816,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_15: builtin::array_get(table.repr, __local_42); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_16: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_16: block -> u8 { __local_44 = (b1_12 << 2) & 63; if __local_44 >= table.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -825,7 +825,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 break __inline_Array_u8__IndexValue__index_value_16: builtin::array_get(table.repr, __local_44); }); if pad { - String::append_char(out, 61); + String::push(out, 61); }; }; return out; @@ -998,9 +998,9 @@ fn "core:base64/decode_impl"(input, input_len) { // from core:base64 } { return ref.null none; }; - "core:base64/Array::append"(out, ((v0_9 << 2) | (v1_10 >> 4)) & 255); - "core:base64/Array::append"(out, (((v1_10 & 15) << 4) | (v2_11 >> 2)) & 255); - "core:base64/Array::append"(out, (((v2_11 & 3) << 6) | v3) & 255); + "core:base64/Array::push"(out, ((v0_9 << 2) | (v1_10 >> 4)) & 255); + "core:base64/Array::push"(out, (((v1_10 & 15) << 4) | (v2_11 >> 2)) & 255); + "core:base64/Array::push"(out, (((v2_11 & 3) << 6) | v3) & 255); i = i + 4; continue l68; }; @@ -1043,7 +1043,7 @@ fn "core:base64/decode_impl"(input, input_len) { // from core:base64 } { return ref.null none; }; - "core:base64/Array::append"(out, ((v0_13 << 2) | (v1_14 >> 4)) & 255); + "core:base64/Array::push"(out, ((v0_13 << 2) | (v1_14 >> 4)) & 255); } else if remainder == 3 { v0_15 = __inline_Array_u8__IndexValue__index_value_15: block -> u8 { __local_48 = __inline_Array_u8__IndexValue__index_value_14: block -> u8 { @@ -1101,8 +1101,8 @@ fn "core:base64/decode_impl"(input, input_len) { // from core:base64 } { return ref.null none; }; - "core:base64/Array::append"(out, ((v0_15 << 2) | (v1_16 >> 4)) & 255); - "core:base64/Array::append"(out, (((v1_16 & 15) << 4) | (v2_17 >> 2)) & 255); + "core:base64/Array::push"(out, ((v0_15 << 2) | (v1_16 >> 4)) & 255); + "core:base64/Array::push"(out, (((v1_16 & 15) << 4) | (v2_17 >> 2)) & 255); }; return out; } @@ -1290,7 +1290,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn "core:base64/Array::append"(self, value) { // from core:base64 +fn "core:base64/Array::push"(self, value) { // from core:base64 let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1386,7 +1386,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1426,7 +1426,7 @@ fn StrUtf8ByteIter^Iterator::collect(self) { }; byte = builtin::array_get_u8(_licm_repr_12, _hfs_index_13); _hfs_index_13 = _hfs_index_13 + 1; - Array::append(result, byte); + Array::push(result, byte); self.index = _hfs_index_13; break __fused___inline_StrUtf8ByteIter_Iterator__next_3; }; @@ -1437,7 +1437,7 @@ fn StrUtf8ByteIter^Iterator::collect(self) { return result; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1464,7 +1464,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1506,7 +1506,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1556,7 +1556,7 @@ fn Array^Eq::eq(self, other) { if self.used != other.used { return 0; }; - __for_3: block { + __for_9: block { i = 0; _licm_used_3 = self.used; _licm_repr_4 = self.repr; @@ -1564,7 +1564,7 @@ fn Array^Eq::eq(self, other) { block { l139: loop { if (i < _licm_used_3) == 0 { - break __for_3; + break __for_9; }; if (builtin::array_get(_licm_repr_4, i) == builtin::array_get(_licm_repr_5, i)) == 0 { return 0; @@ -1588,7 +1588,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l143; }; @@ -1622,20 +1622,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1645,10 +1645,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1658,10 +1658,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1669,10 +1669,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/base64_encode.wir.wado b/wado-compiler/tests/fixtures.golden/base64_encode.wir.wado index 15b9576aa..277fb1622 100644 --- a/wado-compiler/tests/fixtures.golden/base64_encode.wir.wado +++ b/wado-compiler/tests/fixtures.golden/base64_encode.wir.wado @@ -91,7 +91,7 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/core:base64/Array::append" = fn(ref Array, u8); +type "functype/core:base64/Array::push" = fn(ref Array, u8); type "functype/core:base64/Array::grow" = fn(ref Array); @@ -99,7 +99,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -107,9 +107,9 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/StrUtf8ByteIter^Iterator::collect" = fn(ref StrUtf8ByteIter) -> ref Array; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -223,26 +223,26 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_50 = __local_23; i32::fmt_decimal(8, __local_50); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: encode(&empty) == \"\" "), used: 33 }); - String::append(__local_22, String { repr: array.new_data("encode(&empty): "), used: 16 }); + String::push_str(__local_22, String { repr: array.new_data("encode(&empty): "), used: 16 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; String^Inspect::inspect(__v0_2, __local_23); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -257,26 +257,26 @@ condition: encode(&empty) == \"\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(175), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_59 = __local_25; i32::fmt_decimal(10, __local_59); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: encode(&\"f\".bytes().collect()) == \"Zg==\" "), used: 53 }); - String::append(__local_24, String { repr: array.new_data("encode(&\"f\".bytes().collect()): "), used: 32 }); + String::push_str(__local_24, String { repr: array.new_data("encode(&\"f\".bytes().collect()): "), used: 32 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; String^Inspect::inspect(__v0_4, __local_25); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -291,26 +291,26 @@ condition: encode(&\"f\".bytes().collect()) == \"Zg==\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(177), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_26, 114); - String::append_char(__local_26, 117); - String::append_char(__local_26, 110); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_26, 114); + String::push(__local_26, 117); + String::push(__local_26, 110); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_68 = __local_27; i32::fmt_decimal(11, __local_68); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: encode(&\"fo\".bytes().collect()) == \"Zm8=\" "), used: 54 }); - String::append(__local_26, String { repr: array.new_data("encode(&\"fo\".bytes().collect()): "), used: 33 }); + String::push_str(__local_26, String { repr: array.new_data("encode(&\"fo\".bytes().collect()): "), used: 33 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; String^Inspect::inspect(__v0_6, __local_27); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -325,26 +325,26 @@ condition: encode(&\"fo\".bytes().collect()) == \"Zm8=\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(179), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_28, 114); - String::append_char(__local_28, 117); - String::append_char(__local_28, 110); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_28, 114); + String::push(__local_28, 117); + String::push(__local_28, 110); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_77 = __local_29; i32::fmt_decimal(12, __local_77); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: encode(&\"foo\".bytes().collect()) == \"Zm9v\" "), used: 55 }); - String::append(__local_28, String { repr: array.new_data("encode(&\"foo\".bytes().collect()): "), used: 34 }); + String::push_str(__local_28, String { repr: array.new_data("encode(&\"foo\".bytes().collect()): "), used: 34 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; String^Inspect::inspect(__v0_8, __local_29); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -359,26 +359,26 @@ condition: encode(&\"foo\".bytes().collect()) == \"Zm9v\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(185), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_30, 114); - String::append_char(__local_30, 117); - String::append_char(__local_30, 110); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_30, 114); + String::push(__local_30, 117); + String::push(__local_30, 110); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_86 = __local_31; i32::fmt_decimal(13, __local_86); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: encode(&\"foob\".bytes().collect()) == \"Zm9vYg==\" "), used: 60 }); - String::append(__local_30, String { repr: array.new_data("encode(&\"foob\".bytes().collect()): "), used: 35 }); + String::push_str(__local_30, String { repr: array.new_data("encode(&\"foob\".bytes().collect()): "), used: 35 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; String^Inspect::inspect(__v0_10, __local_31); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -393,26 +393,26 @@ condition: encode(&\"foob\".bytes().collect()) == \"Zm9vYg==\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(187), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_32, 114); - String::append_char(__local_32, 117); - String::append_char(__local_32, 110); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_32, 114); + String::push(__local_32, 117); + String::push(__local_32, 110); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_95 = __local_33; i32::fmt_decimal(14, __local_95); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: encode(&\"fooba\".bytes().collect()) == \"Zm9vYmE=\" "), used: 61 }); - String::append(__local_32, String { repr: array.new_data("encode(&\"fooba\".bytes().collect()): "), used: 36 }); + String::push_str(__local_32, String { repr: array.new_data("encode(&\"fooba\".bytes().collect()): "), used: 36 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; String^Inspect::inspect(__v0_12, __local_33); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -427,26 +427,26 @@ condition: encode(&\"fooba\".bytes().collect()) == \"Zm9vYmE=\" if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(189), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_34, 114); - String::append_char(__local_34, 117); - String::append_char(__local_34, 110); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_34, 114); + String::push(__local_34, 117); + String::push(__local_34, 110); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_104 = __local_35; i32::fmt_decimal(15, __local_104); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: encode(&\"foobar\".bytes().collect()) == \"Zm9vYmFy\" "), used: 62 }); - String::append(__local_34, String { repr: array.new_data("encode(&\"foobar\".bytes().collect()): "), used: 37 }); + String::push_str(__local_34, String { repr: array.new_data("encode(&\"foobar\".bytes().collect()): "), used: 37 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; String^Inspect::inspect(__v0_14, __local_35); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -461,26 +461,26 @@ condition: encode(&\"foobar\".bytes().collect()) == \"Zm9vYmFy\" if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(194), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_36, 114); - String::append_char(__local_36, 117); - String::append_char(__local_36, 110); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_36, 114); + String::push(__local_36, 117); + String::push(__local_36, 110); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_113 = __local_37; i32::fmt_decimal(18, __local_113); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: encode_url(&\"Hello\".bytes().collect()) == \"SGVsbG8\" "), used: 64 }); - String::append(__local_36, String { repr: array.new_data("encode_url(&\"Hello\".bytes().collect()): "), used: 40 }); + String::push_str(__local_36, String { repr: array.new_data("encode_url(&\"Hello\".bytes().collect()): "), used: 40 }); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; String^Inspect::inspect(__v0_16, __local_37); - String::append_char(__local_36, 10); + String::push(__local_36, 10); break __tmpl: __local_36; }); unreachable; @@ -492,26 +492,26 @@ condition: encode_url(&\"Hello\".bytes().collect()) == \"SGVsbG8\" if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(238), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_38, 114); - String::append_char(__local_38, 117); - String::append_char(__local_38, 110); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_38, 114); + String::push(__local_38, 117); + String::push(__local_38, 110); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_121 = __local_39; i32::fmt_decimal(21, __local_121); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: encode_with(&\"Hello\".bytes().collect(), Encoding::NoPadding) == \"SGVsbG8\" "), used: 86 }); - String::append(__local_38, String { repr: array.new_data("encode_with(&\"Hello\".bytes().collect(), Encoding::NoPadding): "), used: 62 }); + String::push_str(__local_38, String { repr: array.new_data("encode_with(&\"Hello\".bytes().collect(), Encoding::NoPadding): "), used: 62 }); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; String^Inspect::inspect(__v0_18, __local_39); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; @@ -523,26 +523,26 @@ condition: encode_with(&\"Hello\".bytes().collect(), Encoding::NoPadding) == \"S if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(233), used: 0 }; - String::append(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_40, 114); - String::append_char(__local_40, 117); - String::append_char(__local_40, 110); - String::append_char(__local_40, 32); - String::append_char(__local_40, 97); - String::append_char(__local_40, 116); - String::append_char(__local_40, 32); - String::append(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); - String::append_char(__local_40, 58); + String::push_str(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_40, 114); + String::push(__local_40, 117); + String::push(__local_40, 110); + String::push(__local_40, 32); + String::push(__local_40, 97); + String::push(__local_40, 116); + String::push(__local_40, 32); + String::push_str(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/base64_encode.wado"), used: 47 }); + String::push(__local_40, 58); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_129 = __local_41; i32::fmt_decimal(24, __local_129); - String::append(__local_40, String { repr: array.new_data(" + String::push_str(__local_40, String { repr: array.new_data(" condition: encode_with(&\"Hello\".bytes().collect(), Encoding::none()) == \"SGVsbG8=\" "), used: 84 }); - String::append(__local_40, String { repr: array.new_data("encode_with(&\"Hello\".bytes().collect(), Encoding::none()): "), used: 59 }); + String::push_str(__local_40, String { repr: array.new_data("encode_with(&\"Hello\".bytes().collect(), Encoding::none()): "), used: 59 }); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; String^Inspect::inspect(__v0_20, __local_41); - String::append_char(__local_40, 10); + String::push(__local_40, 10); break __tmpl: __local_40; }); unreachable; @@ -633,7 +633,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_4: builtin::array_get(_licm_repr_46, __local_20); }; - String::append_char(out, __inline_Array_u8__IndexValue__index_value_5: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_5: block -> u8 { __local_22 = (b0_7 >> 2) & 63; if __local_22 >= _licm_used_47 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -641,7 +641,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_5: builtin::array_get(_licm_repr_48, __local_22); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_6: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_6: block -> u8 { __local_24 = ((b0_7 << 4) | (b1_8 >> 4)) & 63; if __local_24 >= _licm_used_47 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -649,7 +649,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_6: builtin::array_get(_licm_repr_48, __local_24); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_7: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_7: block -> u8 { __local_26 = ((b1_8 << 2) | (b2 >> 6)) & 63; if __local_26 >= _licm_used_47 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -657,7 +657,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_7: builtin::array_get(_licm_repr_48, __local_26); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_8: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_8: block -> u8 { __local_28 = b2 & 63; if __local_28 >= _licm_used_47 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -678,7 +678,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_9: builtin::array_get(data.repr, __local_30); }; - String::append_char(out, __inline_Array_u8__IndexValue__index_value_10: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_10: block -> u8 { __local_32 = (b0_10 >> 2) & 63; if __local_32 >= table.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -686,7 +686,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_10: builtin::array_get(table.repr, __local_32); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_11: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_11: block -> u8 { __local_34 = (b0_10 << 4) & 63; if __local_34 >= table.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -695,8 +695,8 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 break __inline_Array_u8__IndexValue__index_value_11: builtin::array_get(table.repr, __local_34); }); if pad { - String::append_char(out, 61); - String::append_char(out, 61); + String::push(out, 61); + String::push(out, 61); }; } else if remainder == 2 { b0_11 = __inline_Array_u8__IndexValue__index_value_12: block -> u8 { @@ -715,7 +715,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_13: builtin::array_get(data.repr, __local_38); }; - String::append_char(out, __inline_Array_u8__IndexValue__index_value_14: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_14: block -> u8 { __local_40 = (b0_11 >> 2) & 63; if __local_40 >= table.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -723,7 +723,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_14: builtin::array_get(table.repr, __local_40); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_15: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_15: block -> u8 { __local_42 = ((b0_11 << 4) | (b1_12 >> 4)) & 63; if __local_42 >= table.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -731,7 +731,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 }; break __inline_Array_u8__IndexValue__index_value_15: builtin::array_get(table.repr, __local_42); }); - String::append_char(out, __inline_Array_u8__IndexValue__index_value_16: block -> u8 { + String::push(out, __inline_Array_u8__IndexValue__index_value_16: block -> u8 { __local_44 = (b1_12 << 2) & 63; if __local_44 >= table.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -740,7 +740,7 @@ fn "core:base64/encode_impl"(data, table, pad) { // from core:base64 break __inline_Array_u8__IndexValue__index_value_16: builtin::array_get(table.repr, __local_44); }); if pad { - String::append_char(out, 61); + String::push(out, 61); }; }; return out; @@ -939,7 +939,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn "core:base64/Array::append"(self, value) { // from core:base64 +fn "core:base64/Array::push"(self, value) { // from core:base64 let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1035,7 +1035,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1104,7 +1104,7 @@ fn StrUtf8ByteIter^Iterator::collect(self) { }; byte = builtin::array_get_u8(_licm_repr_12, _hfs_index_13); _hfs_index_13 = _hfs_index_13 + 1; - Array::append(result, byte); + Array::push(result, byte); self.index = _hfs_index_13; break __fused___inline_StrUtf8ByteIter_Iterator__next_3; }; @@ -1159,7 +1159,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1186,7 +1186,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1239,7 +1239,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l79; }; @@ -1273,20 +1273,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1296,10 +1296,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1309,10 +1309,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1320,10 +1320,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1335,7 +1335,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1352,22 +1352,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b98; @@ -1375,7 +1375,7 @@ fn String^Inspect::inspect(self, f) { continue l99; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/cast_deref_precedence.wir.wado b/wado-compiler/tests/fixtures.golden/cast_deref_precedence.wir.wado index 2f01fb67b..e95026c4e 100644 --- a/wado-compiler/tests/fixtures.golden/cast_deref_precedence.wir.wado +++ b/wado-compiler/tests/fixtures.golden/cast_deref_precedence.wir.wado @@ -84,9 +84,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -143,27 +143,27 @@ fn __test_4_double_deref_then_cast____rr_as_i64() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_4_double_deref_then_cast____rr_as_i64"), used: 44 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/cast_deref_precedence.wado"), used: 55 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_4_double_deref_then_cast____rr_as_i64"), used: 44 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/cast_deref_precedence.wado"), used: 55 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(41, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: v == 7 as i64 "), used: 26 }); - String::append_char(__local_6, 118); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 118); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; i64::fmt_decimal(v, __local_17); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -421,7 +421,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -436,7 +436,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -474,7 +474,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -508,20 +508,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -531,10 +531,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -544,10 +544,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -555,10 +555,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/char_cast.wir.wado b/wado-compiler/tests/fixtures.golden/char_cast.wir.wado index ed78c5450..5e7b242d0 100644 --- a/wado-compiler/tests/fixtures.golden/char_cast.wir.wado +++ b/wado-compiler/tests/fixtures.golden/char_cast.wir.wado @@ -88,9 +88,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -178,26 +178,26 @@ fn char_cast_from_u32_fn() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_53 = __local_22; i32::fmt_decimal(8, __local_53); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: c == 'A' "), used: 21 }); - String::append_char(__local_21, 99); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 99); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; char^Inspect::inspect(c_0, __local_22); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -213,17 +213,17 @@ condition: c == 'A' if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; i32::fmt_decimal(15, __local_24); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: c as i32 == 0x1F600 "), used: 32 }); break __tmpl: __local_23; @@ -241,26 +241,26 @@ condition: c as i32 == 0x1F600 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_67 = __local_26; i32::fmt_decimal(22, __local_67); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: c == 'A' "), used: 21 }); - String::append_char(__local_25, 99); - String::append_char(__local_25, 58); - String::append_char(__local_25, 32); + String::push(__local_25, 99); + String::push(__local_25, 58); + String::push(__local_25, 32); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; char^Inspect::inspect(c_5, __local_26); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -303,17 +303,17 @@ condition: c == 'A' if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(99), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; i32::fmt_decimal(58, __local_28); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: c as i32 == 0 "), used: 26 }); break __tmpl: __local_27; @@ -331,17 +331,17 @@ condition: c as i32 == 0 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_29, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_29, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; i32::fmt_decimal(65, __local_30); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: c as i32 == 0xD7FF "), used: 31 }); break __tmpl: __local_29; @@ -359,17 +359,17 @@ condition: c as i32 == 0xD7FF if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_31, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_31, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; i32::fmt_decimal(72, __local_32); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: c as i32 == 0xE000 "), used: 31 }); break __tmpl: __local_31; @@ -387,17 +387,17 @@ condition: c as i32 == 0xE000 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_33, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_33, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; i32::fmt_decimal(79, __local_34); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: c as i32 == 0x10FFFF "), used: 33 }); break __tmpl: __local_33; @@ -413,27 +413,27 @@ condition: c as i32 == 0x10FFFF if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_35 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_35, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); - String::append_char(__local_35, 32); - String::append_char(__local_35, 97); - String::append_char(__local_35, 116); - String::append_char(__local_35, 32); - String::append(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_35, 58); + String::push_str(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_35, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); + String::push(__local_35, 32); + String::push(__local_35, 97); + String::push(__local_35, 116); + String::push(__local_35, 32); + String::push_str(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_35, 58); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_100 = __local_36; i32::fmt_decimal(86, __local_100); - String::append(__local_35, String { repr: array.new_data(" + String::push_str(__local_35, String { repr: array.new_data(" condition: uc == 'A' "), used: 22 }); - String::append_char(__local_35, 117); - String::append_char(__local_35, 99); - String::append_char(__local_35, 58); - String::append_char(__local_35, 32); + String::push(__local_35, 117); + String::push(__local_35, 99); + String::push(__local_35, 58); + String::push(__local_35, 32); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; char^Inspect::inspect(uc, __local_36); - String::append_char(__local_35, 10); + String::push(__local_35, 10); break __tmpl: __local_35; }); unreachable; @@ -443,17 +443,17 @@ condition: uc == 'A' if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_37 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_37, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); - String::append_char(__local_37, 32); - String::append_char(__local_37, 97); - String::append_char(__local_37, 116); - String::append_char(__local_37, 32); - String::append(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_37, 58); + String::push_str(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_37, String { repr: array.new_data("char_cast_from_u32_fn"), used: 21 }); + String::push(__local_37, 32); + String::push(__local_37, 97); + String::push(__local_37, 116); + String::push(__local_37, 32); + String::push_str(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_37, 58); __local_38 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_37 }; i32::fmt_decimal(89, __local_38); - String::append(__local_37, String { repr: array.new_data(" + String::push_str(__local_37, String { repr: array.new_data(" condition: uc2 as i32 == 0x1F600 "), used: 34 }); break __tmpl: __local_37; @@ -482,26 +482,26 @@ fn char_cast_from_u8() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("char_cast_from_u8"), used: 17 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("char_cast_from_u8"), used: 17 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_19 = __local_11; i32::fmt_decimal(99, __local_19); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: c == 'A' "), used: 21 }); - String::append_char(__local_10, 99); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 99); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; char^Inspect::inspect(c, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -511,17 +511,17 @@ condition: c == 'A' if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("char_cast_from_u8"), used: 17 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("char_cast_from_u8"), used: 17 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(104, __local_13); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: c2 as i32 == 255 "), used: 29 }); break __tmpl: __local_12; @@ -533,17 +533,17 @@ condition: c2 as i32 == 255 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(100), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("char_cast_from_u8"), used: 17 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("char_cast_from_u8"), used: 17 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/char_cast.wado"), used: 43 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(109, __local_15); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: c3 as i32 == 0 "), used: 27 }); break __tmpl: __local_14; @@ -775,27 +775,27 @@ fn i32::fmt_decimal(self, f) { fn char^Inspect::inspect(self, f) { let c: char; - String::append_char(f.buf, 39); + String::push(f.buf, 39); c = self; if c == 39 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 39); + String::push(f.buf, 92); + String::push(f.buf, 39); } else if c == 92 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 92); + String::push(f.buf, 92); + String::push(f.buf, 92); } else if c == 10 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 110); + String::push(f.buf, 92); + String::push(f.buf, 110); } else if c == 13 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 114); + String::push(f.buf, 92); + String::push(f.buf, 114); } else if c == 9 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 116); + String::push(f.buf, 92); + String::push(f.buf, 116); } else { - String::append_char(f.buf, c); + String::push(f.buf, c); }; - String::append_char(f.buf, 39); + String::push(f.buf, 39); } fn String::grow(self, min_capacity) { @@ -832,7 +832,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -847,7 +847,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -885,7 +885,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l55; }; @@ -919,20 +919,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -942,10 +942,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -955,10 +955,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -966,10 +966,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/cli_args.wir.wado b/wado-compiler/tests/fixtures.golden/cli_args.wir.wado index 157caa773..ffad67637 100644 --- a/wado-compiler/tests/fixtures.golden/cli_args.wir.wado +++ b/wado-compiler/tests/fixtures.golden/cli_args.wir.wado @@ -77,11 +77,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -118,7 +118,7 @@ fn run() with Stdout, Environment { arguments = __cm_binding__Environment_get_arguments(); "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_1, String { repr: array.new_data("args.len = "), used: 11 }); + String::push_str(__local_1, String { repr: array.new_data("args.len = "), used: 11 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(arguments.used, __local_2); break __tmpl: __local_1; @@ -151,7 +151,7 @@ fn __cm_binding__Environment_get_arguments() { break b0; }; __elem_addr = __base + (__i * 8); - Array::append(__result, __inline_memory_to_gc_string_1: block -> ref String { + Array::push(__result, __inline_memory_to_gc_string_1: block -> ref String { __local_7 = builtin::load_i32(__elem_addr); __local_8 = builtin::load_i32(__elem_addr + 4); __local_9 = "core:internal/memory_to_gc_array"(__local_7, __local_8); @@ -380,7 +380,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -395,7 +395,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -422,7 +422,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -475,7 +475,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -509,20 +509,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -532,10 +532,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -545,10 +545,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -556,10 +556,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/closure_1.wir.wado b/wado-compiler/tests/fixtures.golden/closure_1.wir.wado index cbefbd7ec..c886457f4 100644 --- a/wado-compiler/tests/fixtures.golden/closure_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/closure_1.wir.wado @@ -170,15 +170,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -247,32 +247,32 @@ fn __test_4_closure_fn_param_capture() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_4_closure_fn_param_capture"), used: 33 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_4_closure_fn_param_capture"), used: 33 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_15 = __local_6; i32::fmt_decimal(93, __local_15); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: result == 15 "), used: 25 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 101); - String::append_char(__local_5, 115); - String::append_char(__local_5, 117); - String::append_char(__local_5, 108); - String::append_char(__local_5, 116); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 114); + String::push(__local_5, 101); + String::push(__local_5, 115); + String::push(__local_5, 117); + String::push(__local_5, 108); + String::push(__local_5, 116); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_20 = __local_6; i32::fmt_decimal(result, __local_20); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -317,25 +317,25 @@ fn __test_5_closure_fn_param_effectful() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_5_closure_fn_param_effectful"), used: 35 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_5_closure_fn_param_effectful"), used: 35 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_30 = __local_10; i32::fmt_decimal(99, __local_30); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: result[0] == 10 "), used: 28 }); - String::append(__local_9, String { repr: array.new_data("result[0]: "), used: 11 }); + String::push_str(__local_9, String { repr: array.new_data("result[0]: "), used: 11 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_35 = __local_10; i32::fmt_decimal(__v0_3, __local_35); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -351,25 +351,25 @@ condition: result[0] == 10 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_5_closure_fn_param_effectful"), used: 35 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_5_closure_fn_param_effectful"), used: 35 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_43 = __local_12; i32::fmt_decimal(100, __local_43); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: result[1] == 20 "), used: 28 }); - String::append(__local_11, String { repr: array.new_data("result[1]: "), used: 11 }); + String::push_str(__local_11, String { repr: array.new_data("result[1]: "), used: 11 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_48 = __local_12; i32::fmt_decimal(__v0_5, __local_48); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -385,25 +385,25 @@ condition: result[1] == 20 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_5_closure_fn_param_effectful"), used: 35 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_5_closure_fn_param_effectful"), used: 35 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_56 = __local_14; i32::fmt_decimal(101, __local_56); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: result[2] == 30 "), used: 28 }); - String::append(__local_13, String { repr: array.new_data("result[2]: "), used: 11 }); + String::push_str(__local_13, String { repr: array.new_data("result[2]: "), used: 11 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_61 = __local_14; i32::fmt_decimal(__v0_7, __local_61); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -436,32 +436,32 @@ fn __test_7_closure_fn_param_no_args() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_7_closure_fn_param_no_args"), used: 33 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_7_closure_fn_param_no_args"), used: 33 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_19 = __local_9; i32::fmt_decimal(112, __local_19); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: result == 42 "), used: 25 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 101); - String::append_char(__local_8, 115); - String::append_char(__local_8, 117); - String::append_char(__local_8, 108); - String::append_char(__local_8, 116); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 114); + String::push(__local_8, 101); + String::push(__local_8, 115); + String::push(__local_8, 117); + String::push(__local_8, 108); + String::push(__local_8, 116); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_24 = __local_9; i32::fmt_decimal(result, __local_24); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -474,23 +474,23 @@ condition: result == 42 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_7_closure_fn_param_no_args"), used: 33 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_7_closure_fn_param_no_args"), used: 33 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_32 = __local_11; i32::fmt_decimal(116, __local_32); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: b == true "), used: 22 }); - String::append_char(__local_10, 98); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 98); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_37 = __local_11; Formatter::pad(__local_37, if b -> ref String { @@ -498,7 +498,7 @@ condition: b == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -525,24 +525,24 @@ fn __test_11_closure_no_params_block_body() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_11_closure_no_params_block_body"), used: 38 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_11_closure_no_params_block_body"), used: 38 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_10 = __local_4; i32::fmt_decimal(139, __local_10); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: greet() == \"hello\" "), used: 31 }); - String::append(__local_3, String { repr: array.new_data("greet(): "), used: 9 }); + String::push_str(__local_3, String { repr: array.new_data("greet(): "), used: 9 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -596,25 +596,25 @@ fn __test_17_closure_function_factory() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_17_closure_function_factory"), used: 34 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_17_closure_function_factory"), used: 34 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_20 = __local_9; i32::fmt_decimal(181, __local_20); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: add5(3) == 8 "), used: 25 }); - String::append(__local_8, String { repr: array.new_data("add5(3): "), used: 9 }); + String::push_str(__local_8, String { repr: array.new_data("add5(3): "), used: 9 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_25 = __local_9; i32::fmt_decimal(__v0_2, __local_25); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -628,25 +628,25 @@ condition: add5(3) == 8 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_17_closure_function_factory"), used: 34 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_17_closure_function_factory"), used: 34 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_31 = __local_11; i32::fmt_decimal(182, __local_31); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: triple(4) == 12 "), used: 28 }); - String::append(__local_10, String { repr: array.new_data("triple(4): "), used: 11 }); + String::push_str(__local_10, String { repr: array.new_data("triple(4): "), used: 11 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_36 = __local_11; i32::fmt_decimal(__v0_4, __local_36); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -664,25 +664,25 @@ condition: triple(4) == 12 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_17_closure_function_factory"), used: 34 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_17_closure_function_factory"), used: 34 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_1.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_42 = __local_13; i32::fmt_decimal(183, __local_42); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: add5(triple(2)) == 11 "), used: 34 }); - String::append(__local_12, String { repr: array.new_data("add5(triple(2)): "), used: 17 }); + String::push_str(__local_12, String { repr: array.new_data("add5(triple(2)): "), used: 17 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_47 = __local_13; i32::fmt_decimal(__v0_6, __local_47); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -783,7 +783,7 @@ fn for_each_item$__Closure_8(items, f) { multivalue_bind [__sroa___pattern_temp_0_discriminant, __sroa___pattern_temp_0_payload_0] = ArrayIter^Iterator::next(__iter_4); if __sroa___pattern_temp_0_discriminant == 0 { item = __sroa___pattern_temp_0_payload_0; - Array::append(result, item * 10); + Array::push(result, item * 10); } else { break b18; }; @@ -984,7 +984,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1072,7 +1072,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1099,7 +1099,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1170,7 +1170,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l58; }; @@ -1190,7 +1190,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1198,17 +1198,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1238,20 +1238,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1261,10 +1261,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1274,10 +1274,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1285,10 +1285,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1300,7 +1300,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1317,22 +1317,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b81; @@ -1340,7 +1340,7 @@ fn String^Inspect::inspect(self, f) { continue l82; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/closure_1.wado/__closure_wrapper_0"(__env, __p0) { diff --git a/wado-compiler/tests/fixtures.golden/closure_2.wir.wado b/wado-compiler/tests/fixtures.golden/closure_2.wir.wado index ee53a4ebb..83d2c0130 100644 --- a/wado-compiler/tests/fixtures.golden/closure_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/closure_2.wir.wado @@ -210,19 +210,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref struct); +type "functype/Array>::push" = fn(ref Array>, ref struct); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -372,28 +372,28 @@ fn __test_0_capture_fn_param() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_0_capture_fn_param"), used: 25 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_0_capture_fn_param"), used: 25 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_33 = __local_15; i32::fmt_decimal(42, __local_33); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: r1 == 15 "), used: 21 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 49); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 114); + String::push(__local_14, 49); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_38 = __local_15; i32::fmt_decimal(r1, __local_38); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -403,25 +403,25 @@ condition: r1 == 15 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_0_capture_fn_param"), used: 25 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_0_capture_fn_param"), used: 25 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_44 = __local_17; i32::fmt_decimal(44, __local_44); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: clamp(15, 0, 10) == 10 "), used: 35 }); - String::append(__local_16, String { repr: array.new_data("clamp(15, 0, 10): "), used: 18 }); + String::push_str(__local_16, String { repr: array.new_data("clamp(15, 0, 10): "), used: 18 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_49 = __local_17; i32::fmt_decimal(__v0_3, __local_49); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -431,25 +431,25 @@ condition: clamp(15, 0, 10) == 10 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_0_capture_fn_param"), used: 25 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_0_capture_fn_param"), used: 25 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_55 = __local_19; i32::fmt_decimal(45, __local_55); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: clamp(5, 0, 10) == 5 "), used: 33 }); - String::append(__local_18, String { repr: array.new_data("clamp(5, 0, 10): "), used: 17 }); + String::push_str(__local_18, String { repr: array.new_data("clamp(5, 0, 10): "), used: 17 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_60 = __local_19; i32::fmt_decimal(__v0_5, __local_60); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -459,25 +459,25 @@ condition: clamp(5, 0, 10) == 5 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_0_capture_fn_param"), used: 25 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_0_capture_fn_param"), used: 25 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_66 = __local_21; i32::fmt_decimal(46, __local_66); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: clamp(-5, 0, 10) == 0 "), used: 34 }); - String::append(__local_20, String { repr: array.new_data("clamp(-5, 0, 10): "), used: 18 }); + String::push_str(__local_20, String { repr: array.new_data("clamp(-5, 0, 10): "), used: 18 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_71 = __local_21; i32::fmt_decimal(__v0_7, __local_71); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -491,28 +491,28 @@ condition: clamp(-5, 0, 10) == 0 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_0_capture_fn_param"), used: 25 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_0_capture_fn_param"), used: 25 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_86 = __local_23; i32::fmt_decimal(50, __local_86); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: r5 == 15 "), used: 21 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 53); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); + String::push(__local_22, 114); + String::push(__local_22, 53); + String::push(__local_22, 58); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_91 = __local_23; i32::fmt_decimal(r5, __local_91); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -532,24 +532,24 @@ fn __test_1_capture_multiple() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("__test_1_capture_multiple"), used: 25 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("__test_1_capture_multiple"), used: 25 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_51 = __local_28; i32::fmt_decimal(64, __local_51); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: format_all() == \"1,2,3\" "), used: 36 }); - String::append(__local_27, String { repr: array.new_data("format_all(): "), used: 14 }); + String::push_str(__local_27, String { repr: array.new_data("format_all(): "), used: 14 }); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; String^Inspect::inspect(__v0, __local_28); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -586,24 +586,24 @@ fn __test_2_capture_string() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_2_capture_string"), used: 23 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_2_capture_string"), used: 23 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_24 = __local_13; i32::fmt_decimal(79, __local_24); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: get_greeting() == \"Hello\" "), used: 38 }); - String::append(__local_12, String { repr: array.new_data("get_greeting(): "), used: 16 }); + String::push_str(__local_12, String { repr: array.new_data("get_greeting(): "), used: 16 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_2, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -615,24 +615,24 @@ condition: get_greeting() == \"Hello\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_2_capture_string"), used: 23 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_2_capture_string"), used: 23 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_31 = __local_16; i32::fmt_decimal(83, __local_31); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: make_msg() == \"Hello, world!\" "), used: 42 }); - String::append(__local_15, String { repr: array.new_data("make_msg(): "), used: 12 }); + String::push_str(__local_15, String { repr: array.new_data("make_msg(): "), used: 12 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; String^Inspect::inspect(__v0_6, __local_16); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -644,21 +644,21 @@ condition: make_msg() == \"Hello, world!\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_2_capture_string"), used: 23 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_2_capture_string"), used: 23 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_39 = __local_18; i32::fmt_decimal(87, __local_39); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: is_ok() == true "), used: 28 }); - String::append(__local_17, String { repr: array.new_data("is_ok(): "), used: 9 }); + String::push_str(__local_17, String { repr: array.new_data("is_ok(): "), used: 9 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_44 = __local_18; Formatter::pad(__local_44, if __v0_10 -> ref String { @@ -666,7 +666,7 @@ condition: is_ok() == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -730,25 +730,25 @@ fn __test_3_capture_struct() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_37 = __local_21; i32::fmt_decimal(101, __local_37); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: get_x() == 3 "), used: 25 }); - String::append(__local_20, String { repr: array.new_data("get_x(): "), used: 9 }); + String::push_str(__local_20, String { repr: array.new_data("get_x(): "), used: 9 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_42 = __local_21; i32::fmt_decimal(__v0_5, __local_42); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -758,25 +758,25 @@ condition: get_x() == 3 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_49 = __local_23; i32::fmt_decimal(102, __local_49); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: get_y() == 4 "), used: 25 }); - String::append(__local_22, String { repr: array.new_data("get_y(): "), used: 9 }); + String::push_str(__local_22, String { repr: array.new_data("get_y(): "), used: 9 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_54 = __local_23; i32::fmt_decimal(__v0_7, __local_54); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -786,25 +786,25 @@ condition: get_y() == 4 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_61 = __local_25; i32::fmt_decimal(103, __local_61); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: sum_coords() == 7 "), used: 30 }); - String::append(__local_24, String { repr: array.new_data("sum_coords(): "), used: 14 }); + String::push_str(__local_24, String { repr: array.new_data("sum_coords(): "), used: 14 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_66 = __local_25; i32::fmt_decimal(__v0_9, __local_66); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -818,25 +818,25 @@ condition: sum_coords() == 7 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_26, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_26, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_75 = __local_27; i32::fmt_decimal(104, __local_75); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: manhattan() == 7 "), used: 29 }); - String::append(__local_26, String { repr: array.new_data("manhattan(): "), used: 13 }); + String::push_str(__local_26, String { repr: array.new_data("manhattan(): "), used: 13 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_80 = __local_27; i32::fmt_decimal(__v0_11, __local_80); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -849,25 +849,25 @@ condition: manhattan() == 7 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_87 = __local_29; i32::fmt_decimal(109, __local_87); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: get_qx() == 10 "), used: 27 }); - String::append(__local_28, String { repr: array.new_data("get_qx(): "), used: 10 }); + String::push_str(__local_28, String { repr: array.new_data("get_qx(): "), used: 10 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_92 = __local_29; i32::fmt_decimal(__v0_16, __local_92); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -877,25 +877,25 @@ condition: get_qx() == 10 if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_30, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_30, String { repr: array.new_data("__test_3_capture_struct"), used: 23 }); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_99 = __local_31; i32::fmt_decimal(110, __local_99); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: get_qy() == 20 "), used: 27 }); - String::append(__local_30, String { repr: array.new_data("get_qy(): "), used: 10 }); + String::push_str(__local_30, String { repr: array.new_data("get_qy(): "), used: 10 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_104 = __local_31; i32::fmt_decimal(__v0_18, __local_104); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -927,31 +927,31 @@ fn __test_4_mutable_capture() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_4_mutable_capture"), used: 24 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_4_mutable_capture"), used: 24 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(122, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: count == 3 "), used: 23 }); - String::append_char(__local_5, 99); - String::append_char(__local_5, 111); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 116); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 99); + String::push(__local_5, 111); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 116); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_16 = __local_6; i32::fmt_decimal(__v0, __local_16); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -988,31 +988,31 @@ fn __test_5_shared_mutable_state() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_5_shared_mutable_state"), used: 29 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_5_shared_mutable_state"), used: 29 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_17 = __local_9; i32::fmt_decimal(135, __local_17); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: get() == 2 "), used: 23 }); - String::append_char(__local_8, 103); - String::append_char(__local_8, 101); - String::append_char(__local_8, 116); - String::append_char(__local_8, 40); - String::append_char(__local_8, 41); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 103); + String::push(__local_8, 101); + String::push(__local_8, 116); + String::push(__local_8, 40); + String::push(__local_8, 41); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_22 = __local_9; i32::fmt_decimal(__v0_4, __local_22); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1025,31 +1025,31 @@ condition: get() == 2 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_5_shared_mutable_state"), used: 29 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_5_shared_mutable_state"), used: 29 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_29 = __local_11; i32::fmt_decimal(138, __local_29); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: get() == 3 "), used: 23 }); - String::append_char(__local_10, 103); - String::append_char(__local_10, 101); - String::append_char(__local_10, 116); - String::append_char(__local_10, 40); - String::append_char(__local_10, 41); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 103); + String::push(__local_10, 101); + String::push(__local_10, 116); + String::push(__local_10, 40); + String::push(__local_10, 41); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_34 = __local_11; i32::fmt_decimal(__v0_6, __local_34); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -1085,25 +1085,25 @@ fn __test_7_block_for() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_7_block_for"), used: 18 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_7_block_for"), used: 18 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_17 = __local_8; i32::fmt_decimal(162, __local_17); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: factorial(5) == 120 "), used: 32 }); - String::append(__local_7, String { repr: array.new_data("factorial(5): "), used: 14 }); + String::push_str(__local_7, String { repr: array.new_data("factorial(5): "), used: 14 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_22 = __local_8; i32::fmt_decimal(__v0_1, __local_22); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -1113,25 +1113,25 @@ condition: factorial(5) == 120 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_7_block_for"), used: 18 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_7_block_for"), used: 18 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_28 = __local_10; i32::fmt_decimal(163, __local_28); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: factorial(3) == 6 "), used: 30 }); - String::append(__local_9, String { repr: array.new_data("factorial(3): "), used: 14 }); + String::push_str(__local_9, String { repr: array.new_data("factorial(3): "), used: 14 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_33 = __local_10; i32::fmt_decimal(__v0_3, __local_33); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1141,25 +1141,25 @@ condition: factorial(3) == 6 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_7_block_for"), used: 18 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_7_block_for"), used: 18 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_39 = __local_12; i32::fmt_decimal(164, __local_39); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: factorial(4) == 24 "), used: 31 }); - String::append(__local_11, String { repr: array.new_data("factorial(4): "), used: 14 }); + String::push_str(__local_11, String { repr: array.new_data("factorial(4): "), used: 14 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_44 = __local_12; i32::fmt_decimal(__v0_5, __local_44); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1192,25 +1192,25 @@ fn __test_8_block_if() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_8_block_if"), used: 17 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_8_block_if"), used: 17 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_17 = __local_8; i32::fmt_decimal(182, __local_17); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: max_of_three(1, 5, 3) == 5 "), used: 39 }); - String::append(__local_7, String { repr: array.new_data("max_of_three(1, 5, 3): "), used: 23 }); + String::push_str(__local_7, String { repr: array.new_data("max_of_three(1, 5, 3): "), used: 23 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_22 = __local_8; i32::fmt_decimal(__v0_1, __local_22); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -1220,25 +1220,25 @@ condition: max_of_three(1, 5, 3) == 5 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(155), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_8_block_if"), used: 17 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_8_block_if"), used: 17 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_28 = __local_10; i32::fmt_decimal(183, __local_28); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: max_of_three(10, 2, 8) == 10 "), used: 41 }); - String::append(__local_9, String { repr: array.new_data("max_of_three(10, 2, 8): "), used: 24 }); + String::push_str(__local_9, String { repr: array.new_data("max_of_three(10, 2, 8): "), used: 24 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_33 = __local_10; i32::fmt_decimal(__v0_3, __local_33); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1248,25 +1248,25 @@ condition: max_of_three(10, 2, 8) == 10 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_8_block_if"), used: 17 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_8_block_if"), used: 17 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_39 = __local_12; i32::fmt_decimal(184, __local_39); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: max_of_three(4, 7, 9) == 9 "), used: 39 }); - String::append(__local_11, String { repr: array.new_data("max_of_three(4, 7, 9): "), used: 23 }); + String::push_str(__local_11, String { repr: array.new_data("max_of_three(4, 7, 9): "), used: 23 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_44 = __local_12; i32::fmt_decimal(__v0_5, __local_44); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1299,25 +1299,25 @@ fn __test_9_block_multi_types() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_9_block_multi_types"), used: 26 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_9_block_multi_types"), used: 26 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_17 = __local_8; i32::fmt_decimal(200, __local_17); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: mixed(5) == 10 "), used: 27 }); - String::append(__local_7, String { repr: array.new_data("mixed(5): "), used: 10 }); + String::push_str(__local_7, String { repr: array.new_data("mixed(5): "), used: 10 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_22 = __local_8; i32::fmt_decimal(__v0_1, __local_22); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -1327,25 +1327,25 @@ condition: mixed(5) == 10 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_9_block_multi_types"), used: 26 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_9_block_multi_types"), used: 26 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_28 = __local_10; i32::fmt_decimal(201, __local_28); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: mixed(-3) == 0 "), used: 27 }); - String::append(__local_9, String { repr: array.new_data("mixed(-3): "), used: 11 }); + String::push_str(__local_9, String { repr: array.new_data("mixed(-3): "), used: 11 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_33 = __local_10; i32::fmt_decimal(__v0_3, __local_33); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1355,25 +1355,25 @@ condition: mixed(-3) == 0 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_9_block_multi_types"), used: 26 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_9_block_multi_types"), used: 26 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_39 = __local_12; i32::fmt_decimal(202, __local_39); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: mixed(7) == 14 "), used: 27 }); - String::append(__local_11, String { repr: array.new_data("mixed(7): "), used: 10 }); + String::push_str(__local_11, String { repr: array.new_data("mixed(7): "), used: 10 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_44 = __local_12; i32::fmt_decimal(__v0_5, __local_44); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1400,25 +1400,25 @@ fn __test_10_block_nested() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_10_block_nested"), used: 22 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_10_block_nested"), used: 22 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_13 = __local_6; i32::fmt_decimal(218, __local_13); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: compute(3) == 16 "), used: 29 }); - String::append(__local_5, String { repr: array.new_data("compute(3): "), used: 12 }); + String::push_str(__local_5, String { repr: array.new_data("compute(3): "), used: 12 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_18 = __local_6; i32::fmt_decimal(__v0_1, __local_18); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1428,25 +1428,25 @@ condition: compute(3) == 16 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_10_block_nested"), used: 22 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_10_block_nested"), used: 22 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_24 = __local_8; i32::fmt_decimal(219, __local_24); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: compute(5) == 28 "), used: 29 }); - String::append(__local_7, String { repr: array.new_data("compute(5): "), used: 12 }); + String::push_str(__local_7, String { repr: array.new_data("compute(5): "), used: 12 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_29 = __local_8; i32::fmt_decimal(__v0_3, __local_29); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -1479,25 +1479,25 @@ fn __test_11_block_while() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_11_block_while"), used: 21 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_11_block_while"), used: 21 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_17 = __local_8; i32::fmt_decimal(233, __local_17); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: sum_to_n(5) == 15 "), used: 30 }); - String::append(__local_7, String { repr: array.new_data("sum_to_n(5): "), used: 13 }); + String::push_str(__local_7, String { repr: array.new_data("sum_to_n(5): "), used: 13 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_22 = __local_8; i32::fmt_decimal(__v0_1, __local_22); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -1507,25 +1507,25 @@ condition: sum_to_n(5) == 15 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_11_block_while"), used: 21 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_11_block_while"), used: 21 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_28 = __local_10; i32::fmt_decimal(234, __local_28); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: sum_to_n(10) == 55 "), used: 31 }); - String::append(__local_9, String { repr: array.new_data("sum_to_n(10): "), used: 14 }); + String::push_str(__local_9, String { repr: array.new_data("sum_to_n(10): "), used: 14 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_33 = __local_10; i32::fmt_decimal(__v0_3, __local_33); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1535,25 +1535,25 @@ condition: sum_to_n(10) == 55 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_11_block_while"), used: 21 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_11_block_while"), used: 21 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_39 = __local_12; i32::fmt_decimal(235, __local_39); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: sum_to_n(3) == 6 "), used: 29 }); - String::append(__local_11, String { repr: array.new_data("sum_to_n(3): "), used: 13 }); + String::push_str(__local_11, String { repr: array.new_data("sum_to_n(3): "), used: 13 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_44 = __local_12; i32::fmt_decimal(__v0_5, __local_44); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1592,29 +1592,29 @@ fn __test_12_closure_in_loop() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_12_closure_in_loop"), used: 25 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_12_closure_in_loop"), used: 25 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_13 = __local_6; i32::fmt_decimal(245, __local_13); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: sum == 30 "), used: 22 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 117); - String::append_char(__local_5, 109); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 117); + String::push(__local_5, 109); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_18 = __local_6; i32::fmt_decimal(__v0, __local_18); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1673,7 +1673,7 @@ fn __test_13_loop_scope_c_style_for() { break __for_1; }; get_i = "canonical/CanonicalClosure_0" { env: __Closure_28 { __capture_0: i }, func: ref.as_non_null(ref.func "closure/wado-compiler/tests/fixtures/closure_2.wado/__closure_wrapper_9") }; - Array>::append(closures, get_i); + Array>::push(closures, get_i); i = i + 1; continue l43; }; @@ -1698,25 +1698,25 @@ fn __test_13_loop_scope_c_style_for() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_13_loop_scope_c_style_for"), used: 32 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_13_loop_scope_c_style_for"), used: 32 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_35 = __local_15; i32::fmt_decimal(256, __local_35); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: call_fn(closures[0], 0) == 0 "), used: 41 }); - String::append(__local_14, String { repr: array.new_data("call_fn(closures[0], 0): "), used: 25 }); + String::push_str(__local_14, String { repr: array.new_data("call_fn(closures[0], 0): "), used: 25 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_40 = __local_15; i32::fmt_decimal(__v0_4, __local_40); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -1740,25 +1740,25 @@ condition: call_fn(closures[0], 0) == 0 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_13_loop_scope_c_style_for"), used: 32 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_13_loop_scope_c_style_for"), used: 32 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_50 = __local_17; i32::fmt_decimal(257, __local_50); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: call_fn(closures[1], 0) == 1 "), used: 41 }); - String::append(__local_16, String { repr: array.new_data("call_fn(closures[1], 0): "), used: 25 }); + String::push_str(__local_16, String { repr: array.new_data("call_fn(closures[1], 0): "), used: 25 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_55 = __local_17; i32::fmt_decimal(__v0_6, __local_55); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -1782,25 +1782,25 @@ condition: call_fn(closures[1], 0) == 1 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_13_loop_scope_c_style_for"), used: 32 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_13_loop_scope_c_style_for"), used: 32 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_65 = __local_19; i32::fmt_decimal(258, __local_65); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: call_fn(closures[2], 0) == 2 "), used: 41 }); - String::append(__local_18, String { repr: array.new_data("call_fn(closures[2], 0): "), used: 25 }); + String::push_str(__local_18, String { repr: array.new_data("call_fn(closures[2], 0): "), used: 25 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_70 = __local_19; i32::fmt_decimal(__v0_8, __local_70); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -1824,25 +1824,25 @@ condition: call_fn(closures[2], 0) == 2 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_13_loop_scope_c_style_for"), used: 32 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_13_loop_scope_c_style_for"), used: 32 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_80 = __local_21; i32::fmt_decimal(259, __local_80); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: call_fn(closures[3], 0) == 3 "), used: 41 }); - String::append(__local_20, String { repr: array.new_data("call_fn(closures[3], 0): "), used: 25 }); + String::push_str(__local_20, String { repr: array.new_data("call_fn(closures[3], 0): "), used: 25 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_85 = __local_21; i32::fmt_decimal(__v0_10, __local_85); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -1866,25 +1866,25 @@ condition: call_fn(closures[3], 0) == 3 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_13_loop_scope_c_style_for"), used: 32 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_13_loop_scope_c_style_for"), used: 32 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_95 = __local_23; i32::fmt_decimal(260, __local_95); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: call_fn(closures[4], 0) == 4 "), used: 41 }); - String::append(__local_22, String { repr: array.new_data("call_fn(closures[4], 0): "), used: 25 }); + String::push_str(__local_22, String { repr: array.new_data("call_fn(closures[4], 0): "), used: 25 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_100 = __local_23; i32::fmt_decimal(__v0_12, __local_100); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -1951,7 +1951,7 @@ fn __test_14_loop_scope_for_of() { if __sroa___pattern_temp_0_discriminant == 0 { item = __sroa___pattern_temp_0_payload_0; get_item = "canonical/CanonicalClosure_0" { env: __Closure_29 { __capture_0: item }, func: ref.as_non_null(ref.func "closure/wado-compiler/tests/fixtures/closure_2.wado/__closure_wrapper_10") }; - Array>::append(closures, get_item); + Array>::push(closures, get_item); } else { break b60; }; @@ -1977,25 +1977,25 @@ fn __test_14_loop_scope_for_of() { if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_14_loop_scope_for_of"), used: 27 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_14_loop_scope_for_of"), used: 27 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_53 = __local_18; i32::fmt_decimal(272, __local_53); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: call_fn(closures[0], 0) == 10 "), used: 42 }); - String::append(__local_17, String { repr: array.new_data("call_fn(closures[0], 0): "), used: 25 }); + String::push_str(__local_17, String { repr: array.new_data("call_fn(closures[0], 0): "), used: 25 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_58 = __local_18; i32::fmt_decimal(__v0_7, __local_58); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -2019,25 +2019,25 @@ condition: call_fn(closures[0], 0) == 10 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_14_loop_scope_for_of"), used: 27 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_14_loop_scope_for_of"), used: 27 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_68 = __local_20; i32::fmt_decimal(273, __local_68); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: call_fn(closures[1], 0) == 20 "), used: 42 }); - String::append(__local_19, String { repr: array.new_data("call_fn(closures[1], 0): "), used: 25 }); + String::push_str(__local_19, String { repr: array.new_data("call_fn(closures[1], 0): "), used: 25 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_73 = __local_20; i32::fmt_decimal(__v0_9, __local_73); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -2061,25 +2061,25 @@ condition: call_fn(closures[1], 0) == 20 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_14_loop_scope_for_of"), used: 27 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_14_loop_scope_for_of"), used: 27 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_83 = __local_22; i32::fmt_decimal(274, __local_83); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: call_fn(closures[2], 0) == 30 "), used: 42 }); - String::append(__local_21, String { repr: array.new_data("call_fn(closures[2], 0): "), used: 25 }); + String::push_str(__local_21, String { repr: array.new_data("call_fn(closures[2], 0): "), used: 25 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_88 = __local_22; i32::fmt_decimal(__v0_11, __local_88); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -2103,25 +2103,25 @@ condition: call_fn(closures[2], 0) == 30 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("__test_14_loop_scope_for_of"), used: 27 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("__test_14_loop_scope_for_of"), used: 27 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_98 = __local_24; i32::fmt_decimal(275, __local_98); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: call_fn(closures[3], 0) == 40 "), used: 42 }); - String::append(__local_23, String { repr: array.new_data("call_fn(closures[3], 0): "), used: 25 }); + String::push_str(__local_23, String { repr: array.new_data("call_fn(closures[3], 0): "), used: 25 }); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_103 = __local_24; i32::fmt_decimal(__v0_13, __local_103); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -2145,25 +2145,25 @@ condition: call_fn(closures[3], 0) == 40 if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("__test_14_loop_scope_for_of"), used: 27 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("__test_14_loop_scope_for_of"), used: 27 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_2.wado"), used: 43 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_113 = __local_26; i32::fmt_decimal(276, __local_113); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: call_fn(closures[4], 0) == 50 "), used: 42 }); - String::append(__local_25, String { repr: array.new_data("call_fn(closures[4], 0): "), used: 25 }); + String::push_str(__local_25, String { repr: array.new_data("call_fn(closures[4], 0): "), used: 25 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_118 = __local_26; i32::fmt_decimal(__v0_15, __local_118); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -2435,7 +2435,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2523,7 +2523,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2550,7 +2550,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2592,7 +2592,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2655,11 +2655,11 @@ fn __Closure_5::__call(self) { __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_31 = __local_27; i32::fmt_decimal(self.__capture_0, __local_31); - String::append_char(__local_26, 44); + String::push(__local_26, 44); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_36 = __local_27; i32::fmt_decimal(self.__capture_1, __local_36); - String::append_char(__local_26, 44); + String::push(__local_26, 44); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_41 = __local_27; i32::fmt_decimal(self.__capture_2, __local_41); @@ -2671,11 +2671,11 @@ fn __Closure_10::__call(self) { let __local_15: ref String; return __tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_15, self.__capture_0); - String::append_char(__local_15, 44); - String::append_char(__local_15, 32); - String::append(__local_15, self.__capture_1); - String::append_char(__local_15, 33); + String::push_str(__local_15, self.__capture_0); + String::push(__local_15, 44); + String::push(__local_15, 32); + String::push_str(__local_15, self.__capture_1); + String::push(__local_15, 33); break __tmpl: __local_15; }; } @@ -2777,7 +2777,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l126; }; @@ -2797,7 +2797,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2805,17 +2805,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2845,20 +2845,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2868,10 +2868,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2881,10 +2881,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2892,10 +2892,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -2907,7 +2907,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -2924,22 +2924,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b149; @@ -2947,7 +2947,7 @@ fn String^Inspect::inspect(self, f) { continue l150; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/closure_2.wado/__closure_wrapper_0"(__env) { diff --git a/wado-compiler/tests/fixtures.golden/closure_3.wir.wado b/wado-compiler/tests/fixtures.golden/closure_3.wir.wado index 55803bda1..bd1abc93f 100644 --- a/wado-compiler/tests/fixtures.golden/closure_3.wir.wado +++ b/wado-compiler/tests/fixtures.golden/closure_3.wir.wado @@ -233,15 +233,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Array::sort_by" = fn(ref Array, ref struct); type "functype/IterMap,i32>^Iterator::collect" = fn(ref "core:allocator/IterMap,i32>") -> ref Array; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -351,25 +351,25 @@ fn __test_0_nested_basic() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_0_nested_basic"), used: 21 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_0_nested_basic"), used: 21 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_15 = __local_7; i32::fmt_decimal(37, __local_15); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: add5(10) == 15 "), used: 27 }); - String::append(__local_6, String { repr: array.new_data("add5(10): "), used: 10 }); + String::push_str(__local_6, String { repr: array.new_data("add5(10): "), used: 10 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_20 = __local_7; i32::fmt_decimal(__v0_1, __local_20); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -384,25 +384,25 @@ condition: add5(10) == 15 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_0_nested_basic"), used: 21 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_0_nested_basic"), used: 21 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_27 = __local_9; i32::fmt_decimal(40, __local_27); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: mul3(7) == 21 "), used: 26 }); - String::append(__local_8, String { repr: array.new_data("mul3(7): "), used: 9 }); + String::push_str(__local_8, String { repr: array.new_data("mul3(7): "), used: 9 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_32 = __local_9; i32::fmt_decimal(__v0_4, __local_32); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -431,32 +431,32 @@ fn __test_1_nested_apply_twice() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_1_nested_apply_twice"), used: 27 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_1_nested_apply_twice"), used: 27 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_13 = __local_5; i32::fmt_decimal(46, __local_13); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: result == 16 "), used: 25 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 101); - String::append_char(__local_4, 115); - String::append_char(__local_4, 117); - String::append_char(__local_4, 108); - String::append_char(__local_4, 116); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 114); + String::push(__local_4, 101); + String::push(__local_4, 115); + String::push(__local_4, 117); + String::push(__local_4, 108); + String::push(__local_4, 116); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_18 = __local_5; i32::fmt_decimal(result, __local_18); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -487,32 +487,32 @@ fn __test_2_nested_compose() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_2_nested_compose"), used: 23 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_2_nested_compose"), used: 23 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_13 = __local_6; i32::fmt_decimal(53, __local_13); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: result == 12 "), used: 25 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 101); - String::append_char(__local_5, 115); - String::append_char(__local_5, 117); - String::append_char(__local_5, 108); - String::append_char(__local_5, 116); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 114); + String::push(__local_5, 101); + String::push(__local_5, 115); + String::push(__local_5, 117); + String::push(__local_5, 108); + String::push(__local_5, 116); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_18 = __local_6; i32::fmt_decimal(result, __local_18); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -534,25 +534,25 @@ fn __test_3_nested_capture_in_branch() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_3_nested_capture_in_branch"), used: 33 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_3_nested_capture_in_branch"), used: 33 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_17 = __local_8; i32::fmt_decimal(65, __local_17); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: pick(true) == 10 "), used: 29 }); - String::append(__local_7, String { repr: array.new_data("pick(true): "), used: 12 }); + String::push_str(__local_7, String { repr: array.new_data("pick(true): "), used: 12 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_22 = __local_8; i32::fmt_decimal(__v0, __local_22); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -601,27 +601,27 @@ fn __test_4_nested_counter() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_4_nested_counter"), used: 23 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_4_nested_counter"), used: 23 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_22 = __local_13; i32::fmt_decimal(75, __local_22); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: a == 1 "), used: 19 }); - String::append_char(__local_12, 97); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_27 = __local_13; i32::fmt_decimal(a, __local_27); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -630,27 +630,27 @@ condition: a == 1 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_4_nested_counter"), used: 23 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_4_nested_counter"), used: 23 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_33 = __local_15; i32::fmt_decimal(76, __local_33); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: b == 2 "), used: 19 }); - String::append_char(__local_14, 98); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 98); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_38 = __local_15; i32::fmt_decimal(b, __local_38); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -659,27 +659,27 @@ condition: b == 2 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_4_nested_counter"), used: 23 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_4_nested_counter"), used: 23 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_44 = __local_17; i32::fmt_decimal(77, __local_44); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: c == 3 "), used: 19 }); - String::append_char(__local_16, 99); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 99); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_49 = __local_17; i32::fmt_decimal(c, __local_49); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -759,25 +759,25 @@ fn __test_5_iterator_chain() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_66 = __local_19; i32::fmt_decimal(84, __local_66); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: result[0] == 4 "), used: 27 }); - String::append(__local_18, String { repr: array.new_data("result[0]: "), used: 11 }); + String::push_str(__local_18, String { repr: array.new_data("result[0]: "), used: 11 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_71 = __local_19; i32::fmt_decimal(__v0_3, __local_71); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -793,25 +793,25 @@ condition: result[0] == 4 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_79 = __local_21; i32::fmt_decimal(85, __local_79); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: result[1] == 16 "), used: 28 }); - String::append(__local_20, String { repr: array.new_data("result[1]: "), used: 11 }); + String::push_str(__local_20, String { repr: array.new_data("result[1]: "), used: 11 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_84 = __local_21; i32::fmt_decimal(__v0_5, __local_84); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -827,25 +827,25 @@ condition: result[1] == 16 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_92 = __local_23; i32::fmt_decimal(86, __local_92); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: result[2] == 36 "), used: 28 }); - String::append(__local_22, String { repr: array.new_data("result[2]: "), used: 11 }); + String::push_str(__local_22, String { repr: array.new_data("result[2]: "), used: 11 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_97 = __local_23; i32::fmt_decimal(__v0_7, __local_97); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -861,25 +861,25 @@ condition: result[2] == 36 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_105 = __local_25; i32::fmt_decimal(87, __local_105); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: result[3] == 64 "), used: 28 }); - String::append(__local_24, String { repr: array.new_data("result[3]: "), used: 11 }); + String::push_str(__local_24, String { repr: array.new_data("result[3]: "), used: 11 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_110 = __local_25; i32::fmt_decimal(__v0_9, __local_110); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -895,25 +895,25 @@ condition: result[3] == 64 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_26, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_26, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_118 = __local_27; i32::fmt_decimal(88, __local_118); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: result[4] == 100 "), used: 29 }); - String::append(__local_26, String { repr: array.new_data("result[4]: "), used: 11 }); + String::push_str(__local_26, String { repr: array.new_data("result[4]: "), used: 11 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_123 = __local_27; i32::fmt_decimal(__v0_11, __local_123); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -923,25 +923,25 @@ condition: result[4] == 100 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_130 = __local_29; i32::fmt_decimal(89, __local_130); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: result.len() == 5 "), used: 30 }); - String::append(__local_28, String { repr: array.new_data("result.len(): "), used: 14 }); + String::push_str(__local_28, String { repr: array.new_data("result.len(): "), used: 14 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_135 = __local_29; i32::fmt_decimal(__v0_13, __local_135); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -954,29 +954,29 @@ condition: result.len() == 5 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_30, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_30, String { repr: array.new_data("__test_5_iterator_chain"), used: 23 }); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_144 = __local_31; i32::fmt_decimal(92, __local_144); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: sum == 110 "), used: 23 }); - String::append_char(__local_30, 115); - String::append_char(__local_30, 117); - String::append_char(__local_30, 109); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 115); + String::push(__local_30, 117); + String::push(__local_30, 109); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_149 = __local_31; i32::fmt_decimal(sum, __local_149); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -1039,25 +1039,25 @@ fn __test_6_iterator_filter() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_60 = __local_18; i32::fmt_decimal(99, __local_60); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: evens.len() == 5 "), used: 29 }); - String::append(__local_17, String { repr: array.new_data("evens.len(): "), used: 13 }); + String::push_str(__local_17, String { repr: array.new_data("evens.len(): "), used: 13 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_65 = __local_18; i32::fmt_decimal(__v0_3, __local_65); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -1073,25 +1073,25 @@ condition: evens.len() == 5 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_73 = __local_20; i32::fmt_decimal(100, __local_73); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: evens[0] == 2 "), used: 26 }); - String::append(__local_19, String { repr: array.new_data("evens[0]: "), used: 10 }); + String::push_str(__local_19, String { repr: array.new_data("evens[0]: "), used: 10 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_78 = __local_20; i32::fmt_decimal(__v0_5, __local_78); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -1107,25 +1107,25 @@ condition: evens[0] == 2 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_86 = __local_22; i32::fmt_decimal(101, __local_86); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: evens[4] == 10 "), used: 27 }); - String::append(__local_21, String { repr: array.new_data("evens[4]: "), used: 10 }); + String::push_str(__local_21, String { repr: array.new_data("evens[4]: "), used: 10 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_91 = __local_22; i32::fmt_decimal(__v0_7, __local_91); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -1139,25 +1139,25 @@ condition: evens[4] == 10 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_101 = __local_24; i32::fmt_decimal(105, __local_101); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: large.len() == 5 "), used: 29 }); - String::append(__local_23, String { repr: array.new_data("large.len(): "), used: 13 }); + String::push_str(__local_23, String { repr: array.new_data("large.len(): "), used: 13 }); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_106 = __local_24; i32::fmt_decimal(__v0_11, __local_106); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -1173,25 +1173,25 @@ condition: large.len() == 5 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_114 = __local_26; i32::fmt_decimal(106, __local_114); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: large[0] == 6 "), used: 26 }); - String::append(__local_25, String { repr: array.new_data("large[0]: "), used: 10 }); + String::push_str(__local_25, String { repr: array.new_data("large[0]: "), used: 10 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_119 = __local_26; i32::fmt_decimal(__v0_13, __local_119); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -1207,25 +1207,25 @@ condition: large[0] == 6 if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("__test_6_iterator_filter"), used: 24 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_127 = __local_28; i32::fmt_decimal(107, __local_127); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: large[4] == 10 "), used: 27 }); - String::append(__local_27, String { repr: array.new_data("large[4]: "), used: 10 }); + String::push_str(__local_27, String { repr: array.new_data("large[4]: "), used: 10 }); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_132 = __local_28; i32::fmt_decimal(__v0_15, __local_132); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -1297,29 +1297,29 @@ fn __test_7_iterator_fold() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_7_iterator_fold"), used: 22 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_7_iterator_fold"), used: 22 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_40 = __local_15; i32::fmt_decimal(114, __local_40); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: sum == 15 "), used: 22 }); - String::append_char(__local_14, 115); - String::append_char(__local_14, 117); - String::append_char(__local_14, 109); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 115); + String::push(__local_14, 117); + String::push(__local_14, 109); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_45 = __local_15; i32::fmt_decimal(sum, __local_45); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -1348,25 +1348,25 @@ condition: sum == 15 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_7_iterator_fold"), used: 22 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_7_iterator_fold"), used: 22 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_52 = __local_17; i32::fmt_decimal(117, __local_52); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: product == 120 "), used: 27 }); - String::append(__local_16, String { repr: array.new_data("product: "), used: 9 }); + String::push_str(__local_16, String { repr: array.new_data("product: "), used: 9 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_57 = __local_17; i32::fmt_decimal(product, __local_57); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -1376,29 +1376,29 @@ condition: product == 120 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_7_iterator_fold"), used: 22 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_7_iterator_fold"), used: 22 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_64 = __local_19; i32::fmt_decimal(125, __local_64); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: max == 5 "), used: 21 }); - String::append_char(__local_18, 109); - String::append_char(__local_18, 97); - String::append_char(__local_18, 120); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 109); + String::push(__local_18, 97); + String::push(__local_18, 120); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_69 = __local_19; i32::fmt_decimal(max, __local_69); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -1408,31 +1408,31 @@ condition: max == 5 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_7_iterator_fold"), used: 22 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_7_iterator_fold"), used: 22 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_76 = __local_21; i32::fmt_decimal(133, __local_76); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: count == 3 "), used: 23 }); - String::append_char(__local_20, 99); - String::append_char(__local_20, 111); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 116); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 99); + String::push(__local_20, 111); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 116); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_81 = __local_21; i32::fmt_decimal(count, __local_81); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -1489,25 +1489,25 @@ fn __test_8_iterator_map() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_8_iterator_map"), used: 21 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_8_iterator_map"), used: 21 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_43 = __local_14; i32::fmt_decimal(140, __local_43); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: doubled[0] == 2 "), used: 28 }); - String::append(__local_13, String { repr: array.new_data("doubled[0]: "), used: 12 }); + String::push_str(__local_13, String { repr: array.new_data("doubled[0]: "), used: 12 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_48 = __local_14; i32::fmt_decimal(__v0_3, __local_48); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -1523,25 +1523,25 @@ condition: doubled[0] == 2 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_8_iterator_map"), used: 21 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_8_iterator_map"), used: 21 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_56 = __local_16; i32::fmt_decimal(141, __local_56); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: doubled[4] == 10 "), used: 29 }); - String::append(__local_15, String { repr: array.new_data("doubled[4]: "), used: 12 }); + String::push_str(__local_15, String { repr: array.new_data("doubled[4]: "), used: 12 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_61 = __local_16; i32::fmt_decimal(__v0_5, __local_61); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -1561,25 +1561,25 @@ condition: doubled[4] == 10 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_8_iterator_map"), used: 21 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_8_iterator_map"), used: 21 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_72 = __local_18; i32::fmt_decimal(145, __local_72); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: tripled[0] == 3 "), used: 28 }); - String::append(__local_17, String { repr: array.new_data("tripled[0]: "), used: 12 }); + String::push_str(__local_17, String { repr: array.new_data("tripled[0]: "), used: 12 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_77 = __local_18; i32::fmt_decimal(__v0_9, __local_77); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -1595,25 +1595,25 @@ condition: tripled[0] == 3 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_8_iterator_map"), used: 21 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_8_iterator_map"), used: 21 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_85 = __local_20; i32::fmt_decimal(146, __local_85); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: tripled[4] == 15 "), used: 29 }); - String::append(__local_19, String { repr: array.new_data("tripled[4]: "), used: 12 }); + String::push_str(__local_19, String { repr: array.new_data("tripled[4]: "), used: 12 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_90 = __local_20; i32::fmt_decimal(__v0_11, __local_90); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -1657,25 +1657,25 @@ fn __test_9_sort_by_ascending() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_9_sort_by_ascending"), used: 26 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_9_sort_by_ascending"), used: 26 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_41 = __local_9; i32::fmt_decimal(162, __local_41); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: nums[0] == 1 "), used: 25 }); - String::append(__local_8, String { repr: array.new_data("nums[0]: "), used: 9 }); + String::push_str(__local_8, String { repr: array.new_data("nums[0]: "), used: 9 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_46 = __local_9; i32::fmt_decimal(__v0_2, __local_46); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1691,25 +1691,25 @@ condition: nums[0] == 1 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_9_sort_by_ascending"), used: 26 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_9_sort_by_ascending"), used: 26 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_54 = __local_11; i32::fmt_decimal(163, __local_54); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: nums[1] == 2 "), used: 25 }); - String::append(__local_10, String { repr: array.new_data("nums[1]: "), used: 9 }); + String::push_str(__local_10, String { repr: array.new_data("nums[1]: "), used: 9 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_59 = __local_11; i32::fmt_decimal(__v0_4, __local_59); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -1725,25 +1725,25 @@ condition: nums[1] == 2 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_9_sort_by_ascending"), used: 26 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_9_sort_by_ascending"), used: 26 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_67 = __local_13; i32::fmt_decimal(164, __local_67); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: nums[8] == 9 "), used: 25 }); - String::append(__local_12, String { repr: array.new_data("nums[8]: "), used: 9 }); + String::push_str(__local_12, String { repr: array.new_data("nums[8]: "), used: 9 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_72 = __local_13; i32::fmt_decimal(__v0_6, __local_72); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -1787,25 +1787,25 @@ fn __test_10_sort_by_descending() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_10_sort_by_descending"), used: 28 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_10_sort_by_descending"), used: 28 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_41 = __local_9; i32::fmt_decimal(180, __local_41); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: nums[0] == 9 "), used: 25 }); - String::append(__local_8, String { repr: array.new_data("nums[0]: "), used: 9 }); + String::push_str(__local_8, String { repr: array.new_data("nums[0]: "), used: 9 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_46 = __local_9; i32::fmt_decimal(__v0_2, __local_46); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1821,25 +1821,25 @@ condition: nums[0] == 9 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_10_sort_by_descending"), used: 28 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_10_sort_by_descending"), used: 28 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_54 = __local_11; i32::fmt_decimal(181, __local_54); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: nums[1] == 8 "), used: 25 }); - String::append(__local_10, String { repr: array.new_data("nums[1]: "), used: 9 }); + String::push_str(__local_10, String { repr: array.new_data("nums[1]: "), used: 9 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_59 = __local_11; i32::fmt_decimal(__v0_4, __local_59); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -1855,25 +1855,25 @@ condition: nums[1] == 8 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_10_sort_by_descending"), used: 28 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_10_sort_by_descending"), used: 28 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_67 = __local_13; i32::fmt_decimal(182, __local_67); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: nums[8] == 1 "), used: 25 }); - String::append(__local_12, String { repr: array.new_data("nums[8]: "), used: 9 }); + String::push_str(__local_12, String { repr: array.new_data("nums[8]: "), used: 9 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_72 = __local_13; i32::fmt_decimal(__v0_6, __local_72); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -1918,32 +1918,32 @@ fn __test_11_sorted_by() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_11_sorted_by"), used: 19 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_11_sorted_by"), used: 19 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_40 = __local_10; i32::fmt_decimal(196, __local_40); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: asc[0] == 1 "), used: 24 }); - String::append_char(__local_9, 97); - String::append_char(__local_9, 115); - String::append_char(__local_9, 99); - String::append_char(__local_9, 91); - String::append_char(__local_9, 48); - String::append_char(__local_9, 93); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 115); + String::push(__local_9, 99); + String::push(__local_9, 91); + String::push(__local_9, 48); + String::push(__local_9, 93); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_45 = __local_10; i32::fmt_decimal(__v0_3, __local_45); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1959,32 +1959,32 @@ condition: asc[0] == 1 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_11_sorted_by"), used: 19 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_11_sorted_by"), used: 19 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_53 = __local_12; i32::fmt_decimal(197, __local_53); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: asc[1] == 1 "), used: 24 }); - String::append_char(__local_11, 97); - String::append_char(__local_11, 115); - String::append_char(__local_11, 99); - String::append_char(__local_11, 91); - String::append_char(__local_11, 49); - String::append_char(__local_11, 93); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 115); + String::push(__local_11, 99); + String::push(__local_11, 91); + String::push(__local_11, 49); + String::push(__local_11, 93); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_58 = __local_12; i32::fmt_decimal(__v0_5, __local_58); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -2000,32 +2000,32 @@ condition: asc[1] == 1 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_11_sorted_by"), used: 19 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_11_sorted_by"), used: 19 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_66 = __local_14; i32::fmt_decimal(198, __local_66); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: asc[7] == 9 "), used: 24 }); - String::append_char(__local_13, 97); - String::append_char(__local_13, 115); - String::append_char(__local_13, 99); - String::append_char(__local_13, 91); - String::append_char(__local_13, 55); - String::append_char(__local_13, 93); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 115); + String::push(__local_13, 99); + String::push(__local_13, 91); + String::push(__local_13, 55); + String::push(__local_13, 93); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_71 = __local_14; i32::fmt_decimal(__v0_7, __local_71); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -2055,32 +2055,32 @@ fn __test_12_generic_method_delegation() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_12_generic_method_delegation"), used: 35 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_12_generic_method_delegation"), used: 35 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/closure_3.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_13 = __local_5; i32::fmt_decimal(204, __local_13); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: result == 3 "), used: 24 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 101); - String::append_char(__local_4, 115); - String::append_char(__local_4, 117); - String::append_char(__local_4, 108); - String::append_char(__local_4, 116); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 114); + String::push(__local_4, 101); + String::push(__local_4, 115); + String::push(__local_4, 117); + String::push(__local_4, 108); + String::push(__local_4, 116); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_18 = __local_5; i32::fmt_decimal(result, __local_18); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -2343,7 +2343,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2358,7 +2358,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2407,18 +2407,18 @@ fn Array::sort_by(self, cmp) { src = self.repr; buf = builtin::array_new(n); width = 1; - __for_5: block { + __for_11: block { block { l101: loop { if (width < n) == 0 { - break __for_5; + break __for_11; }; - __for_6: block { + __for_12: block { start = 0; block { l104: loop { if (start < n) == 0 { - break __for_6; + break __for_12; }; mid = start + width; if mid < n { @@ -2428,12 +2428,12 @@ fn Array::sort_by(self, cmp) { }; i = start; j = mid; - __for_7: block { + __for_13: block { k = start; block { l108: loop { if (k < end) == 0 { - break __for_7; + break __for_13; }; if i < mid { if j < end { @@ -2493,7 +2493,7 @@ fn IterMap,i32>^Iterator::collect(self) { multivalue_bind [__sroa___pattern_temp_0_discriminant, __sroa___pattern_temp_0_payload_0] = IterMap,i32>^Iterator::next(self); if __sroa___pattern_temp_0_discriminant == 0 { item = __sroa___pattern_temp_0_payload_0; - Array::append(result, item); + Array::push(result, item); } else { break b114; }; @@ -2503,7 +2503,7 @@ fn IterMap,i32>^Iterator::collect(self) { return result; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2585,7 +2585,7 @@ fn IterFilter>^Iterator::collect(self) { multivalue_bind [__sroa___pattern_temp_0_discriminant, __sroa___pattern_temp_0_payload_0] = IterFilter>^Iterator::next(self); if __sroa___pattern_temp_0_discriminant == 0 { item = __sroa___pattern_temp_0_payload_0; - Array::append(result, item); + Array::push(result, item); } else { break b124; }; @@ -2662,7 +2662,7 @@ fn IterMap>,i32>^Iterator::collect(self) { multivalue_bind [__sroa___pattern_temp_0_discriminant, __sroa___pattern_temp_0_payload_0] = IterMap>,i32>^Iterator::next(self); if __sroa___pattern_temp_0_discriminant == 0 { item = __sroa___pattern_temp_0_payload_0; - Array::append(result, item); + Array::push(result, item); } else { break b136; }; @@ -2839,18 +2839,18 @@ fn Array::sort_by$__Closure_16(self, cmp) { src = self.repr; buf = builtin::array_new(n); width = 1; - __for_5: block { + __for_11: block { block { l157: loop { if (width < n) == 0 { - break __for_5; + break __for_11; }; - __for_6: block { + __for_12: block { start = 0; block { l160: loop { if (start < n) == 0 { - break __for_6; + break __for_12; }; mid = start + width; if mid < n { @@ -2860,12 +2860,12 @@ fn Array::sort_by$__Closure_16(self, cmp) { }; i = start; j = mid; - __for_7: block { + __for_13: block { k = start; block { l164: loop { if (k < end) == 0 { - break __for_7; + break __for_13; }; if i < mid { if j < end { @@ -2928,18 +2928,18 @@ fn Array::sort_by$__Closure_17(self, cmp) { src = self.repr; buf = builtin::array_new(n); width = 1; - __for_5: block { + __for_11: block { block { l171: loop { if (width < n) == 0 { - break __for_5; + break __for_11; }; - __for_6: block { + __for_12: block { start = 0; block { l174: loop { if (start < n) == 0 { - break __for_6; + break __for_12; }; mid = start + width; if mid < n { @@ -2949,12 +2949,12 @@ fn Array::sort_by$__Closure_17(self, cmp) { }; i = start; j = mid; - __for_7: block { + __for_13: block { k = start; block { l178: loop { if (k < end) == 0 { - break __for_7; + break __for_13; }; if i < mid { if j < end { @@ -3018,7 +3018,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l184; }; @@ -3052,20 +3052,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3075,10 +3075,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3088,10 +3088,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3099,10 +3099,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/coerce_float.wir.wado b/wado-compiler/tests/fixtures.golden/coerce_float.wir.wado index e4aed3ad6..b39b3301d 100644 --- a/wado-compiler/tests/fixtures.golden/coerce_float.wir.wado +++ b/wado-compiler/tests/fixtures.golden/coerce_float.wir.wado @@ -95,7 +95,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -103,7 +103,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -174,7 +174,7 @@ fn coerce_float_literal_f32_const() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(24), used: 0 }; - String::append(__local_1, String { repr: array.new_data("f32 PI: "), used: 8 }); + String::push_str(__local_1, String { repr: array.new_data("f32 PI: "), used: 8 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; f32::fmt_into(3.1415927_f32, __local_2); break __tmpl: __local_1; @@ -988,7 +988,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1043,7 +1043,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1075,7 +1075,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1157,25 +1157,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1278,9 +1278,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1334,13 +1334,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1375,9 +1375,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1418,7 +1418,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/coerce_float_literal_args.wir.wado b/wado-compiler/tests/fixtures.golden/coerce_float_literal_args.wir.wado index e09a6948a..f02106cfa 100644 --- a/wado-compiler/tests/fixtures.golden/coerce_float_literal_args.wir.wado +++ b/wado-compiler/tests/fixtures.golden/coerce_float_literal_args.wir.wado @@ -91,7 +91,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -99,7 +99,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -164,14 +164,14 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(21), used: 0 }; - String::append(__local_2, String { repr: array.new_data("f32: "), used: 5 }); + String::push_str(__local_2, String { repr: array.new_data("f32: "), used: 5 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f32::fmt_into(3.14_f32, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(21), used: 0 }; - String::append(__local_4, String { repr: array.new_data("f64: "), used: 5 }); + String::push_str(__local_4, String { repr: array.new_data("f64: "), used: 5 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; f64::fmt_into(2.718, __local_5); break __tmpl: __local_4; @@ -1068,7 +1068,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1123,7 +1123,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1155,7 +1155,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1237,25 +1237,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1358,9 +1358,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1425,9 +1425,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1481,13 +1481,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1522,9 +1522,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1565,7 +1565,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/coerce_float_literal_let.wir.wado b/wado-compiler/tests/fixtures.golden/coerce_float_literal_let.wir.wado index e31e29e20..8d926d2ed 100644 --- a/wado-compiler/tests/fixtures.golden/coerce_float_literal_let.wir.wado +++ b/wado-compiler/tests/fixtures.golden/coerce_float_literal_let.wir.wado @@ -91,7 +91,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -99,7 +99,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -164,14 +164,14 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(21), used: 0 }; - String::append(__local_2, String { repr: array.new_data("f32: "), used: 5 }); + String::push_str(__local_2, String { repr: array.new_data("f32: "), used: 5 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f32::fmt_into(3.14_f32, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(21), used: 0 }; - String::append(__local_4, String { repr: array.new_data("f64: "), used: 5 }); + String::push_str(__local_4, String { repr: array.new_data("f64: "), used: 5 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; f64::fmt_into(2.718, __local_5); break __tmpl: __local_4; @@ -1068,7 +1068,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1123,7 +1123,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1155,7 +1155,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1237,25 +1237,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1358,9 +1358,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1425,9 +1425,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1481,13 +1481,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1522,9 +1522,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1565,7 +1565,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/coerce_float_literal_return.wir.wado b/wado-compiler/tests/fixtures.golden/coerce_float_literal_return.wir.wado index 943d9aa05..0eea5b0a5 100644 --- a/wado-compiler/tests/fixtures.golden/coerce_float_literal_return.wir.wado +++ b/wado-compiler/tests/fixtures.golden/coerce_float_literal_return.wir.wado @@ -91,7 +91,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -99,7 +99,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -164,14 +164,14 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(21), used: 0 }; - String::append(__local_0, String { repr: array.new_data("f32: "), used: 5 }); + String::push_str(__local_0, String { repr: array.new_data("f32: "), used: 5 }); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; f32::fmt_into(3.14_f32, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(21), used: 0 }; - String::append(__local_2, String { repr: array.new_data("f64: "), used: 5 }); + String::push_str(__local_2, String { repr: array.new_data("f64: "), used: 5 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(2.718, __local_3); break __tmpl: __local_2; @@ -1068,7 +1068,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1123,7 +1123,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1155,7 +1155,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1237,25 +1237,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1358,9 +1358,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1425,9 +1425,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1481,13 +1481,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1522,9 +1522,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1565,7 +1565,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/coerce_i128_u128.wir.wado b/wado-compiler/tests/fixtures.golden/coerce_i128_u128.wir.wado index 71f3c09e1..048f1ce42 100644 --- a/wado-compiler/tests/fixtures.golden/coerce_i128_u128.wir.wado +++ b/wado-compiler/tests/fixtures.golden/coerce_i128_u128.wir.wado @@ -103,9 +103,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -150,16 +150,16 @@ fn run() with Stdout { __sroa_b_b = i128 { low: -100_i64, high: -1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_3, 97); - String::append_char(__local_3, 61); + String::push(__local_3, 97); + String::push(__local_3, 61); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; u128::fmt_decimal(__sroa_b_a, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_5, 98); - String::append_char(__local_5, 61); + String::push(__local_5, 98); + String::push(__local_5, 61); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i128::fmt_decimal(__sroa_b_b, __local_6); break __tmpl: __local_5; @@ -168,16 +168,16 @@ fn run() with Stdout { y = i128 { low: -67890_i64, high: -1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_7, 120); - String::append_char(__local_7, 61); + String::push(__local_7, 120); + String::push(__local_7, 61); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; u128::fmt_decimal(x, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_9, 121); - String::append_char(__local_9, 61); + String::push(__local_9, 121); + String::push(__local_9, 61); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i128::fmt_decimal(y, __local_10); break __tmpl: __local_9; @@ -671,7 +671,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -686,7 +686,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -724,7 +724,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l51; }; @@ -758,20 +758,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -781,10 +781,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -794,10 +794,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -805,10 +805,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/coerce_int_1.wir.wado b/wado-compiler/tests/fixtures.golden/coerce_int_1.wir.wado index cee46c43f..f03410d24 100644 --- a/wado-compiler/tests/fixtures.golden/coerce_int_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/coerce_int_1.wir.wado @@ -88,9 +88,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -145,42 +145,42 @@ fn coerce_int_literal_args() with Stdout { let __local_11: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_4, 105); - String::append_char(__local_4, 54); - String::append_char(__local_4, 52); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 105); + String::push(__local_4, 54); + String::push(__local_4, 52); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i64::fmt_decimal(42_i64, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_6, 117); - String::append_char(__local_6, 54); - String::append_char(__local_6, 52); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 117); + String::push(__local_6, 54); + String::push(__local_6, 52); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; u64::fmt_decimal(100_i64, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_8, 105); - String::append_char(__local_8, 56); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 105); + String::push(__local_8, 56); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(10, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_10, 117); - String::append_char(__local_10, 56); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 117); + String::push(__local_10, 56); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(200, __local_11); break __tmpl: __local_10; @@ -198,28 +198,28 @@ fn coerce_int_literal_binary() with Stdout { let __local_29: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_22, String { repr: array.new_data("i64 + 42: "), used: 10 }); + String::push_str(__local_22, String { repr: array.new_data("i64 + 42: "), used: 10 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i64::fmt_decimal(1000000000042_i64, __local_23); break __tmpl: __local_22; }); "core:cli/println"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_24, String { repr: array.new_data("u64 * 2: "), used: 9 }); + String::push_str(__local_24, String { repr: array.new_data("u64 * 2: "), used: 9 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; u64::fmt_decimal(1553255926290448384_i64, __local_25); break __tmpl: __local_24; }); "core:cli/println"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_26, String { repr: array.new_data("100 + i64: "), used: 11 }); + String::push_str(__local_26, String { repr: array.new_data("100 + i64: "), used: 11 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; i64::fmt_decimal(1000000000100_i64, __local_27); break __tmpl: __local_26; }); "core:cli/println"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_28, String { repr: array.new_data("3 * u64: "), used: 9 }); + String::push_str(__local_28, String { repr: array.new_data("3 * u64: "), used: 9 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; u64::fmt_decimal(-6893488147419103232_i64, __local_29); break __tmpl: __local_28; @@ -902,7 +902,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -917,7 +917,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -955,7 +955,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l62; }; @@ -989,20 +989,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1012,10 +1012,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1025,10 +1025,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1036,10 +1036,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/coerce_int_3.wir.wado b/wado-compiler/tests/fixtures.golden/coerce_int_3.wir.wado index 621131d37..560c4d646 100644 --- a/wado-compiler/tests/fixtures.golden/coerce_int_3.wir.wado +++ b/wado-compiler/tests/fixtures.golden/coerce_int_3.wir.wado @@ -98,9 +98,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -413,28 +413,28 @@ fn coerce_int_literal_const_i64() with Stdout { let __local_7: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_0, String { repr: array.new_data("i64 MAX: "), used: 9 }); + String::push_str(__local_0, String { repr: array.new_data("i64 MAX: "), used: 9 }); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i64::fmt_decimal(9223372036854775807_i64, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_2, String { repr: array.new_data("i64 MIN: "), used: 9 }); + String::push_str(__local_2, String { repr: array.new_data("i64 MIN: "), used: 9 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i64::fmt_decimal(-9223372036854775808_i64, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_4, String { repr: array.new_data("u64 MAX: "), used: 9 }); + String::push_str(__local_4, String { repr: array.new_data("u64 MAX: "), used: 9 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; u64::fmt_decimal(-1_i64, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_6, String { repr: array.new_data("u64 MIN: "), used: 9 }); + String::push_str(__local_6, String { repr: array.new_data("u64 MIN: "), used: 9 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; u64::fmt_decimal(0_i64, __local_7); break __tmpl: __local_6; @@ -448,25 +448,25 @@ fn coerce_int_literal_if_branch() with Stdout { let __local_3: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_0, 116); - String::append_char(__local_0, 114); - String::append_char(__local_0, 117); - String::append_char(__local_0, 101); - String::append_char(__local_0, 58); - String::append_char(__local_0, 32); + String::push(__local_0, 116); + String::push(__local_0, 114); + String::push(__local_0, 117); + String::push(__local_0, 101); + String::push(__local_0, 58); + String::push(__local_0, 32); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i64::fmt_decimal(-1_i64, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 102); - String::append_char(__local_2, 97); - String::append_char(__local_2, 108); - String::append_char(__local_2, 115); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 102); + String::push(__local_2, 97); + String::push(__local_2, 108); + String::push(__local_2, 115); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i64::fmt_decimal(0_i64, __local_3); break __tmpl: __local_2; @@ -478,13 +478,13 @@ fn coerce_int_literal_instance_method_arg() with Stdout { let __local_3: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 118); - String::append_char(__local_2, 97); - String::append_char(__local_2, 108); - String::append_char(__local_2, 117); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 118); + String::push(__local_2, 97); + String::push(__local_2, 108); + String::push(__local_2, 117); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; u64::fmt_decimal(10_i64, __local_3); break __tmpl: __local_2; @@ -510,86 +510,86 @@ fn coerce_int_literal_let() with Stdout { let __local_23: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_8, 105); - String::append_char(__local_8, 56); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 105); + String::push(__local_8, 56); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(42, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_10, 105); - String::append_char(__local_10, 49); - String::append_char(__local_10, 54); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 105); + String::push(__local_10, 49); + String::push(__local_10, 54); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(1000, __local_11); break __tmpl: __local_10; }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_12, 105); - String::append_char(__local_12, 51); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 105); + String::push(__local_12, 51); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(100000, __local_13); break __tmpl: __local_12; }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_14, 105); - String::append_char(__local_14, 54); - String::append_char(__local_14, 52); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 105); + String::push(__local_14, 54); + String::push(__local_14, 52); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i64::fmt_decimal(10000000000_i64, __local_15); break __tmpl: __local_14; }); "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_16, 117); - String::append_char(__local_16, 56); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 117); + String::push(__local_16, 56); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(200, __local_17); break __tmpl: __local_16; }); "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_18, 117); - String::append_char(__local_18, 49); - String::append_char(__local_18, 54); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 117); + String::push(__local_18, 49); + String::push(__local_18, 54); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(50000, __local_19); break __tmpl: __local_18; }); "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_20, 117); - String::append_char(__local_20, 51); - String::append_char(__local_20, 50); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 117); + String::push(__local_20, 51); + String::push(__local_20, 50); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; u32::fmt_decimal(-1294967296, __local_21); break __tmpl: __local_20; }); "core:cli/println"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_22, 117); - String::append_char(__local_22, 54); - String::append_char(__local_22, 52); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); + String::push(__local_22, 117); + String::push(__local_22, 54); + String::push(__local_22, 52); + String::push(__local_22, 58); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; u64::fmt_decimal(-8446744073709551616_i64, __local_23); break __tmpl: __local_22; @@ -1020,7 +1020,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1035,7 +1035,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1073,7 +1073,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l79; }; @@ -1107,20 +1107,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1130,10 +1130,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1143,10 +1143,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1154,10 +1154,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/coerce_int_4.wir.wado b/wado-compiler/tests/fixtures.golden/coerce_int_4.wir.wado index 6ea669c9e..aa2c85a74 100644 --- a/wado-compiler/tests/fixtures.golden/coerce_int_4.wir.wado +++ b/wado-compiler/tests/fixtures.golden/coerce_int_4.wir.wado @@ -70,9 +70,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -112,26 +112,26 @@ fn coerce_int_literal_method_arg() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 118); - String::append_char(__local_2, 97); - String::append_char(__local_2, 108); - String::append_char(__local_2, 117); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 118); + String::push(__local_2, 97); + String::push(__local_2, 108); + String::push(__local_2, 117); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; u64::fmt_decimal(0_i64, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_4, 118); - String::append_char(__local_4, 97); - String::append_char(__local_4, 108); - String::append_char(__local_4, 117); - String::append_char(__local_4, 101); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 97); + String::push(__local_4, 108); + String::push(__local_4, 117); + String::push(__local_4, 101); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; u64::fmt_decimal(42_i64, __local_5); break __tmpl: __local_4; @@ -149,42 +149,42 @@ fn coerce_int_literal_return() with Stdout { let __local_7: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_0, 105); - String::append_char(__local_0, 54); - String::append_char(__local_0, 52); - String::append_char(__local_0, 58); - String::append_char(__local_0, 32); + String::push(__local_0, 105); + String::push(__local_0, 54); + String::push(__local_0, 52); + String::push(__local_0, 58); + String::push(__local_0, 32); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i64::fmt_decimal(42_i64, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_2, 117); - String::append_char(__local_2, 54); - String::append_char(__local_2, 52); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 117); + String::push(__local_2, 54); + String::push(__local_2, 52); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; u64::fmt_decimal(100_i64, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_4, 105); - String::append_char(__local_4, 56); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 105); + String::push(__local_4, 56); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(10, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_6, 117); - String::append_char(__local_6, 56); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 117); + String::push(__local_6, 56); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(200, __local_7); break __tmpl: __local_6; @@ -198,7 +198,7 @@ fn coerce_int_literal_u64_comparison() with Stdout { let __local_3: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_0, String { repr: array.new_data("0 is zero: "), used: 11 }); + String::push_str(__local_0, String { repr: array.new_data("0 is zero: "), used: 11 }); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; Formatter::pad(__local_1, block -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -207,7 +207,7 @@ fn coerce_int_literal_u64_comparison() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_2, String { repr: array.new_data("1 is zero: "), used: 11 }); + String::push_str(__local_2, String { repr: array.new_data("1 is zero: "), used: 11 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; Formatter::pad(__local_3, block -> ref String { String { repr: array.new_data("false"), used: 5 }; @@ -547,7 +547,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -562,7 +562,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -600,7 +600,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l39; }; @@ -620,7 +620,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -628,17 +628,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -668,20 +668,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -691,10 +691,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -704,10 +704,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -715,10 +715,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/coerce_match_arm.wir.wado b/wado-compiler/tests/fixtures.golden/coerce_match_arm.wir.wado index d52b2778a..96dc99a64 100644 --- a/wado-compiler/tests/fixtures.golden/coerce_match_arm.wir.wado +++ b/wado-compiler/tests/fixtures.golden/coerce_match_arm.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -142,16 +142,16 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_8, 117); - String::append_char(__local_8, 54); - String::append_char(__local_8, 52); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 117); + String::push(__local_8, 54); + String::push(__local_8, 52); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_22 = __local_9; u64::fmt_decimal(u64_0, __local_22); - String::append_char(__local_8, 44); - String::append_char(__local_8, 32); + String::push(__local_8, 44); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_27 = __local_9; u64::fmt_decimal(u64_1, __local_27); @@ -177,16 +177,16 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_10, 105); - String::append_char(__local_10, 54); - String::append_char(__local_10, 52); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 105); + String::push(__local_10, 54); + String::push(__local_10, 52); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_35 = __local_11; i64::fmt_decimal(i64_0, __local_35); - String::append_char(__local_10, 44); - String::append_char(__local_10, 32); + String::push(__local_10, 44); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_40 = __local_11; i64::fmt_decimal(i64_1, __local_40); @@ -212,15 +212,15 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(38), used: 0 }; - String::append_char(__local_12, 117); - String::append_char(__local_12, 56); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 117); + String::push(__local_12, 56); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_48 = __local_13; i32::fmt_decimal(u8_0, __local_48); - String::append_char(__local_12, 44); - String::append_char(__local_12, 32); + String::push(__local_12, 44); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_53 = __local_13; i32::fmt_decimal(u8_1, __local_53); @@ -246,15 +246,15 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(38), used: 0 }; - String::append_char(__local_14, 105); - String::append_char(__local_14, 56); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 105); + String::push(__local_14, 56); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_61 = __local_15; i32::fmt_decimal(i8_0, __local_61); - String::append_char(__local_14, 44); - String::append_char(__local_14, 32); + String::push(__local_14, 44); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_66 = __local_15; i32::fmt_decimal(i8_1, __local_66); @@ -585,7 +585,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -600,7 +600,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -638,7 +638,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l53; }; @@ -672,20 +672,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -695,10 +695,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -708,10 +708,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -719,10 +719,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/coerce_struct_field.wir.wado b/wado-compiler/tests/fixtures.golden/coerce_struct_field.wir.wado index 0028d5336..b3881299c 100644 --- a/wado-compiler/tests/fixtures.golden/coerce_struct_field.wir.wado +++ b/wado-compiler/tests/fixtures.golden/coerce_struct_field.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -114,63 +114,63 @@ fn run() with Stdout { let __local_56: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_3, 104); - String::append_char(__local_3, 105); - String::append_char(__local_3, 61); + String::push(__local_3, 104); + String::push(__local_3, 105); + String::push(__local_3, 61); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i64::fmt_decimal(1311768467463790320_i64, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_5, 108); - String::append_char(__local_5, 111); - String::append_char(__local_5, 61); + String::push(__local_5, 108); + String::push(__local_5, 111); + String::push(__local_5, 61); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; u64::fmt_decimal(-1671618768450675796_i64, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_7, 120); - String::append_char(__local_7, 61); + String::push(__local_7, 120); + String::push(__local_7, 61); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i64::fmt_decimal(-100_i64, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_9, 121); - String::append_char(__local_9, 61); + String::push(__local_9, 121); + String::push(__local_9, 61); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i64::fmt_decimal(200_i64, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(78), used: 0 }; - String::append_char(__local_11, 97); - String::append_char(__local_11, 61); + String::push(__local_11, 97); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_41 = __local_12; i32::fmt_decimal(255, __local_41); - String::append_char(__local_11, 44); - String::append_char(__local_11, 32); - String::append_char(__local_11, 98); - String::append_char(__local_11, 61); + String::push(__local_11, 44); + String::push(__local_11, 32); + String::push(__local_11, 98); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_46 = __local_12; i32::fmt_decimal(-128, __local_46); - String::append_char(__local_11, 44); - String::append_char(__local_11, 32); - String::append_char(__local_11, 99); - String::append_char(__local_11, 61); + String::push(__local_11, 44); + String::push(__local_11, 32); + String::push(__local_11, 99); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_51 = __local_12; i32::fmt_decimal(0, __local_51); - String::append_char(__local_11, 44); - String::append_char(__local_11, 32); - String::append_char(__local_11, 100); - String::append_char(__local_11, 61); + String::push(__local_11, 44); + String::push(__local_11, 32); + String::push(__local_11, 100); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_56 = __local_12; i32::fmt_decimal(127, __local_56); @@ -501,7 +501,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -516,7 +516,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -554,7 +554,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l37; }; @@ -588,20 +588,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -611,10 +611,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -624,10 +624,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -635,10 +635,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/compound_assign_basic.wir.wado b/wado-compiler/tests/fixtures.golden/compound_assign_basic.wir.wado index 100d49aec..de3809387 100644 --- a/wado-compiler/tests/fixtures.golden/compound_assign_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/compound_assign_basic.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -106,55 +106,55 @@ fn run() with Stdout { let __local_10: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_1, 43); - String::append_char(__local_1, 61); - String::append_char(__local_1, 32); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 43); + String::push(__local_1, 61); + String::push(__local_1, 32); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(15, __local_2); break __tmpl: __local_1; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_3, 45); - String::append_char(__local_3, 61); - String::append_char(__local_3, 32); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 45); + String::push(__local_3, 61); + String::push(__local_3, 32); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(12, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_5, 42); - String::append_char(__local_5, 61); - String::append_char(__local_5, 32); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 42); + String::push(__local_5, 61); + String::push(__local_5, 32); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(24, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 47); - String::append_char(__local_7, 61); - String::append_char(__local_7, 32); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 47); + String::push(__local_7, 61); + String::push(__local_7, 32); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(6, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_9, 37); - String::append_char(__local_9, 61); - String::append_char(__local_9, 32); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 37); + String::push(__local_9, 61); + String::push(__local_9, 32); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(2, __local_10); break __tmpl: __local_9; @@ -356,7 +356,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -371,7 +371,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -409,7 +409,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -443,20 +443,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -466,10 +466,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -479,10 +479,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -490,10 +490,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/const_fold.wir.wado b/wado-compiler/tests/fixtures.golden/const_fold.wir.wado index fea862497..bded34006 100644 --- a/wado-compiler/tests/fixtures.golden/const_fold.wir.wado +++ b/wado-compiler/tests/fixtures.golden/const_fold.wir.wado @@ -73,7 +73,7 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -81,9 +81,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -133,56 +133,56 @@ fn const_fold_int_basic() with Stdout { let __local_20: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_7, 97); - String::append_char(__local_7, 61); + String::push(__local_7, 97); + String::push(__local_7, 61); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(42, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_9, 98); - String::append_char(__local_9, 61); + String::push(__local_9, 98); + String::push(__local_9, 61); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(123, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_11, 99); - String::append_char(__local_11, 61); + String::push(__local_11, 99); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(42, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_13, 100); - String::append_char(__local_13, 61); + String::push(__local_13, 100); + String::push(__local_13, 61); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(42, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_15, 101); - String::append_char(__local_15, 61); + String::push(__local_15, 101); + String::push(__local_15, 61); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(1, __local_16); break __tmpl: __local_15; }); "core:cli/println"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_17, 102); - String::append_char(__local_17, 61); + String::push(__local_17, 102); + String::push(__local_17, 61); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; i32::fmt_decimal(9, __local_18); break __tmpl: __local_17; }); "core:cli/println"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_19, 103); - String::append_char(__local_19, 61); + String::push(__local_19, 103); + String::push(__local_19, 61); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; i32::fmt_decimal(25, __local_20); break __tmpl: __local_19; @@ -204,48 +204,48 @@ fn const_fold_int_types() with Stdout { let __local_17: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_6, 97); - String::append_char(__local_6, 61); + String::push(__local_6, 97); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i64::fmt_decimal(1000000000000_i64, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_8, 98); - String::append_char(__local_8, 61); + String::push(__local_8, 98); + String::push(__local_8, 61); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; u32::fmt_decimal(300, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_10, 99); - String::append_char(__local_10, 61); + String::push(__local_10, 99); + String::push(__local_10, 61); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(33, __local_11); break __tmpl: __local_10; }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_12, 100); - String::append_char(__local_12, 61); + String::push(__local_12, 100); + String::push(__local_12, 61); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(0, __local_13); break __tmpl: __local_12; }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_14, 101); - String::append_char(__local_14, 61); + String::push(__local_14, 101); + String::push(__local_14, 61); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(0, __local_15); break __tmpl: __local_14; }); "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_16, 102); - String::append_char(__local_16, 61); + String::push(__local_16, 102); + String::push(__local_16, 61); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(2, __local_17); break __tmpl: __local_16; @@ -418,7 +418,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -573,7 +573,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -588,7 +588,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -626,7 +626,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l32; }; @@ -660,20 +660,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -683,10 +683,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -696,10 +696,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -707,10 +707,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/contextual_keyword.wir.wado b/wado-compiler/tests/fixtures.golden/contextual_keyword.wir.wado index b099e2e5a..0c9937e8e 100644 --- a/wado-compiler/tests/fixtures.golden/contextual_keyword.wir.wado +++ b/wado-compiler/tests/fixtures.golden/contextual_keyword.wir.wado @@ -77,11 +77,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -131,21 +131,21 @@ fn run() with Stdout { let __local_21: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_12, String { repr: array.new_data("flags + type + of = "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("flags + type + of = "), used: 20 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(60, __local_13); break __tmpl: __local_12; }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_14, String { repr: array.new_data("test_param result = "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("test_param result = "), used: 20 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(60, __local_15); break __tmpl: __local_14; }); "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_16, String { repr: array.new_data("item.of = "), used: 10 }); + String::push_str(__local_16, String { repr: array.new_data("item.of = "), used: 10 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(42, __local_17); break __tmpl: __local_16; @@ -164,7 +164,7 @@ fn run() with Stdout { flags = __sroa___pattern_temp_0_payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_18, String { repr: array.new_data("for-of flags = "), used: 15 }); + String::push_str(__local_18, String { repr: array.new_data("for-of flags = "), used: 15 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(flags, __local_19); break __tmpl: __local_18; @@ -185,7 +185,7 @@ fn run() with Stdout { of = __sroa___pattern_temp_1_payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_20, String { repr: array.new_data("for-of of = "), used: 12 }); + String::push_str(__local_20, String { repr: array.new_data("for-of of = "), used: 12 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(of, __local_21); break __tmpl: __local_20; @@ -393,7 +393,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -408,7 +408,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -445,7 +445,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -498,7 +498,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -532,20 +532,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -555,10 +555,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -568,10 +568,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -579,10 +579,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/copy_prop_mutable_source.wir.wado b/wado-compiler/tests/fixtures.golden/copy_prop_mutable_source.wir.wado index 851860897..e2d4eb002 100644 --- a/wado-compiler/tests/fixtures.golden/copy_prop_mutable_source.wir.wado +++ b/wado-compiler/tests/fixtures.golden/copy_prop_mutable_source.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -114,18 +114,18 @@ fn run() with Stdout { let __local_58: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(41), used: 0 }; - String::append_char(__local_8, 117); - String::append_char(__local_8, 56); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 61); + String::push(__local_8, 117); + String::push(__local_8, 56); + String::push(__local_8, 58); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 61); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_20 = __local_9; i32::fmt_decimal(1, __local_20); - String::append_char(__local_8, 32); - String::append_char(__local_8, 98); - String::append_char(__local_8, 61); + String::push(__local_8, 32); + String::push(__local_8, 98); + String::push(__local_8, 61); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_25 = __local_9; i32::fmt_decimal(9, __local_25); @@ -133,19 +133,19 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(42), used: 0 }; - String::append_char(__local_10, 105); - String::append_char(__local_10, 51); - String::append_char(__local_10, 50); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 61); + String::push(__local_10, 105); + String::push(__local_10, 51); + String::push(__local_10, 50); + String::push(__local_10, 58); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 61); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_31 = __local_11; i32::fmt_decimal(1, __local_31); - String::append_char(__local_10, 32); - String::append_char(__local_10, 98); - String::append_char(__local_10, 61); + String::push(__local_10, 32); + String::push(__local_10, 98); + String::push(__local_10, 61); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_36 = __local_11; i32::fmt_decimal(9, __local_36); @@ -153,19 +153,19 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(42), used: 0 }; - String::append_char(__local_12, 117); - String::append_char(__local_12, 49); - String::append_char(__local_12, 54); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 61); + String::push(__local_12, 117); + String::push(__local_12, 49); + String::push(__local_12, 54); + String::push(__local_12, 58); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 61); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_42 = __local_13; i32::fmt_decimal(1, __local_42); - String::append_char(__local_12, 32); - String::append_char(__local_12, 98); - String::append_char(__local_12, 61); + String::push(__local_12, 32); + String::push(__local_12, 98); + String::push(__local_12, 61); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_47 = __local_13; i32::fmt_decimal(9, __local_47); @@ -173,19 +173,19 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(42), used: 0 }; - String::append_char(__local_14, 117); - String::append_char(__local_14, 51); - String::append_char(__local_14, 50); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 61); + String::push(__local_14, 117); + String::push(__local_14, 51); + String::push(__local_14, 50); + String::push(__local_14, 58); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 61); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_53 = __local_15; u32::fmt_decimal(1, __local_53); - String::append_char(__local_14, 32); - String::append_char(__local_14, 98); - String::append_char(__local_14, 61); + String::push(__local_14, 32); + String::push(__local_14, 98); + String::push(__local_14, 61); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_58 = __local_15; u32::fmt_decimal(9, __local_58); @@ -409,7 +409,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -424,7 +424,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -462,7 +462,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -496,20 +496,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -519,10 +519,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -532,10 +532,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -543,10 +543,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/cross_destruct_patterns.wir.wado b/wado-compiler/tests/fixtures.golden/cross_destruct_patterns.wir.wado index 398e8dfd3..fefc39c27 100644 --- a/wado-compiler/tests/fixtures.golden/cross_destruct_patterns.wir.wado +++ b/wado-compiler/tests/fixtures.golden/cross_destruct_patterns.wir.wado @@ -92,13 +92,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref null Tagged; -type "functype/Array::append" = fn(ref Array, ref Tagged); +type "functype/Array::push" = fn(ref Array, ref Tagged); type "functype/Array::grow" = fn(ref Array); @@ -168,14 +168,14 @@ fn run() with Stdout { __sroa_tagged_label = String { repr: array.new_data("A"), used: 1 }; "core:cli/println"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(52), used: 0 }; - String::append(__local_23, __sroa_tagged_label); - String::append_char(__local_23, 58); - String::append_char(__local_23, 32); + String::push_str(__local_23, __sroa_tagged_label); + String::push(__local_23, 58); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_46 = __local_24; i32::fmt_decimal(10, __local_46); - String::append_char(__local_23, 44); - String::append_char(__local_23, 32); + String::push(__local_23, 44); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_51 = __local_24; i32::fmt_decimal(20, __local_51); @@ -184,14 +184,14 @@ fn run() with Stdout { __sroa_pair_1 = String { repr: array.new_data("origin"), used: 6 }; "core:cli/println"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(52), used: 0 }; - String::append(__local_25, __sroa_pair_1); - String::append_char(__local_25, 58); - String::append_char(__local_25, 32); + String::push_str(__local_25, __sroa_pair_1); + String::push(__local_25, 58); + String::push(__local_25, 32); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_57 = __local_26; i32::fmt_decimal(1, __local_57); - String::append_char(__local_25, 44); - String::append_char(__local_25, 32); + String::push(__local_25, 44); + String::push(__local_25, 32); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_62 = __local_26; i32::fmt_decimal(2, __local_62); @@ -213,9 +213,9 @@ fn run() with Stdout { b = __pattern_temp_6.1; "core:cli/println"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_27, l); - String::append_char(__local_27, 58); - String::append_char(__local_27, 32); + String::push_str(__local_27, l); + String::push(__local_27, 58); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; i32::fmt_decimal(a + b, __local_28); break __tmpl: __local_27; @@ -245,8 +245,8 @@ fn run() with Stdout { __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_82 = __local_30; i32::fmt_decimal(__local_17, __local_82); - String::append_char(__local_29, 44); - String::append_char(__local_29, 32); + String::push(__local_29, 44); + String::push(__local_29, 32); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_87 = __local_30; i32::fmt_decimal(__local_18, __local_87); @@ -463,7 +463,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -478,7 +478,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -515,7 +515,7 @@ fn ArrayIter^Iterator::next(self) { return item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -568,7 +568,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l33; }; @@ -602,20 +602,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -625,10 +625,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -638,10 +638,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -649,10 +649,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/cross_module_generic_deep.wir.wado b/wado-compiler/tests/fixtures.golden/cross_module_generic_deep.wir.wado index a4e219167..561bc8515 100644 --- a/wado-compiler/tests/fixtures.golden/cross_module_generic_deep.wir.wado +++ b/wado-compiler/tests/fixtures.golden/cross_module_generic_deep.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -112,35 +112,35 @@ fn run() with Stdout { let __local_66: ref String; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_6, String { repr: array.new_data("wrap(42) = "), used: 11 }); + String::push_str(__local_6, String { repr: array.new_data("wrap(42) = "), used: 11 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(42, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_8, String { repr: array.new_data("apply_twice(10) = "), used: 18 }); + String::push_str(__local_8, String { repr: array.new_data("apply_twice(10) = "), used: 18 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(10, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(57), used: 0 }; - String::append(__local_10, String { repr: array.new_data("wrap_and_double(5) = ["), used: 22 }); + String::push_str(__local_10, String { repr: array.new_data("wrap_and_double(5) = ["), used: 22 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_42 = __local_11; i32::fmt_decimal(5, __local_42); - String::append_char(__local_10, 44); - String::append_char(__local_10, 32); + String::push(__local_10, 44); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_47 = __local_11; i32::fmt_decimal(5, __local_47); - String::append_char(__local_10, 93); + String::push(__local_10, 93); break __tmpl: __local_10; }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_12, String { repr: array.new_data("quad_wrap(7) = "), used: 15 }); + String::push_str(__local_12, String { repr: array.new_data("quad_wrap(7) = "), used: 15 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(7, __local_13); break __tmpl: __local_12; @@ -151,8 +151,8 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_14, String { repr: array.new_data("wrap(hello) = "), used: 14 }); - String::append(__local_14, s); + String::push_str(__local_14, String { repr: array.new_data("wrap(hello) = "), used: 14 }); + String::push_str(__local_14, s); break __tmpl: __local_14; }); s2 = __inline___sub_generic_level2_wado_quad_wrap_String__35: block -> ref String { @@ -161,8 +161,8 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_15, String { repr: array.new_data("quad_wrap(world) = "), used: 19 }); - String::append(__local_15, s2); + String::push_str(__local_15, String { repr: array.new_data("quad_wrap(world) = "), used: 19 }); + String::push_str(__local_15, s2); break __tmpl: __local_15; }); } @@ -362,7 +362,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -377,7 +377,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -415,7 +415,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -449,20 +449,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -472,10 +472,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -485,10 +485,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -496,10 +496,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/cross_module_generic_helper.wir.wado b/wado-compiler/tests/fixtures.golden/cross_module_generic_helper.wir.wado index 6198d44ee..99ed563aa 100644 --- a/wado-compiler/tests/fixtures.golden/cross_module_generic_helper.wir.wado +++ b/wado-compiler/tests/fixtures.golden/cross_module_generic_helper.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -98,7 +98,7 @@ fn run() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_1, String { repr: array.new_data("identity(100) = "), used: 16 }); + String::push_str(__local_1, String { repr: array.new_data("identity(100) = "), used: 16 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(100, __local_2); break __tmpl: __local_1; @@ -300,7 +300,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -315,7 +315,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -353,7 +353,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -387,20 +387,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -410,10 +410,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -434,10 +434,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/cross_module_generic_import.wir.wado b/wado-compiler/tests/fixtures.golden/cross_module_generic_import.wir.wado index 34721b618..b89591345 100644 --- a/wado-compiler/tests/fixtures.golden/cross_module_generic_import.wir.wado +++ b/wado-compiler/tests/fixtures.golden/cross_module_generic_import.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -110,7 +110,7 @@ fn run() with Stdout { let __local_19: ref String; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_3, String { repr: array.new_data("identity(42) = "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("identity(42) = "), used: 20 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(42, __local_4); break __tmpl: __local_3; @@ -121,8 +121,8 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(42), used: 0 }; - String::append(__local_5, String { repr: array.new_data("identity(hello) = "), used: 26 }); - String::append(__local_5, s); + String::push_str(__local_5, String { repr: array.new_data("identity(hello) = "), used: 26 }); + String::push_str(__local_5, s); break __tmpl: __local_5; }); pair = __inline___cross_module_generic_helper_wado_make_pair_i32_String__9: block -> ref "tuple/[i32, String]" { @@ -131,13 +131,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(48), used: 0 }; - String::append(__local_6, String { repr: array.new_data("make_pair = ("), used: 13 }); + String::push_str(__local_6, String { repr: array.new_data("make_pair = ("), used: 13 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(pair.0, __local_7); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); - String::append(__local_6, pair.1); - String::append_char(__local_6, 41); + String::push(__local_6, 44); + String::push(__local_6, 32); + String::push_str(__local_6, pair.1); + String::push(__local_6, 41); break __tmpl: __local_6; }); } @@ -337,7 +337,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -352,7 +352,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -390,7 +390,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -424,20 +424,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -460,10 +460,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -471,10 +471,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/cross_module_treemap_variant.wir.wado b/wado-compiler/tests/fixtures.golden/cross_module_treemap_variant.wir.wado index 447ba8366..e0a752b34 100644 --- a/wado-compiler/tests/fixtures.golden/cross_module_treemap_variant.wir.wado +++ b/wado-compiler/tests/fixtures.golden/cross_module_treemap_variant.wir.wado @@ -123,13 +123,13 @@ type "functype/./sub/cross_module_treemap_variant_helper.wado/ArrayIter::entries" = fn(ref "./sub/cross_module_treemap_variant_helper.wado/TreeMap") -> ref Array>; -type "functype/./sub/cross_module_treemap_variant_helper.wado/Array>::append" = fn(ref Array>, ref "tuple/[String, Value]"); +type "functype/./sub/cross_module_treemap_variant_helper.wado/Array>::push" = fn(ref Array>, ref "tuple/[String, Value]"); type "functype/./sub/cross_module_treemap_variant_helper.wado/Array>::grow" = fn(ref Array>); type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -145,7 +145,7 @@ type "functype/TreeMap::split" = fn(ref "./sub/cross_module_treema type "functype/TreeMap::skew" = fn(ref "./sub/cross_module_treemap_variant_helper.wado/TreeMap", ref null "./sub/cross_module_treemap_variant_helper.wado/TreeMapNode") -> ref null "./sub/cross_module_treemap_variant_helper.wado/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "./sub/cross_module_treemap_variant_helper.wado/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "./sub/cross_module_treemap_variant_helper.wado/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -216,9 +216,9 @@ fn "./sub/cross_module_treemap_variant_helper.wado/stringify"(v) { // from ./su __local_1 = __cast_2.payload_0; __tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(18), used: 0 }; - String::append(__local_8, String { repr: array.new_data("\""), used: 1 }); - String::append(__local_8, __local_1); - String::append(__local_8, String { repr: array.new_data("\""), used: 1 }); + String::push_str(__local_8, String { repr: array.new_data("\""), used: 1 }); + String::push_str(__local_8, __local_1); + String::push_str(__local_8, String { repr: array.new_data("\""), used: 1 }); break __tmpl: __local_8; }; } else if ref.test "./sub/cross_module_treemap_variant_helper.wado/Value::Obj"(__match_scrut_0) -> ref String { @@ -237,8 +237,8 @@ fn "./sub/cross_module_treemap_variant_helper.wado/stringify"(v) { // from ./su if __local_5 > 0 { __local_3 = __tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(17), used: 0 }; - String::append(__local_9, __local_3); - String::append(__local_9, String { repr: array.new_data(","), used: 1 }); + String::push_str(__local_9, __local_3); + String::push_str(__local_9, String { repr: array.new_data(","), used: 1 }); break __tmpl: __local_9; }; }; @@ -253,11 +253,11 @@ fn "./sub/cross_module_treemap_variant_helper.wado/stringify"(v) { // from ./su __local_6 = __local_12.0; __local_3 = __tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(51), used: 0 }; - String::append(__local_10, __local_3); - String::append(__local_10, String { repr: array.new_data("\""), used: 1 }); - String::append(__local_10, __local_6); - String::append(__local_10, String { repr: array.new_data("\":"), used: 2 }); - String::append(__local_10, "./sub/cross_module_treemap_variant_helper.wado/stringify"(__local_12.1)); + String::push_str(__local_10, __local_3); + String::push_str(__local_10, String { repr: array.new_data("\""), used: 1 }); + String::push_str(__local_10, __local_6); + String::push_str(__local_10, String { repr: array.new_data("\":"), used: 2 }); + String::push_str(__local_10, "./sub/cross_module_treemap_variant_helper.wado/stringify"(__local_12.1)); break __tmpl: __local_10; }; __local_5 = __local_5 + 1; @@ -267,8 +267,8 @@ fn "./sub/cross_module_treemap_variant_helper.wado/stringify"(v) { // from ./su }; __tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(17), used: 0 }; - String::append(__local_11, __local_3); - String::append(__local_11, String { repr: array.new_data("}"), used: 1 }); + String::push_str(__local_11, __local_3); + String::push_str(__local_11, String { repr: array.new_data("}"), used: 1 }); break __tmpl: __local_11; }; } else { @@ -429,7 +429,7 @@ fn "./sub/cross_module_treemap_variant_helper.wado/TreeMap::entrie if ref.is_null(__pattern_temp_0) == 0 { entry = value_copy "./sub/cross_module_treemap_variant_helper.wado/TreeMapEntry"(ref.as_non_null(__pattern_temp_0)); if entry.deleted == 0 { - "./sub/cross_module_treemap_variant_helper.wado/Array>::append"(result, "tuple/[String, Value]" { 0: entry.key, 1: entry.value }); + "./sub/cross_module_treemap_variant_helper.wado/Array>::push"(result, "tuple/[String, Value]" { 0: entry.key, 1: entry.value }); }; } else { break b14; @@ -440,7 +440,7 @@ fn "./sub/cross_module_treemap_variant_helper.wado/TreeMap::entrie return result; } -fn "./sub/cross_module_treemap_variant_helper.wado/Array>::append"(self, value) { // from ./sub/cross_module_treemap_variant_helper.wado +fn "./sub/cross_module_treemap_variant_helper.wado/Array>::push"(self, value) { // from ./sub/cross_module_treemap_variant_helper.wado let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -504,7 +504,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -614,7 +614,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_Value____len_1: __local_8.used; }; entry = "./sub/cross_module_treemap_variant_helper.wado/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -688,7 +688,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/cross_module_type_identity.wir.wado b/wado-compiler/tests/fixtures.golden/cross_module_type_identity.wir.wado index 613ea5b09..a71ae5fc0 100644 --- a/wado-compiler/tests/fixtures.golden/cross_module_type_identity.wir.wado +++ b/wado-compiler/tests/fixtures.golden/cross_module_type_identity.wir.wado @@ -108,11 +108,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref Shape); +type "functype/Array::push" = fn(ref Array, ref Shape); type "functype/Array::grow" = fn(ref Array); @@ -159,34 +159,34 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/cross_module_type_identity.wado"), used: 60 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_5, 114); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/cross_module_type_identity.wado"), used: 60 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_18 = __local_6; i32::fmt_decimal(25, __local_18); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: result == 15 "), used: 25 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 101); - String::append_char(__local_5, 115); - String::append_char(__local_5, 117); - String::append_char(__local_5, 108); - String::append_char(__local_5, 116); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 114); + String::push(__local_5, 101); + String::push(__local_5, 115); + String::push(__local_5, 117); + String::push(__local_5, 108); + String::push(__local_5, 116); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_23 = __local_6; i32::fmt_decimal(result, __local_23); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -441,7 +441,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -456,7 +456,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -483,7 +483,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -536,7 +536,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -570,20 +570,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -593,10 +593,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -606,10 +606,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -617,10 +617,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/cross_module_variant_iter.wir.wado b/wado-compiler/tests/fixtures.golden/cross_module_variant_iter.wir.wado index a05299f3d..d4348e806 100644 --- a/wado-compiler/tests/fixtures.golden/cross_module_variant_iter.wir.wado +++ b/wado-compiler/tests/fixtures.golden/cross_module_variant_iter.wir.wado @@ -111,11 +111,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/./sub/cross_module_variant_iter_helper.wado/Array::append" = fn(ref Array, ref "./sub/cross_module_variant_iter_helper.wado/Choice"); +type "functype/./sub/cross_module_variant_iter_helper.wado/Array::push" = fn(ref Array, ref "./sub/cross_module_variant_iter_helper.wado/Choice"); type "functype/./sub/cross_module_variant_iter_helper.wado/Array::grow" = fn(ref Array); @@ -167,43 +167,43 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/cross_module_variant_iter.wado"), used: 59 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/cross_module_variant_iter.wado"), used: 59 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_14 = __local_7; i32::fmt_decimal(6, __local_14); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); - String::append(__local_6, __tmpl: block -> ref String { + String::push(__local_6, 58); + String::push(__local_6, 32); + String::push_str(__local_6, __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_4, String { repr: array.new_data("expected 30, got "), used: 17 }); + String::push_str(__local_4, String { repr: array.new_data("expected 30, got "), used: 17 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(result, __local_5); break __tmpl: __local_4; }); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: result == 30 "), used: 25 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 101); - String::append_char(__local_6, 115); - String::append_char(__local_6, 117); - String::append_char(__local_6, 108); - String::append_char(__local_6, 116); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 114); + String::push(__local_6, 101); + String::push(__local_6, 115); + String::push(__local_6, 117); + String::push(__local_6, 108); + String::push(__local_6, 116); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_25 = __local_7; i32::fmt_decimal(result, __local_25); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -465,7 +465,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -480,7 +480,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -507,7 +507,7 @@ fn String::append_char(self, c) { }; } -fn "./sub/cross_module_variant_iter_helper.wado/Array::append"(self, value) { // from ./sub/cross_module_variant_iter_helper.wado +fn "./sub/cross_module_variant_iter_helper.wado/Array::push"(self, value) { // from ./sub/cross_module_variant_iter_helper.wado let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -570,7 +570,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -604,20 +604,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -627,10 +627,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -640,10 +640,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -651,10 +651,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/default_trait.wir.wado b/wado-compiler/tests/fixtures.golden/default_trait.wir.wado index 99b1acc24..35daa573d 100644 --- a/wado-compiler/tests/fixtures.golden/default_trait.wir.wado +++ b/wado-compiler/tests/fixtures.golden/default_trait.wir.wado @@ -82,7 +82,7 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -90,13 +90,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -154,26 +154,26 @@ fn run() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_17, 114); - String::append_char(__local_17, 117); - String::append_char(__local_17, 110); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/default_trait.wado"), used: 47 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_17, 114); + String::push(__local_17, 117); + String::push(__local_17, 110); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/default_trait.wado"), used: 47 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_55 = __local_18; i32::fmt_decimal(5, __local_55); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: String::default() == \"\" "), used: 36 }); - String::append(__local_17, String { repr: array.new_data("String::default(): "), used: 19 }); + String::push_str(__local_17, String { repr: array.new_data("String::default(): "), used: 19 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; String^Inspect::inspect(__v0_6, __local_18); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -187,27 +187,27 @@ condition: String::default() == \"\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 114); - String::append_char(__local_19, 117); - String::append_char(__local_19, 110); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/default_trait.wado"), used: 47 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 114); + String::push(__local_19, 117); + String::push(__local_19, 110); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/default_trait.wado"), used: 47 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_67 = __local_20; i32::fmt_decimal(8, __local_67); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: a.len() == 0 "), used: 25 }); - String::append(__local_19, String { repr: array.new_data("a.len(): "), used: 9 }); + String::push_str(__local_19, String { repr: array.new_data("a.len(): "), used: 9 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_72 = __local_20; i32::fmt_decimal(__v0_9, __local_72); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -359,7 +359,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -455,7 +455,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -543,7 +543,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -581,7 +581,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l39; }; @@ -615,20 +615,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -638,10 +638,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -651,10 +651,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -662,10 +662,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -677,7 +677,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -694,22 +694,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b58; @@ -717,7 +717,7 @@ fn String^Inspect::inspect(self, f) { continue l59; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/default_type_params.wir.wado b/wado-compiler/tests/fixtures.golden/default_type_params.wir.wado index 875cedfd5..8af1802e2 100644 --- a/wado-compiler/tests/fixtures.golden/default_type_params.wir.wado +++ b/wado-compiler/tests/fixtures.golden/default_type_params.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -98,13 +98,13 @@ fn run() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_1, 118); - String::append_char(__local_1, 97); - String::append_char(__local_1, 108); - String::append_char(__local_1, 117); - String::append_char(__local_1, 101); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 118); + String::push(__local_1, 97); + String::push(__local_1, 108); + String::push(__local_1, 117); + String::push(__local_1, 101); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(42, __local_2); break __tmpl: __local_1; @@ -306,7 +306,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -321,7 +321,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -359,7 +359,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -393,20 +393,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -416,10 +416,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -440,10 +440,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/dict_mini.wir.wado b/wado-compiler/tests/fixtures.golden/dict_mini.wir.wado index c6b173ee0..eab4458b4 100644 --- a/wado-compiler/tests/fixtures.golden/dict_mini.wir.wado +++ b/wado-compiler/tests/fixtures.golden/dict_mini.wir.wado @@ -88,15 +88,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -168,13 +168,13 @@ fn run() with Stdout { name_val = value_copy String(ref.as_non_null(__pattern_temp_0)); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_4, 110); - String::append_char(__local_4, 97); - String::append_char(__local_4, 109); - String::append_char(__local_4, 101); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); - String::append(__local_4, name_val); + String::push(__local_4, 110); + String::push(__local_4, 97); + String::push(__local_4, 109); + String::push(__local_4, 101); + String::push(__local_4, 58); + String::push(__local_4, 32); + String::push_str(__local_4, name_val); break __tmpl: __local_4; }); }; @@ -183,13 +183,13 @@ fn run() with Stdout { type_val = value_copy String(ref.as_non_null(__pattern_temp_1)); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_5, 116); - String::append_char(__local_5, 121); - String::append_char(__local_5, 112); - String::append_char(__local_5, 101); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); - String::append(__local_5, type_val); + String::push(__local_5, 116); + String::push(__local_5, 121); + String::push(__local_5, 112); + String::push(__local_5, 101); + String::push(__local_5, 58); + String::push(__local_5, 32); + String::push_str(__local_5, type_val); break __tmpl: __local_5; }); }; @@ -199,14 +199,14 @@ fn run() with Stdout { updated_val = value_copy String(ref.as_non_null(__pattern_temp_2)); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_6, String { repr: array.new_data("updated name: "), used: 14 }); - String::append(__local_6, updated_val); + String::push_str(__local_6, String { repr: array.new_data("updated name: "), used: 14 }); + String::push_str(__local_6, updated_val); break __tmpl: __local_6; }); }; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_7, String { repr: array.new_data("has 'target': "), used: 14 }); + String::push_str(__local_7, String { repr: array.new_data("has 'target': "), used: 14 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_27 = "core:internal/Box" { value: MiniDict::has(dict.entries, String { repr: array.new_data("target"), used: 6 }) }; Formatter::pad(__local_8, if __local_27.value -> ref String { @@ -218,7 +218,7 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_9, String { repr: array.new_data("has 'version': "), used: 15 }); + String::push_str(__local_9, String { repr: array.new_data("has 'version': "), used: 15 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_33 = "core:internal/Box" { value: MiniDict::has(dict.entries, String { repr: array.new_data("version"), used: 7 }) }; Formatter::pad(__local_10, if __local_33.value -> ref String { @@ -230,12 +230,12 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 115); - String::append_char(__local_11, 105); - String::append_char(__local_11, 122); - String::append_char(__local_11, 101); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 115); + String::push(__local_11, 105); + String::push(__local_11, 122); + String::push(__local_11, 101); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_39 = "core:internal/Box" { value: __inline_Array_Tuple_String_String____len_0: block -> i32 { __local_44 = dict.entries; @@ -445,7 +445,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -489,7 +489,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -516,7 +516,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -654,7 +654,7 @@ fn MiniDict::set(self, key, value) { }; }; }; - Array>::append(self, "tuple/[String, String]" { 0: key, 1: value }); + Array>::push(self, "tuple/[String, String]" { 0: key, 1: value }); } fn Formatter::write_char_n(self, c, n) { @@ -668,7 +668,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l50; }; @@ -688,7 +688,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -696,17 +696,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -736,20 +736,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -759,10 +759,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -772,10 +772,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -783,10 +783,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/display_1.wir.wado b/wado-compiler/tests/fixtures.golden/display_1.wir.wado index c96ae3976..1e160922e 100644 --- a/wado-compiler/tests/fixtures.golden/display_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/display_1.wir.wado @@ -183,7 +183,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -215,13 +215,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/DisplayPoint^Display::fmt" = fn(ref DisplayPoint, ref Formatter); @@ -466,24 +466,24 @@ fn test_all_primitives() with Stdout { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_44, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_44, 32); - String::append_char(__local_44, 97); - String::append_char(__local_44, 116); - String::append_char(__local_44, 32); - String::append(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_44, 58); + String::push_str(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_44, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_44, 32); + String::push(__local_44, 97); + String::push(__local_44, 116); + String::push(__local_44, 32); + String::push_str(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_44, 58); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_92 = __local_45; i32::fmt_decimal(19, __local_92); - String::append(__local_44, String { repr: array.new_data(" + String::push_str(__local_44, String { repr: array.new_data(" condition: 127 as i8.to_string() == \"127\" "), used: 43 }); - String::append(__local_44, String { repr: array.new_data("127 as i8.to_string(): "), used: 23 }); + String::push_str(__local_44, String { repr: array.new_data("127 as i8.to_string(): "), used: 23 }); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; String^Inspect::inspect(__v0_0, __local_45); - String::append_char(__local_44, 10); + String::push(__local_44, 10); break __tmpl: __local_44; }); unreachable; @@ -499,24 +499,24 @@ condition: 127 as i8.to_string() == \"127\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_46 = String { repr: builtin::array_new(159), used: 0 }; - String::append(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_46, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_46, 32); - String::append_char(__local_46, 97); - String::append_char(__local_46, 116); - String::append_char(__local_46, 32); - String::append(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_46, 58); + String::push_str(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_46, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_46, 32); + String::push(__local_46, 97); + String::push(__local_46, 116); + String::push(__local_46, 32); + String::push_str(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_46, 58); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_106 = __local_47; i32::fmt_decimal(20, __local_106); - String::append(__local_46, String { repr: array.new_data(" + String::push_str(__local_46, String { repr: array.new_data(" condition: -128 as i8.to_string() == \"-128\" "), used: 45 }); - String::append(__local_46, String { repr: array.new_data("-128 as i8.to_string(): "), used: 24 }); + String::push_str(__local_46, String { repr: array.new_data("-128 as i8.to_string(): "), used: 24 }); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; String^Inspect::inspect(__v0_2, __local_47); - String::append_char(__local_46, 10); + String::push(__local_46, 10); break __tmpl: __local_46; }); unreachable; @@ -532,24 +532,24 @@ condition: -128 as i8.to_string() == \"-128\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_48 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_48, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_48, 32); - String::append_char(__local_48, 97); - String::append_char(__local_48, 116); - String::append_char(__local_48, 32); - String::append(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_48, 58); + String::push_str(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_48, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_48, 32); + String::push(__local_48, 97); + String::push(__local_48, 116); + String::push(__local_48, 32); + String::push_str(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_48, 58); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_120 = __local_49; i32::fmt_decimal(21, __local_120); - String::append(__local_48, String { repr: array.new_data(" + String::push_str(__local_48, String { repr: array.new_data(" condition: 255 as u8.to_string() == \"255\" "), used: 43 }); - String::append(__local_48, String { repr: array.new_data("255 as u8.to_string(): "), used: 23 }); + String::push_str(__local_48, String { repr: array.new_data("255 as u8.to_string(): "), used: 23 }); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; String^Inspect::inspect(__v0_4, __local_49); - String::append_char(__local_48, 10); + String::push(__local_48, 10); break __tmpl: __local_48; }); unreachable; @@ -565,24 +565,24 @@ condition: 255 as u8.to_string() == \"255\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_50 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_50, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_50, 32); - String::append_char(__local_50, 97); - String::append_char(__local_50, 116); - String::append_char(__local_50, 32); - String::append(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_50, 58); + String::push_str(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_50, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_50, 32); + String::push(__local_50, 97); + String::push(__local_50, 116); + String::push(__local_50, 32); + String::push_str(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_50, 58); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_134 = __local_51; i32::fmt_decimal(22, __local_134); - String::append(__local_50, String { repr: array.new_data(" + String::push_str(__local_50, String { repr: array.new_data(" condition: 0 as u8.to_string() == \"0\" "), used: 39 }); - String::append(__local_50, String { repr: array.new_data("0 as u8.to_string(): "), used: 21 }); + String::push_str(__local_50, String { repr: array.new_data("0 as u8.to_string(): "), used: 21 }); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; String^Inspect::inspect(__v0_6, __local_51); - String::append_char(__local_50, 10); + String::push(__local_50, 10); break __tmpl: __local_50; }); unreachable; @@ -598,24 +598,24 @@ condition: 0 as u8.to_string() == \"0\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_52 = String { repr: builtin::array_new(164), used: 0 }; - String::append(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_52, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_52, 32); - String::append_char(__local_52, 97); - String::append_char(__local_52, 116); - String::append_char(__local_52, 32); - String::append(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_52, 58); + String::push_str(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_52, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_52, 32); + String::push(__local_52, 97); + String::push(__local_52, 116); + String::push(__local_52, 32); + String::push_str(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_52, 58); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_148 = __local_53; i32::fmt_decimal(23, __local_148); - String::append(__local_52, String { repr: array.new_data(" + String::push_str(__local_52, String { repr: array.new_data(" condition: 32767 as i16.to_string() == \"32767\" "), used: 48 }); - String::append(__local_52, String { repr: array.new_data("32767 as i16.to_string(): "), used: 26 }); + String::push_str(__local_52, String { repr: array.new_data("32767 as i16.to_string(): "), used: 26 }); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; String^Inspect::inspect(__v0_8, __local_53); - String::append_char(__local_52, 10); + String::push(__local_52, 10); break __tmpl: __local_52; }); unreachable; @@ -631,24 +631,24 @@ condition: 32767 as i16.to_string() == \"32767\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_54 = String { repr: builtin::array_new(167), used: 0 }; - String::append(__local_54, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_54, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_54, 32); - String::append_char(__local_54, 97); - String::append_char(__local_54, 116); - String::append_char(__local_54, 32); - String::append(__local_54, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_54, 58); + String::push_str(__local_54, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_54, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_54, 32); + String::push(__local_54, 97); + String::push(__local_54, 116); + String::push(__local_54, 32); + String::push_str(__local_54, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_54, 58); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_162 = __local_55; i32::fmt_decimal(24, __local_162); - String::append(__local_54, String { repr: array.new_data(" + String::push_str(__local_54, String { repr: array.new_data(" condition: -32768 as i16.to_string() == \"-32768\" "), used: 50 }); - String::append(__local_54, String { repr: array.new_data("-32768 as i16.to_string(): "), used: 27 }); + String::push_str(__local_54, String { repr: array.new_data("-32768 as i16.to_string(): "), used: 27 }); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; String^Inspect::inspect(__v0_10, __local_55); - String::append_char(__local_54, 10); + String::push(__local_54, 10); break __tmpl: __local_54; }); unreachable; @@ -664,24 +664,24 @@ condition: -32768 as i16.to_string() == \"-32768\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_56 = String { repr: builtin::array_new(164), used: 0 }; - String::append(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_56, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_56, 32); - String::append_char(__local_56, 97); - String::append_char(__local_56, 116); - String::append_char(__local_56, 32); - String::append(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_56, 58); + String::push_str(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_56, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_56, 32); + String::push(__local_56, 97); + String::push(__local_56, 116); + String::push(__local_56, 32); + String::push_str(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_56, 58); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_176 = __local_57; i32::fmt_decimal(25, __local_176); - String::append(__local_56, String { repr: array.new_data(" + String::push_str(__local_56, String { repr: array.new_data(" condition: 65535 as u16.to_string() == \"65535\" "), used: 48 }); - String::append(__local_56, String { repr: array.new_data("65535 as u16.to_string(): "), used: 26 }); + String::push_str(__local_56, String { repr: array.new_data("65535 as u16.to_string(): "), used: 26 }); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; String^Inspect::inspect(__v0_12, __local_57); - String::append_char(__local_56, 10); + String::push(__local_56, 10); break __tmpl: __local_56; }); unreachable; @@ -696,24 +696,24 @@ condition: 65535 as u16.to_string() == \"65535\" if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_58 = String { repr: builtin::array_new(165), used: 0 }; - String::append(__local_58, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_58, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_58, 32); - String::append_char(__local_58, 97); - String::append_char(__local_58, 116); - String::append_char(__local_58, 32); - String::append(__local_58, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_58, 58); + String::push_str(__local_58, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_58, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_58, 32); + String::push(__local_58, 97); + String::push(__local_58, 116); + String::push(__local_58, 32); + String::push_str(__local_58, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_58, 58); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; __local_190 = __local_59; i32::fmt_decimal(26, __local_190); - String::append(__local_58, String { repr: array.new_data(" + String::push_str(__local_58, String { repr: array.new_data(" condition: 2147483647.to_string() == \"2147483647\" "), used: 51 }); - String::append(__local_58, String { repr: array.new_data("2147483647.to_string(): "), used: 24 }); + String::push_str(__local_58, String { repr: array.new_data("2147483647.to_string(): "), used: 24 }); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; String^Inspect::inspect(__v0_14, __local_59); - String::append_char(__local_58, 10); + String::push(__local_58, 10); break __tmpl: __local_58; }); unreachable; @@ -728,24 +728,24 @@ condition: 2147483647.to_string() == \"2147483647\" if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_60 = String { repr: builtin::array_new(168), used: 0 }; - String::append(__local_60, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_60, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_60, 32); - String::append_char(__local_60, 97); - String::append_char(__local_60, 116); - String::append_char(__local_60, 32); - String::append(__local_60, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_60, 58); + String::push_str(__local_60, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_60, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_60, 32); + String::push(__local_60, 97); + String::push(__local_60, 116); + String::push(__local_60, 32); + String::push_str(__local_60, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_60, 58); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; __local_204 = __local_61; i32::fmt_decimal(27, __local_204); - String::append(__local_60, String { repr: array.new_data(" + String::push_str(__local_60, String { repr: array.new_data(" condition: -2147483648.to_string() == \"-2147483648\" "), used: 53 }); - String::append(__local_60, String { repr: array.new_data("-2147483648.to_string(): "), used: 25 }); + String::push_str(__local_60, String { repr: array.new_data("-2147483648.to_string(): "), used: 25 }); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; String^Inspect::inspect(__v0_16, __local_61); - String::append_char(__local_60, 10); + String::push(__local_60, 10); break __tmpl: __local_60; }); unreachable; @@ -760,24 +760,24 @@ condition: -2147483648.to_string() == \"-2147483648\" if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_62 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_62, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_62, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_62, 32); - String::append_char(__local_62, 97); - String::append_char(__local_62, 116); - String::append_char(__local_62, 32); - String::append(__local_62, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_62, 58); + String::push_str(__local_62, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_62, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_62, 32); + String::push(__local_62, 97); + String::push(__local_62, 116); + String::push(__local_62, 32); + String::push_str(__local_62, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_62, 58); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; __local_218 = __local_63; i32::fmt_decimal(28, __local_218); - String::append(__local_62, String { repr: array.new_data(" + String::push_str(__local_62, String { repr: array.new_data(" condition: 0.to_string() == \"0\" "), used: 33 }); - String::append(__local_62, String { repr: array.new_data("0.to_string(): "), used: 15 }); + String::push_str(__local_62, String { repr: array.new_data("0.to_string(): "), used: 15 }); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; String^Inspect::inspect(__v0_18, __local_63); - String::append_char(__local_62, 10); + String::push(__local_62, 10); break __tmpl: __local_62; }); unreachable; @@ -792,24 +792,24 @@ condition: 0.to_string() == \"0\" if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_64 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_64, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_64, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_64, 32); - String::append_char(__local_64, 97); - String::append_char(__local_64, 116); - String::append_char(__local_64, 32); - String::append(__local_64, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_64, 58); + String::push_str(__local_64, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_64, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_64, 32); + String::push(__local_64, 97); + String::push(__local_64, 116); + String::push(__local_64, 32); + String::push_str(__local_64, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_64, 58); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; __local_232 = __local_65; i32::fmt_decimal(30, __local_232); - String::append(__local_64, String { repr: array.new_data(" + String::push_str(__local_64, String { repr: array.new_data(" condition: j.to_string() == \"4294967295\" "), used: 42 }); - String::append(__local_64, String { repr: array.new_data("j.to_string(): "), used: 15 }); + String::push_str(__local_64, String { repr: array.new_data("j.to_string(): "), used: 15 }); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; String^Inspect::inspect(__v0_21, __local_65); - String::append_char(__local_64, 10); + String::push(__local_64, 10); break __tmpl: __local_64; }); unreachable; @@ -824,24 +824,24 @@ condition: j.to_string() == \"4294967295\" if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_66 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_66, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_66, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_66, 32); - String::append_char(__local_66, 97); - String::append_char(__local_66, 116); - String::append_char(__local_66, 32); - String::append(__local_66, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_66, 58); + String::push_str(__local_66, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_66, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_66, 32); + String::push(__local_66, 97); + String::push(__local_66, 116); + String::push(__local_66, 32); + String::push_str(__local_66, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_66, 58); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; __local_246 = __local_67; i32::fmt_decimal(32, __local_246); - String::append(__local_66, String { repr: array.new_data(" + String::push_str(__local_66, String { repr: array.new_data(" condition: k.to_string() == \"9223372036854775807\" "), used: 51 }); - String::append(__local_66, String { repr: array.new_data("k.to_string(): "), used: 15 }); + String::push_str(__local_66, String { repr: array.new_data("k.to_string(): "), used: 15 }); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; String^Inspect::inspect(__v0_24, __local_67); - String::append_char(__local_66, 10); + String::push(__local_66, 10); break __tmpl: __local_66; }); unreachable; @@ -856,24 +856,24 @@ condition: k.to_string() == \"9223372036854775807\" if __cond_28 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_68 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_68, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_68, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_68, 32); - String::append_char(__local_68, 97); - String::append_char(__local_68, 116); - String::append_char(__local_68, 32); - String::append(__local_68, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_68, 58); + String::push_str(__local_68, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_68, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_68, 32); + String::push(__local_68, 97); + String::push(__local_68, 116); + String::push(__local_68, 32); + String::push_str(__local_68, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_68, 58); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; __local_260 = __local_69; i32::fmt_decimal(34, __local_260); - String::append(__local_68, String { repr: array.new_data(" + String::push_str(__local_68, String { repr: array.new_data(" condition: l.to_string() == \"-9223372036854775808\" "), used: 52 }); - String::append(__local_68, String { repr: array.new_data("l.to_string(): "), used: 15 }); + String::push_str(__local_68, String { repr: array.new_data("l.to_string(): "), used: 15 }); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; String^Inspect::inspect(__v0_27, __local_69); - String::append_char(__local_68, 10); + String::push(__local_68, 10); break __tmpl: __local_68; }); unreachable; @@ -888,24 +888,24 @@ condition: l.to_string() == \"-9223372036854775808\" if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_70 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_70, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_70, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_70, 32); - String::append_char(__local_70, 97); - String::append_char(__local_70, 116); - String::append_char(__local_70, 32); - String::append(__local_70, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_70, 58); + String::push_str(__local_70, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_70, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_70, 32); + String::push(__local_70, 97); + String::push(__local_70, 116); + String::push(__local_70, 32); + String::push_str(__local_70, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_70, 58); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; __local_274 = __local_71; i32::fmt_decimal(36, __local_274); - String::append(__local_70, String { repr: array.new_data(" + String::push_str(__local_70, String { repr: array.new_data(" condition: m.to_string() == \"18446744073709551615\" "), used: 52 }); - String::append(__local_70, String { repr: array.new_data("m.to_string(): "), used: 15 }); + String::push_str(__local_70, String { repr: array.new_data("m.to_string(): "), used: 15 }); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; String^Inspect::inspect(__v0_30, __local_71); - String::append_char(__local_70, 10); + String::push(__local_70, 10); break __tmpl: __local_70; }); unreachable; @@ -920,24 +920,24 @@ condition: m.to_string() == \"18446744073709551615\" if __cond_34 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_72 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_72, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_72, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_72, 32); - String::append_char(__local_72, 97); - String::append_char(__local_72, 116); - String::append_char(__local_72, 32); - String::append(__local_72, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_72, 58); + String::push_str(__local_72, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_72, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_72, 32); + String::push(__local_72, 97); + String::push(__local_72, 116); + String::push(__local_72, 32); + String::push_str(__local_72, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_72, 58); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; __local_286 = __local_73; i32::fmt_decimal(38, __local_286); - String::append(__local_72, String { repr: array.new_data(" + String::push_str(__local_72, String { repr: array.new_data(" condition: n.to_string() == \"3.14\" "), used: 36 }); - String::append(__local_72, String { repr: array.new_data("n.to_string(): "), used: 15 }); + String::push_str(__local_72, String { repr: array.new_data("n.to_string(): "), used: 15 }); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; String^Inspect::inspect(__v0_33, __local_73); - String::append_char(__local_72, 10); + String::push(__local_72, 10); break __tmpl: __local_72; }); unreachable; @@ -952,24 +952,24 @@ condition: n.to_string() == \"3.14\" if __cond_37 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_74 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_74, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_74, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_74, 32); - String::append_char(__local_74, 97); - String::append_char(__local_74, 116); - String::append_char(__local_74, 32); - String::append(__local_74, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_74, 58); + String::push_str(__local_74, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_74, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_74, 32); + String::push(__local_74, 97); + String::push(__local_74, 116); + String::push(__local_74, 32); + String::push_str(__local_74, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_74, 58); __local_75 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_74 }; __local_298 = __local_75; i32::fmt_decimal(40, __local_298); - String::append(__local_74, String { repr: array.new_data(" + String::push_str(__local_74, String { repr: array.new_data(" condition: o.to_string() == \"3.141592653589793\" "), used: 49 }); - String::append(__local_74, String { repr: array.new_data("o.to_string(): "), used: 15 }); + String::push_str(__local_74, String { repr: array.new_data("o.to_string(): "), used: 15 }); __local_75 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_74 }; String^Inspect::inspect(__v0_36, __local_75); - String::append_char(__local_74, 10); + String::push(__local_74, 10); break __tmpl: __local_74; }); unreachable; @@ -985,24 +985,24 @@ condition: o.to_string() == \"3.141592653589793\" if __cond_39 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_76 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_76, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_76, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_76, 32); - String::append_char(__local_76, 97); - String::append_char(__local_76, 116); - String::append_char(__local_76, 32); - String::append(__local_76, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_76, 58); + String::push_str(__local_76, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_76, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_76, 32); + String::push(__local_76, 97); + String::push(__local_76, 116); + String::push(__local_76, 32); + String::push_str(__local_76, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_76, 58); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_76 }; __local_312 = __local_77; i32::fmt_decimal(41, __local_312); - String::append(__local_76, String { repr: array.new_data(" + String::push_str(__local_76, String { repr: array.new_data(" condition: true.to_string() == \"true\" "), used: 39 }); - String::append(__local_76, String { repr: array.new_data("true.to_string(): "), used: 18 }); + String::push_str(__local_76, String { repr: array.new_data("true.to_string(): "), used: 18 }); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_76 }; String^Inspect::inspect(__v0_38, __local_77); - String::append_char(__local_76, 10); + String::push(__local_76, 10); break __tmpl: __local_76; }); unreachable; @@ -1018,24 +1018,24 @@ condition: true.to_string() == \"true\" if __cond_41 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_78 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_78, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_78, 32); - String::append_char(__local_78, 97); - String::append_char(__local_78, 116); - String::append_char(__local_78, 32); - String::append(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_78, 58); + String::push_str(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_78, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_78, 32); + String::push(__local_78, 97); + String::push(__local_78, 116); + String::push(__local_78, 32); + String::push_str(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_78, 58); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; __local_326 = __local_79; i32::fmt_decimal(42, __local_326); - String::append(__local_78, String { repr: array.new_data(" + String::push_str(__local_78, String { repr: array.new_data(" condition: false.to_string() == \"false\" "), used: 41 }); - String::append(__local_78, String { repr: array.new_data("false.to_string(): "), used: 19 }); + String::push_str(__local_78, String { repr: array.new_data("false.to_string(): "), used: 19 }); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; String^Inspect::inspect(__v0_40, __local_79); - String::append_char(__local_78, 10); + String::push(__local_78, 10); break __tmpl: __local_78; }); unreachable; @@ -1043,31 +1043,31 @@ condition: false.to_string() == \"false\" __v0_42 = __inline_char__to_string_160: block -> ref String { __local_340 = 90; __local_331 = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(__local_331, 90); + String::push(__local_331, 90); break __inline_char__to_string_160: __local_331; }; __cond_43 = String^Eq::eq(__v0_42, String { repr: array.new_data("Z"), used: 1 }); if __cond_43 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_80 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_80, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_80, String { repr: array.new_data("test_all_primitives"), used: 19 }); - String::append_char(__local_80, 32); - String::append_char(__local_80, 97); - String::append_char(__local_80, 116); - String::append_char(__local_80, 32); - String::append(__local_80, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_80, 58); + String::push_str(__local_80, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_80, String { repr: array.new_data("test_all_primitives"), used: 19 }); + String::push(__local_80, 32); + String::push(__local_80, 97); + String::push(__local_80, 116); + String::push(__local_80, 32); + String::push_str(__local_80, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_80, 58); __local_81 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_80 }; __local_336 = __local_81; i32::fmt_decimal(43, __local_336); - String::append(__local_80, String { repr: array.new_data(" + String::push_str(__local_80, String { repr: array.new_data(" condition: 'Z'.to_string() == \"Z\" "), used: 35 }); - String::append(__local_80, String { repr: array.new_data("'Z'.to_string(): "), used: 17 }); + String::push_str(__local_80, String { repr: array.new_data("'Z'.to_string(): "), used: 17 }); __local_81 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_80 }; String^Inspect::inspect(__v0_42, __local_81); - String::append_char(__local_80, 10); + String::push(__local_80, 10); break __tmpl: __local_80; }); unreachable; @@ -1182,9 +1182,9 @@ fn test_string() with Stdout { Formatter::pad(f_12, empty); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_4, 91); - String::append(__local_4, buf); - String::append_char(__local_4, 93); + String::push(__local_4, 91); + String::push_str(__local_4, buf); + String::push(__local_4, 93); break __tmpl: __local_4; }); } @@ -1200,41 +1200,41 @@ fn test_formatter_methods() with Stdout { let __local_9: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 119); - String::append_char(__local_2, 105); - String::append_char(__local_2, 100); - String::append_char(__local_2, 116); - String::append_char(__local_2, 104); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 119); + String::push(__local_2, 105); + String::push(__local_2, 100); + String::push(__local_2, 116); + String::push(__local_2, 104); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(-1, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_4, String { repr: array.new_data("precision: "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("precision: "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(-1, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_6, 105); - String::append_char(__local_6, 110); - String::append_char(__local_6, 100); - String::append_char(__local_6, 101); - String::append_char(__local_6, 110); - String::append_char(__local_6, 116); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 105); + String::push(__local_6, 110); + String::push(__local_6, 100); + String::push(__local_6, 101); + String::push(__local_6, 110); + String::push(__local_6, 116); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(0, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_8, String { repr: array.new_data("sign_plus: "), used: 11 }); + String::push_str(__local_8, String { repr: array.new_data("sign_plus: "), used: 11 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; Formatter::pad(__local_9, block -> ref String { String { repr: array.new_data("false"), used: 5 }; @@ -1720,17 +1720,17 @@ fn test_template_specifiers_i128() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_103 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_103, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_103, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_103, 32); - String::append_char(__local_103, 97); - String::append_char(__local_103, 116); - String::append_char(__local_103, 32); - String::append(__local_103, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_103, 58); + String::push_str(__local_103, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_103, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_103, 32); + String::push(__local_103, 97); + String::push(__local_103, 116); + String::push(__local_103, 32); + String::push_str(__local_103, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_103, 58); __local_104 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_103 }; i32::fmt_decimal(111, __local_104); - String::append(__local_103, String { repr: array.new_data(" + String::push_str(__local_103, String { repr: array.new_data(" condition: `{i:10}` == \" 42\" "), used: 37 }); break __tmpl: __local_103; @@ -1746,17 +1746,17 @@ condition: `{i:10}` == \" 42\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_107 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_107, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_107, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_107, 32); - String::append_char(__local_107, 97); - String::append_char(__local_107, 116); - String::append_char(__local_107, 32); - String::append(__local_107, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_107, 58); + String::push_str(__local_107, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_107, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_107, 32); + String::push(__local_107, 97); + String::push(__local_107, 116); + String::push(__local_107, 32); + String::push_str(__local_107, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_107, 58); __local_108 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_107 }; i32::fmt_decimal(112, __local_108); - String::append(__local_107, String { repr: array.new_data(" + String::push_str(__local_107, String { repr: array.new_data(" condition: `{i:<10}` == \"42 \" "), used: 38 }); break __tmpl: __local_107; @@ -1772,17 +1772,17 @@ condition: `{i:<10}` == \"42 \" if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_111 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_111, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_111, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_111, 32); - String::append_char(__local_111, 97); - String::append_char(__local_111, 116); - String::append_char(__local_111, 32); - String::append(__local_111, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_111, 58); + String::push_str(__local_111, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_111, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_111, 32); + String::push(__local_111, 97); + String::push(__local_111, 116); + String::push(__local_111, 32); + String::push_str(__local_111, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_111, 58); __local_112 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_111 }; i32::fmt_decimal(113, __local_112); - String::append(__local_111, String { repr: array.new_data(" + String::push_str(__local_111, String { repr: array.new_data(" condition: `{i:^10}` == \" 42 \" "), used: 38 }); break __tmpl: __local_111; @@ -1798,17 +1798,17 @@ condition: `{i:^10}` == \" 42 \" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_115 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_115, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_115, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_115, 32); - String::append_char(__local_115, 97); - String::append_char(__local_115, 116); - String::append_char(__local_115, 32); - String::append(__local_115, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_115, 58); + String::push_str(__local_115, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_115, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_115, 32); + String::push(__local_115, 97); + String::push(__local_115, 116); + String::push(__local_115, 32); + String::push_str(__local_115, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_115, 58); __local_116 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_115 }; i32::fmt_decimal(114, __local_116); - String::append(__local_115, String { repr: array.new_data(" + String::push_str(__local_115, String { repr: array.new_data(" condition: `{i:*^10}` == \"****42****\" "), used: 39 }); break __tmpl: __local_115; @@ -1824,17 +1824,17 @@ condition: `{i:*^10}` == \"****42****\" if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_119 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_119, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_119, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_119, 32); - String::append_char(__local_119, 97); - String::append_char(__local_119, 116); - String::append_char(__local_119, 32); - String::append(__local_119, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_119, 58); + String::push_str(__local_119, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_119, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_119, 32); + String::push(__local_119, 97); + String::push(__local_119, 116); + String::push(__local_119, 32); + String::push_str(__local_119, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_119, 58); __local_120 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_119 }; i32::fmt_decimal(115, __local_120); - String::append(__local_119, String { repr: array.new_data(" + String::push_str(__local_119, String { repr: array.new_data(" condition: `{i:0>8}` == \"00000042\" "), used: 36 }); break __tmpl: __local_119; @@ -1850,17 +1850,17 @@ condition: `{i:0>8}` == \"00000042\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_123 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_123, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_123, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_123, 32); - String::append_char(__local_123, 97); - String::append_char(__local_123, 116); - String::append_char(__local_123, 32); - String::append(__local_123, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_123, 58); + String::push_str(__local_123, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_123, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_123, 32); + String::push(__local_123, 97); + String::push(__local_123, 116); + String::push(__local_123, 32); + String::push_str(__local_123, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_123, 58); __local_124 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_123 }; i32::fmt_decimal(116, __local_124); - String::append(__local_123, String { repr: array.new_data(" + String::push_str(__local_123, String { repr: array.new_data(" condition: `{i:-<8}` == \"42------\" "), used: 36 }); break __tmpl: __local_123; @@ -1876,17 +1876,17 @@ condition: `{i:-<8}` == \"42------\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_127 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_127, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_127, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_127, 32); - String::append_char(__local_127, 97); - String::append_char(__local_127, 116); - String::append_char(__local_127, 32); - String::append(__local_127, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_127, 58); + String::push_str(__local_127, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_127, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_127, 32); + String::push(__local_127, 97); + String::push(__local_127, 116); + String::push(__local_127, 32); + String::push_str(__local_127, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_127, 58); __local_128 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_127 }; i32::fmt_decimal(117, __local_128); - String::append(__local_127, String { repr: array.new_data(" + String::push_str(__local_127, String { repr: array.new_data(" condition: `{i:+}` == \"+42\" "), used: 29 }); break __tmpl: __local_127; @@ -1902,17 +1902,17 @@ condition: `{i:+}` == \"+42\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_131 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_131, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_131, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_131, 32); - String::append_char(__local_131, 97); - String::append_char(__local_131, 116); - String::append_char(__local_131, 32); - String::append(__local_131, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_131, 58); + String::push_str(__local_131, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_131, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_131, 32); + String::push(__local_131, 97); + String::push(__local_131, 116); + String::push(__local_131, 32); + String::push_str(__local_131, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_131, 58); __local_132 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_131 }; i32::fmt_decimal(118, __local_132); - String::append(__local_131, String { repr: array.new_data(" + String::push_str(__local_131, String { repr: array.new_data(" condition: `{neg:+}` == \"-42\" "), used: 31 }); break __tmpl: __local_131; @@ -1928,17 +1928,17 @@ condition: `{neg:+}` == \"-42\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_135 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_135, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_135, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_135, 32); - String::append_char(__local_135, 97); - String::append_char(__local_135, 116); - String::append_char(__local_135, 32); - String::append(__local_135, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_135, 58); + String::push_str(__local_135, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_135, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_135, 32); + String::push(__local_135, 97); + String::push(__local_135, 116); + String::push(__local_135, 32); + String::push_str(__local_135, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_135, 58); __local_136 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_135 }; i32::fmt_decimal(119, __local_136); - String::append(__local_135, String { repr: array.new_data(" + String::push_str(__local_135, String { repr: array.new_data(" condition: `{neg}` == \"-42\" "), used: 29 }); break __tmpl: __local_135; @@ -1954,17 +1954,17 @@ condition: `{neg}` == \"-42\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_139 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_139, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_139, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_139, 32); - String::append_char(__local_139, 97); - String::append_char(__local_139, 116); - String::append_char(__local_139, 32); - String::append(__local_139, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_139, 58); + String::push_str(__local_139, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_139, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_139, 32); + String::push(__local_139, 97); + String::push(__local_139, 116); + String::push(__local_139, 32); + String::push_str(__local_139, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_139, 58); __local_140 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_139 }; i32::fmt_decimal(120, __local_140); - String::append(__local_139, String { repr: array.new_data(" + String::push_str(__local_139, String { repr: array.new_data(" condition: `{i:08}` == \"00000042\" "), used: 35 }); break __tmpl: __local_139; @@ -1980,17 +1980,17 @@ condition: `{i:08}` == \"00000042\" if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_143 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_143, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_143, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_143, 32); - String::append_char(__local_143, 97); - String::append_char(__local_143, 116); - String::append_char(__local_143, 32); - String::append(__local_143, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_143, 58); + String::push_str(__local_143, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_143, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_143, 32); + String::push(__local_143, 97); + String::push(__local_143, 116); + String::push(__local_143, 32); + String::push_str(__local_143, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_143, 58); __local_144 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_143 }; i32::fmt_decimal(121, __local_144); - String::append(__local_143, String { repr: array.new_data(" + String::push_str(__local_143, String { repr: array.new_data(" condition: `{neg:08}` == \"-0000042\" "), used: 37 }); break __tmpl: __local_143; @@ -2006,17 +2006,17 @@ condition: `{neg:08}` == \"-0000042\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_147 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_147, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_147, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_147, 32); - String::append_char(__local_147, 97); - String::append_char(__local_147, 116); - String::append_char(__local_147, 32); - String::append(__local_147, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_147, 58); + String::push_str(__local_147, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_147, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_147, 32); + String::push(__local_147, 97); + String::push(__local_147, 116); + String::push(__local_147, 32); + String::push_str(__local_147, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_147, 58); __local_148 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_147 }; i32::fmt_decimal(122, __local_148); - String::append(__local_147, String { repr: array.new_data(" + String::push_str(__local_147, String { repr: array.new_data(" condition: `{i:+08}` == \"+0000042\" "), used: 36 }); break __tmpl: __local_147; @@ -2032,17 +2032,17 @@ condition: `{i:+08}` == \"+0000042\" if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_151 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_151, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_151, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_151, 32); - String::append_char(__local_151, 97); - String::append_char(__local_151, 116); - String::append_char(__local_151, 32); - String::append(__local_151, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_151, 58); + String::push_str(__local_151, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_151, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_151, 32); + String::push(__local_151, 97); + String::push(__local_151, 116); + String::push(__local_151, 32); + String::push_str(__local_151, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_151, 58); __local_152 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_151 }; i32::fmt_decimal(123, __local_152); - String::append(__local_151, String { repr: array.new_data(" + String::push_str(__local_151, String { repr: array.new_data(" condition: `{i:+010}` == \"+000000042\" "), used: 39 }); break __tmpl: __local_151; @@ -2058,17 +2058,17 @@ condition: `{i:+010}` == \"+000000042\" if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_155 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_155, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_155, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_155, 32); - String::append_char(__local_155, 97); - String::append_char(__local_155, 116); - String::append_char(__local_155, 32); - String::append(__local_155, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_155, 58); + String::push_str(__local_155, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_155, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_155, 32); + String::push(__local_155, 97); + String::push(__local_155, 116); + String::push(__local_155, 32); + String::push_str(__local_155, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_155, 58); __local_156 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_155 }; i32::fmt_decimal(124, __local_156); - String::append(__local_155, String { repr: array.new_data(" + String::push_str(__local_155, String { repr: array.new_data(" condition: `{i:2}` == \"42\" "), used: 28 }); break __tmpl: __local_155; @@ -2084,17 +2084,17 @@ condition: `{i:2}` == \"42\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_159 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_159, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_159, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_159, 32); - String::append_char(__local_159, 97); - String::append_char(__local_159, 116); - String::append_char(__local_159, 32); - String::append(__local_159, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_159, 58); + String::push_str(__local_159, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_159, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_159, 32); + String::push(__local_159, 97); + String::push(__local_159, 116); + String::push(__local_159, 32); + String::push_str(__local_159, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_159, 58); __local_160 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_159 }; i32::fmt_decimal(125, __local_160); - String::append(__local_159, String { repr: array.new_data(" + String::push_str(__local_159, String { repr: array.new_data(" condition: `{i:b}` == \"101010\" "), used: 32 }); break __tmpl: __local_159; @@ -2110,17 +2110,17 @@ condition: `{i:b}` == \"101010\" if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_163 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_163, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_163, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_163, 32); - String::append_char(__local_163, 97); - String::append_char(__local_163, 116); - String::append_char(__local_163, 32); - String::append(__local_163, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_163, 58); + String::push_str(__local_163, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_163, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_163, 32); + String::push(__local_163, 97); + String::push(__local_163, 116); + String::push(__local_163, 32); + String::push_str(__local_163, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_163, 58); __local_164 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_163 }; i32::fmt_decimal(126, __local_164); - String::append(__local_163, String { repr: array.new_data(" + String::push_str(__local_163, String { repr: array.new_data(" condition: `{i:08b}` == \"00101010\" "), used: 36 }); break __tmpl: __local_163; @@ -2136,17 +2136,17 @@ condition: `{i:08b}` == \"00101010\" if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_167 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_167, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_167, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_167, 32); - String::append_char(__local_167, 97); - String::append_char(__local_167, 116); - String::append_char(__local_167, 32); - String::append(__local_167, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_167, 58); + String::push_str(__local_167, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_167, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_167, 32); + String::push(__local_167, 97); + String::push(__local_167, 116); + String::push(__local_167, 32); + String::push_str(__local_167, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_167, 58); __local_168 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_167 }; i32::fmt_decimal(127, __local_168); - String::append(__local_167, String { repr: array.new_data(" + String::push_str(__local_167, String { repr: array.new_data(" condition: `{i:#b}` == \"0b101010\" "), used: 35 }); break __tmpl: __local_167; @@ -2162,17 +2162,17 @@ condition: `{i:#b}` == \"0b101010\" if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_171 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_171, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_171, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_171, 32); - String::append_char(__local_171, 97); - String::append_char(__local_171, 116); - String::append_char(__local_171, 32); - String::append(__local_171, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_171, 58); + String::push_str(__local_171, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_171, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_171, 32); + String::push(__local_171, 97); + String::push(__local_171, 116); + String::push(__local_171, 32); + String::push_str(__local_171, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_171, 58); __local_172 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_171 }; i32::fmt_decimal(128, __local_172); - String::append(__local_171, String { repr: array.new_data(" + String::push_str(__local_171, String { repr: array.new_data(" condition: `{i:#010b}` == \"0b00101010\" "), used: 40 }); break __tmpl: __local_171; @@ -2188,17 +2188,17 @@ condition: `{i:#010b}` == \"0b00101010\" if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_175 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_175, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_175, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_175, 32); - String::append_char(__local_175, 97); - String::append_char(__local_175, 116); - String::append_char(__local_175, 32); - String::append(__local_175, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_175, 58); + String::push_str(__local_175, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_175, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_175, 32); + String::push(__local_175, 97); + String::push(__local_175, 116); + String::push(__local_175, 32); + String::push_str(__local_175, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_175, 58); __local_176 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_175 }; i32::fmt_decimal(129, __local_176); - String::append(__local_175, String { repr: array.new_data(" + String::push_str(__local_175, String { repr: array.new_data(" condition: `{i:<10b}` == \"101010 \" "), used: 39 }); break __tmpl: __local_175; @@ -2214,17 +2214,17 @@ condition: `{i:<10b}` == \"101010 \" if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_179 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_179, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_179, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_179, 32); - String::append_char(__local_179, 97); - String::append_char(__local_179, 116); - String::append_char(__local_179, 32); - String::append(__local_179, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_179, 58); + String::push_str(__local_179, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_179, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_179, 32); + String::push(__local_179, 97); + String::push(__local_179, 116); + String::push(__local_179, 32); + String::push_str(__local_179, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_179, 58); __local_180 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_179 }; i32::fmt_decimal(130, __local_180); - String::append(__local_179, String { repr: array.new_data(" + String::push_str(__local_179, String { repr: array.new_data(" condition: `{i:>10b}` == \" 101010\" "), used: 39 }); break __tmpl: __local_179; @@ -2240,17 +2240,17 @@ condition: `{i:>10b}` == \" 101010\" if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_183 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_183, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_183, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_183, 32); - String::append_char(__local_183, 97); - String::append_char(__local_183, 116); - String::append_char(__local_183, 32); - String::append(__local_183, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_183, 58); + String::push_str(__local_183, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_183, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_183, 32); + String::push(__local_183, 97); + String::push(__local_183, 116); + String::push(__local_183, 32); + String::push_str(__local_183, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_183, 58); __local_184 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_183 }; i32::fmt_decimal(131, __local_184); - String::append(__local_183, String { repr: array.new_data(" + String::push_str(__local_183, String { repr: array.new_data(" condition: `{neg:b}` == \"-101010\" "), used: 35 }); break __tmpl: __local_183; @@ -2266,17 +2266,17 @@ condition: `{neg:b}` == \"-101010\" if __cond_23 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_187 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_187, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_187, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_187, 32); - String::append_char(__local_187, 97); - String::append_char(__local_187, 116); - String::append_char(__local_187, 32); - String::append(__local_187, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_187, 58); + String::push_str(__local_187, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_187, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_187, 32); + String::push(__local_187, 97); + String::push(__local_187, 116); + String::push(__local_187, 32); + String::push_str(__local_187, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_187, 58); __local_188 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_187 }; i32::fmt_decimal(132, __local_188); - String::append(__local_187, String { repr: array.new_data(" + String::push_str(__local_187, String { repr: array.new_data(" condition: `{neg:#b}` == \"-0b101010\" "), used: 38 }); break __tmpl: __local_187; @@ -2292,17 +2292,17 @@ condition: `{neg:#b}` == \"-0b101010\" if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_191 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_191, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_191, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_191, 32); - String::append_char(__local_191, 97); - String::append_char(__local_191, 116); - String::append_char(__local_191, 32); - String::append(__local_191, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_191, 58); + String::push_str(__local_191, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_191, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_191, 32); + String::push(__local_191, 97); + String::push(__local_191, 116); + String::push(__local_191, 32); + String::push_str(__local_191, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_191, 58); __local_192 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_191 }; i32::fmt_decimal(133, __local_192); - String::append(__local_191, String { repr: array.new_data(" + String::push_str(__local_191, String { repr: array.new_data(" condition: `{i:o}` == \"52\" "), used: 28 }); break __tmpl: __local_191; @@ -2318,17 +2318,17 @@ condition: `{i:o}` == \"52\" if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_195 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_195, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_195, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_195, 32); - String::append_char(__local_195, 97); - String::append_char(__local_195, 116); - String::append_char(__local_195, 32); - String::append(__local_195, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_195, 58); + String::push_str(__local_195, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_195, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_195, 32); + String::push(__local_195, 97); + String::push(__local_195, 116); + String::push(__local_195, 32); + String::push_str(__local_195, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_195, 58); __local_196 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_195 }; i32::fmt_decimal(134, __local_196); - String::append(__local_195, String { repr: array.new_data(" + String::push_str(__local_195, String { repr: array.new_data(" condition: `{i:#o}` == \"0o52\" "), used: 31 }); break __tmpl: __local_195; @@ -2344,17 +2344,17 @@ condition: `{i:#o}` == \"0o52\" if __cond_26 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_199 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_199, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_199, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_199, 32); - String::append_char(__local_199, 97); - String::append_char(__local_199, 116); - String::append_char(__local_199, 32); - String::append(__local_199, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_199, 58); + String::push_str(__local_199, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_199, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_199, 32); + String::push(__local_199, 97); + String::push(__local_199, 116); + String::push(__local_199, 32); + String::push_str(__local_199, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_199, 58); __local_200 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_199 }; i32::fmt_decimal(135, __local_200); - String::append(__local_199, String { repr: array.new_data(" + String::push_str(__local_199, String { repr: array.new_data(" condition: `{i:#010o}` == \"0o00000052\" "), used: 40 }); break __tmpl: __local_199; @@ -2370,17 +2370,17 @@ condition: `{i:#010o}` == \"0o00000052\" if __cond_27 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_203 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_203, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_203, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_203, 32); - String::append_char(__local_203, 97); - String::append_char(__local_203, 116); - String::append_char(__local_203, 32); - String::append(__local_203, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_203, 58); + String::push_str(__local_203, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_203, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_203, 32); + String::push(__local_203, 97); + String::push(__local_203, 116); + String::push(__local_203, 32); + String::push_str(__local_203, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_203, 58); __local_204 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_203 }; i32::fmt_decimal(136, __local_204); - String::append(__local_203, String { repr: array.new_data(" + String::push_str(__local_203, String { repr: array.new_data(" condition: `{i:<10o}` == \"52 \" "), used: 39 }); break __tmpl: __local_203; @@ -2396,17 +2396,17 @@ condition: `{i:<10o}` == \"52 \" if __cond_28 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_207 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_207, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_207, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_207, 32); - String::append_char(__local_207, 97); - String::append_char(__local_207, 116); - String::append_char(__local_207, 32); - String::append(__local_207, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_207, 58); + String::push_str(__local_207, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_207, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_207, 32); + String::push(__local_207, 97); + String::push(__local_207, 116); + String::push(__local_207, 32); + String::push_str(__local_207, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_207, 58); __local_208 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_207 }; i32::fmt_decimal(137, __local_208); - String::append(__local_207, String { repr: array.new_data(" + String::push_str(__local_207, String { repr: array.new_data(" condition: `{neg:o}` == \"-52\" "), used: 31 }); break __tmpl: __local_207; @@ -2422,17 +2422,17 @@ condition: `{neg:o}` == \"-52\" if __cond_29 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_211 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_211, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_211, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_211, 32); - String::append_char(__local_211, 97); - String::append_char(__local_211, 116); - String::append_char(__local_211, 32); - String::append(__local_211, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_211, 58); + String::push_str(__local_211, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_211, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_211, 32); + String::push(__local_211, 97); + String::push(__local_211, 116); + String::push(__local_211, 32); + String::push_str(__local_211, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_211, 58); __local_212 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_211 }; i32::fmt_decimal(138, __local_212); - String::append(__local_211, String { repr: array.new_data(" + String::push_str(__local_211, String { repr: array.new_data(" condition: `{neg:#o}` == \"-0o52\" "), used: 34 }); break __tmpl: __local_211; @@ -2448,17 +2448,17 @@ condition: `{neg:#o}` == \"-0o52\" if __cond_30 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_215 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_215, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_215, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_215, 32); - String::append_char(__local_215, 97); - String::append_char(__local_215, 116); - String::append_char(__local_215, 32); - String::append(__local_215, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_215, 58); + String::push_str(__local_215, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_215, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_215, 32); + String::push(__local_215, 97); + String::push(__local_215, 116); + String::push(__local_215, 32); + String::push_str(__local_215, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_215, 58); __local_216 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_215 }; i32::fmt_decimal(139, __local_216); - String::append(__local_215, String { repr: array.new_data(" + String::push_str(__local_215, String { repr: array.new_data(" condition: `{i:x}` == \"2a\" "), used: 28 }); break __tmpl: __local_215; @@ -2474,17 +2474,17 @@ condition: `{i:x}` == \"2a\" if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_219 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_219, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_219, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_219, 32); - String::append_char(__local_219, 97); - String::append_char(__local_219, 116); - String::append_char(__local_219, 32); - String::append(__local_219, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_219, 58); + String::push_str(__local_219, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_219, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_219, 32); + String::push(__local_219, 97); + String::push(__local_219, 116); + String::push(__local_219, 32); + String::push_str(__local_219, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_219, 58); __local_220 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_219 }; i32::fmt_decimal(140, __local_220); - String::append(__local_219, String { repr: array.new_data(" + String::push_str(__local_219, String { repr: array.new_data(" condition: `{i:#x}` == \"0x2a\" "), used: 31 }); break __tmpl: __local_219; @@ -2500,17 +2500,17 @@ condition: `{i:#x}` == \"0x2a\" if __cond_32 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_223 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_223, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_223, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_223, 32); - String::append_char(__local_223, 97); - String::append_char(__local_223, 116); - String::append_char(__local_223, 32); - String::append(__local_223, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_223, 58); + String::push_str(__local_223, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_223, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_223, 32); + String::push(__local_223, 97); + String::push(__local_223, 116); + String::push(__local_223, 32); + String::push_str(__local_223, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_223, 58); __local_224 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_223 }; i32::fmt_decimal(141, __local_224); - String::append(__local_223, String { repr: array.new_data(" + String::push_str(__local_223, String { repr: array.new_data(" condition: `{i:#010x}` == \"0x0000002a\" "), used: 40 }); break __tmpl: __local_223; @@ -2526,17 +2526,17 @@ condition: `{i:#010x}` == \"0x0000002a\" if __cond_33 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_227 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_227, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_227, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_227, 32); - String::append_char(__local_227, 97); - String::append_char(__local_227, 116); - String::append_char(__local_227, 32); - String::append(__local_227, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_227, 58); + String::push_str(__local_227, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_227, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_227, 32); + String::push(__local_227, 97); + String::push(__local_227, 116); + String::push(__local_227, 32); + String::push_str(__local_227, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_227, 58); __local_228 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_227 }; i32::fmt_decimal(142, __local_228); - String::append(__local_227, String { repr: array.new_data(" + String::push_str(__local_227, String { repr: array.new_data(" condition: `{i:<10x}` == \"2a \" "), used: 39 }); break __tmpl: __local_227; @@ -2552,17 +2552,17 @@ condition: `{i:<10x}` == \"2a \" if __cond_34 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_231 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_231, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_231, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_231, 32); - String::append_char(__local_231, 97); - String::append_char(__local_231, 116); - String::append_char(__local_231, 32); - String::append(__local_231, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_231, 58); + String::push_str(__local_231, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_231, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_231, 32); + String::push(__local_231, 97); + String::push(__local_231, 116); + String::push(__local_231, 32); + String::push_str(__local_231, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_231, 58); __local_232 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_231 }; i32::fmt_decimal(143, __local_232); - String::append(__local_231, String { repr: array.new_data(" + String::push_str(__local_231, String { repr: array.new_data(" condition: `{i:>10x}` == \" 2a\" "), used: 39 }); break __tmpl: __local_231; @@ -2578,17 +2578,17 @@ condition: `{i:>10x}` == \" 2a\" if __cond_35 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_235 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_235, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_235, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_235, 32); - String::append_char(__local_235, 97); - String::append_char(__local_235, 116); - String::append_char(__local_235, 32); - String::append(__local_235, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_235, 58); + String::push_str(__local_235, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_235, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_235, 32); + String::push(__local_235, 97); + String::push(__local_235, 116); + String::push(__local_235, 32); + String::push_str(__local_235, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_235, 58); __local_236 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_235 }; i32::fmt_decimal(144, __local_236); - String::append(__local_235, String { repr: array.new_data(" + String::push_str(__local_235, String { repr: array.new_data(" condition: `{i:^10x}` == \" 2a \" "), used: 39 }); break __tmpl: __local_235; @@ -2604,17 +2604,17 @@ condition: `{i:^10x}` == \" 2a \" if __cond_36 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_239 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_239, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_239, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_239, 32); - String::append_char(__local_239, 97); - String::append_char(__local_239, 116); - String::append_char(__local_239, 32); - String::append(__local_239, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_239, 58); + String::push_str(__local_239, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_239, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_239, 32); + String::push(__local_239, 97); + String::push(__local_239, 116); + String::push(__local_239, 32); + String::push_str(__local_239, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_239, 58); __local_240 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_239 }; i32::fmt_decimal(145, __local_240); - String::append(__local_239, String { repr: array.new_data(" + String::push_str(__local_239, String { repr: array.new_data(" condition: `{i:X}` == \"2A\" "), used: 28 }); break __tmpl: __local_239; @@ -2630,17 +2630,17 @@ condition: `{i:X}` == \"2A\" if __cond_37 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_243 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_243, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_243, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_243, 32); - String::append_char(__local_243, 97); - String::append_char(__local_243, 116); - String::append_char(__local_243, 32); - String::append(__local_243, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_243, 58); + String::push_str(__local_243, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_243, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_243, 32); + String::push(__local_243, 97); + String::push(__local_243, 116); + String::push(__local_243, 32); + String::push_str(__local_243, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_243, 58); __local_244 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_243 }; i32::fmt_decimal(146, __local_244); - String::append(__local_243, String { repr: array.new_data(" + String::push_str(__local_243, String { repr: array.new_data(" condition: `{i:#X}` == \"0X2A\" "), used: 31 }); break __tmpl: __local_243; @@ -2656,17 +2656,17 @@ condition: `{i:#X}` == \"0X2A\" if __cond_38 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_247 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_247, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_247, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_247, 32); - String::append_char(__local_247, 97); - String::append_char(__local_247, 116); - String::append_char(__local_247, 32); - String::append(__local_247, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_247, 58); + String::push_str(__local_247, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_247, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_247, 32); + String::push(__local_247, 97); + String::push(__local_247, 116); + String::push(__local_247, 32); + String::push_str(__local_247, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_247, 58); __local_248 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_247 }; i32::fmt_decimal(147, __local_248); - String::append(__local_247, String { repr: array.new_data(" + String::push_str(__local_247, String { repr: array.new_data(" condition: `{i:#010X}` == \"0X0000002A\" "), used: 40 }); break __tmpl: __local_247; @@ -2682,17 +2682,17 @@ condition: `{i:#010X}` == \"0X0000002A\" if __cond_39 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_251 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_251, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_251, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_251, 32); - String::append_char(__local_251, 97); - String::append_char(__local_251, 116); - String::append_char(__local_251, 32); - String::append(__local_251, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_251, 58); + String::push_str(__local_251, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_251, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_251, 32); + String::push(__local_251, 97); + String::push(__local_251, 116); + String::push(__local_251, 32); + String::push_str(__local_251, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_251, 58); __local_252 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_251 }; i32::fmt_decimal(148, __local_252); - String::append(__local_251, String { repr: array.new_data(" + String::push_str(__local_251, String { repr: array.new_data(" condition: `{neg:x}` == \"-2a\" "), used: 31 }); break __tmpl: __local_251; @@ -2708,17 +2708,17 @@ condition: `{neg:x}` == \"-2a\" if __cond_40 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_255 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_255, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_255, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_255, 32); - String::append_char(__local_255, 97); - String::append_char(__local_255, 116); - String::append_char(__local_255, 32); - String::append(__local_255, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_255, 58); + String::push_str(__local_255, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_255, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_255, 32); + String::push(__local_255, 97); + String::push(__local_255, 116); + String::push(__local_255, 32); + String::push_str(__local_255, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_255, 58); __local_256 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_255 }; i32::fmt_decimal(149, __local_256); - String::append(__local_255, String { repr: array.new_data(" + String::push_str(__local_255, String { repr: array.new_data(" condition: `{neg:#x}` == \"-0x2a\" "), used: 34 }); break __tmpl: __local_255; @@ -2734,17 +2734,17 @@ condition: `{neg:#x}` == \"-0x2a\" if __cond_41 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_259 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_259, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_259, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_259, 32); - String::append_char(__local_259, 97); - String::append_char(__local_259, 116); - String::append_char(__local_259, 32); - String::append(__local_259, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_259, 58); + String::push_str(__local_259, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_259, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_259, 32); + String::push(__local_259, 97); + String::push(__local_259, 116); + String::push(__local_259, 32); + String::push_str(__local_259, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_259, 58); __local_260 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_259 }; i32::fmt_decimal(150, __local_260); - String::append(__local_259, String { repr: array.new_data(" + String::push_str(__local_259, String { repr: array.new_data(" condition: `{neg:X}` == \"-2A\" "), used: 31 }); break __tmpl: __local_259; @@ -2760,17 +2760,17 @@ condition: `{neg:X}` == \"-2A\" if __cond_42 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_263 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_263, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_263, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_263, 32); - String::append_char(__local_263, 97); - String::append_char(__local_263, 116); - String::append_char(__local_263, 32); - String::append(__local_263, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_263, 58); + String::push_str(__local_263, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_263, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_263, 32); + String::push(__local_263, 97); + String::push(__local_263, 116); + String::push(__local_263, 32); + String::push_str(__local_263, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_263, 58); __local_264 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_263 }; i32::fmt_decimal(151, __local_264); - String::append(__local_263, String { repr: array.new_data(" + String::push_str(__local_263, String { repr: array.new_data(" condition: `{neg:#X}` == \"-0X2A\" "), used: 34 }); break __tmpl: __local_263; @@ -2787,17 +2787,17 @@ condition: `{neg:#X}` == \"-0X2A\" if __cond_44 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_267 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_267, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_267, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_267, 32); - String::append_char(__local_267, 97); - String::append_char(__local_267, 116); - String::append_char(__local_267, 32); - String::append(__local_267, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_267, 58); + String::push_str(__local_267, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_267, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_267, 32); + String::push(__local_267, 97); + String::push(__local_267, 116); + String::push(__local_267, 32); + String::push_str(__local_267, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_267, 58); __local_268 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_267 }; i32::fmt_decimal(153, __local_268); - String::append(__local_267, String { repr: array.new_data(" + String::push_str(__local_267, String { repr: array.new_data(" condition: `{zero}` == \"0\" "), used: 28 }); break __tmpl: __local_267; @@ -2813,17 +2813,17 @@ condition: `{zero}` == \"0\" if __cond_45 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_271 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_271, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_271, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_271, 32); - String::append_char(__local_271, 97); - String::append_char(__local_271, 116); - String::append_char(__local_271, 32); - String::append(__local_271, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_271, 58); + String::push_str(__local_271, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_271, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_271, 32); + String::push(__local_271, 97); + String::push(__local_271, 116); + String::push(__local_271, 32); + String::push_str(__local_271, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_271, 58); __local_272 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_271 }; i32::fmt_decimal(154, __local_272); - String::append(__local_271, String { repr: array.new_data(" + String::push_str(__local_271, String { repr: array.new_data(" condition: `{zero:+}` == \"+0\" "), used: 31 }); break __tmpl: __local_271; @@ -2839,17 +2839,17 @@ condition: `{zero:+}` == \"+0\" if __cond_46 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_275 = String { repr: builtin::array_new(103), used: 0 }; - String::append(__local_275, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_275, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_275, 32); - String::append_char(__local_275, 97); - String::append_char(__local_275, 116); - String::append_char(__local_275, 32); - String::append(__local_275, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_275, 58); + String::push_str(__local_275, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_275, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_275, 32); + String::push(__local_275, 97); + String::push(__local_275, 116); + String::push(__local_275, 32); + String::push_str(__local_275, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_275, 58); __local_276 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_275 }; i32::fmt_decimal(155, __local_276); - String::append(__local_275, String { repr: array.new_data(" + String::push_str(__local_275, String { repr: array.new_data(" condition: `{zero:b}` == \"0\" "), used: 30 }); break __tmpl: __local_275; @@ -2865,17 +2865,17 @@ condition: `{zero:b}` == \"0\" if __cond_47 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_279 = String { repr: builtin::array_new(103), used: 0 }; - String::append(__local_279, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_279, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_279, 32); - String::append_char(__local_279, 97); - String::append_char(__local_279, 116); - String::append_char(__local_279, 32); - String::append(__local_279, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_279, 58); + String::push_str(__local_279, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_279, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_279, 32); + String::push(__local_279, 97); + String::push(__local_279, 116); + String::push(__local_279, 32); + String::push_str(__local_279, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_279, 58); __local_280 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_279 }; i32::fmt_decimal(156, __local_280); - String::append(__local_279, String { repr: array.new_data(" + String::push_str(__local_279, String { repr: array.new_data(" condition: `{zero:o}` == \"0\" "), used: 30 }); break __tmpl: __local_279; @@ -2891,17 +2891,17 @@ condition: `{zero:o}` == \"0\" if __cond_48 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_283 = String { repr: builtin::array_new(103), used: 0 }; - String::append(__local_283, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_283, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_283, 32); - String::append_char(__local_283, 97); - String::append_char(__local_283, 116); - String::append_char(__local_283, 32); - String::append(__local_283, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_283, 58); + String::push_str(__local_283, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_283, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_283, 32); + String::push(__local_283, 97); + String::push(__local_283, 116); + String::push(__local_283, 32); + String::push_str(__local_283, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_283, 58); __local_284 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_283 }; i32::fmt_decimal(157, __local_284); - String::append(__local_283, String { repr: array.new_data(" + String::push_str(__local_283, String { repr: array.new_data(" condition: `{zero:x}` == \"0\" "), used: 30 }); break __tmpl: __local_283; @@ -2917,17 +2917,17 @@ condition: `{zero:x}` == \"0\" if __cond_49 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_287 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_287, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_287, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_287, 32); - String::append_char(__local_287, 97); - String::append_char(__local_287, 116); - String::append_char(__local_287, 32); - String::append(__local_287, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_287, 58); + String::push_str(__local_287, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_287, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_287, 32); + String::push(__local_287, 97); + String::push(__local_287, 116); + String::push(__local_287, 32); + String::push_str(__local_287, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_287, 58); __local_288 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_287 }; i32::fmt_decimal(158, __local_288); - String::append(__local_287, String { repr: array.new_data(" + String::push_str(__local_287, String { repr: array.new_data(" condition: `{zero:#x}` == \"0x0\" "), used: 33 }); break __tmpl: __local_287; @@ -2943,17 +2943,17 @@ condition: `{zero:#x}` == \"0x0\" if __cond_50 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_291 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_291, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_291, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_291, 32); - String::append_char(__local_291, 97); - String::append_char(__local_291, 116); - String::append_char(__local_291, 32); - String::append(__local_291, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_291, 58); + String::push_str(__local_291, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_291, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_291, 32); + String::push(__local_291, 97); + String::push(__local_291, 116); + String::push(__local_291, 32); + String::push_str(__local_291, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_291, 58); __local_292 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_291 }; i32::fmt_decimal(159, __local_292); - String::append(__local_291, String { repr: array.new_data(" + String::push_str(__local_291, String { repr: array.new_data(" condition: `{zero:#b}` == \"0b0\" "), used: 33 }); break __tmpl: __local_291; @@ -2969,17 +2969,17 @@ condition: `{zero:#b}` == \"0b0\" if __cond_51 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_295 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_295, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_295, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_295, 32); - String::append_char(__local_295, 97); - String::append_char(__local_295, 116); - String::append_char(__local_295, 32); - String::append(__local_295, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_295, 58); + String::push_str(__local_295, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_295, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_295, 32); + String::push(__local_295, 97); + String::push(__local_295, 116); + String::push(__local_295, 32); + String::push_str(__local_295, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_295, 58); __local_296 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_295 }; i32::fmt_decimal(160, __local_296); - String::append(__local_295, String { repr: array.new_data(" + String::push_str(__local_295, String { repr: array.new_data(" condition: `{zero:#o}` == \"0o0\" "), used: 33 }); break __tmpl: __local_295; @@ -2995,17 +2995,17 @@ condition: `{zero:#o}` == \"0o0\" if __cond_52 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_299 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_299, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_299, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_299, 32); - String::append_char(__local_299, 97); - String::append_char(__local_299, 116); - String::append_char(__local_299, 32); - String::append(__local_299, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_299, 58); + String::push_str(__local_299, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_299, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_299, 32); + String::push(__local_299, 97); + String::push(__local_299, 116); + String::push(__local_299, 32); + String::push_str(__local_299, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_299, 58); __local_300 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_299 }; i32::fmt_decimal(161, __local_300); - String::append(__local_299, String { repr: array.new_data(" + String::push_str(__local_299, String { repr: array.new_data(" condition: `{zero:05}` == \"00000\" "), used: 35 }); break __tmpl: __local_299; @@ -3021,17 +3021,17 @@ condition: `{zero:05}` == \"00000\" if __cond_53 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_303 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_303, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_303, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_303, 32); - String::append_char(__local_303, 97); - String::append_char(__local_303, 116); - String::append_char(__local_303, 32); - String::append(__local_303, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_303, 58); + String::push_str(__local_303, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_303, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_303, 32); + String::push(__local_303, 97); + String::push(__local_303, 116); + String::push(__local_303, 32); + String::push_str(__local_303, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_303, 58); __local_304 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_303 }; i32::fmt_decimal(162, __local_304); - String::append(__local_303, String { repr: array.new_data(" + String::push_str(__local_303, String { repr: array.new_data(" condition: `{zero:^5}` == \" 0 \" "), used: 35 }); break __tmpl: __local_303; @@ -3048,17 +3048,17 @@ condition: `{zero:^5}` == \" 0 \" if __cond_55 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_307 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_307, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_307, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_307, 32); - String::append_char(__local_307, 97); - String::append_char(__local_307, 116); - String::append_char(__local_307, 32); - String::append(__local_307, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_307, 58); + String::push_str(__local_307, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_307, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_307, 32); + String::push(__local_307, 97); + String::push(__local_307, 116); + String::push(__local_307, 32); + String::push_str(__local_307, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_307, 58); __local_308 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_307 }; i32::fmt_decimal(164, __local_308); - String::append(__local_307, String { repr: array.new_data(" + String::push_str(__local_307, String { repr: array.new_data(" condition: `{u:10}` == \" 42\" "), used: 37 }); break __tmpl: __local_307; @@ -3074,17 +3074,17 @@ condition: `{u:10}` == \" 42\" if __cond_56 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_311 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_311, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_311, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_311, 32); - String::append_char(__local_311, 97); - String::append_char(__local_311, 116); - String::append_char(__local_311, 32); - String::append(__local_311, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_311, 58); + String::push_str(__local_311, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_311, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_311, 32); + String::push(__local_311, 97); + String::push(__local_311, 116); + String::push(__local_311, 32); + String::push_str(__local_311, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_311, 58); __local_312 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_311 }; i32::fmt_decimal(165, __local_312); - String::append(__local_311, String { repr: array.new_data(" + String::push_str(__local_311, String { repr: array.new_data(" condition: `{u:<10}` == \"42 \" "), used: 38 }); break __tmpl: __local_311; @@ -3100,17 +3100,17 @@ condition: `{u:<10}` == \"42 \" if __cond_57 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_315 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_315, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_315, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_315, 32); - String::append_char(__local_315, 97); - String::append_char(__local_315, 116); - String::append_char(__local_315, 32); - String::append(__local_315, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_315, 58); + String::push_str(__local_315, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_315, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_315, 32); + String::push(__local_315, 97); + String::push(__local_315, 116); + String::push(__local_315, 32); + String::push_str(__local_315, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_315, 58); __local_316 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_315 }; i32::fmt_decimal(166, __local_316); - String::append(__local_315, String { repr: array.new_data(" + String::push_str(__local_315, String { repr: array.new_data(" condition: `{u:^10}` == \" 42 \" "), used: 38 }); break __tmpl: __local_315; @@ -3126,17 +3126,17 @@ condition: `{u:^10}` == \" 42 \" if __cond_58 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_319 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_319, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_319, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_319, 32); - String::append_char(__local_319, 97); - String::append_char(__local_319, 116); - String::append_char(__local_319, 32); - String::append(__local_319, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_319, 58); + String::push_str(__local_319, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_319, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_319, 32); + String::push(__local_319, 97); + String::push(__local_319, 116); + String::push(__local_319, 32); + String::push_str(__local_319, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_319, 58); __local_320 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_319 }; i32::fmt_decimal(167, __local_320); - String::append(__local_319, String { repr: array.new_data(" + String::push_str(__local_319, String { repr: array.new_data(" condition: `{u:*^10}` == \"****42****\" "), used: 39 }); break __tmpl: __local_319; @@ -3152,17 +3152,17 @@ condition: `{u:*^10}` == \"****42****\" if __cond_59 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_323 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_323, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_323, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_323, 32); - String::append_char(__local_323, 97); - String::append_char(__local_323, 116); - String::append_char(__local_323, 32); - String::append(__local_323, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_323, 58); + String::push_str(__local_323, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_323, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_323, 32); + String::push(__local_323, 97); + String::push(__local_323, 116); + String::push(__local_323, 32); + String::push_str(__local_323, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_323, 58); __local_324 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_323 }; i32::fmt_decimal(168, __local_324); - String::append(__local_323, String { repr: array.new_data(" + String::push_str(__local_323, String { repr: array.new_data(" condition: `{u:08}` == \"00000042\" "), used: 35 }); break __tmpl: __local_323; @@ -3178,17 +3178,17 @@ condition: `{u:08}` == \"00000042\" if __cond_60 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_327 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_327, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_327, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_327, 32); - String::append_char(__local_327, 97); - String::append_char(__local_327, 116); - String::append_char(__local_327, 32); - String::append(__local_327, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_327, 58); + String::push_str(__local_327, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_327, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_327, 32); + String::push(__local_327, 97); + String::push(__local_327, 116); + String::push(__local_327, 32); + String::push_str(__local_327, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_327, 58); __local_328 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_327 }; i32::fmt_decimal(169, __local_328); - String::append(__local_327, String { repr: array.new_data(" + String::push_str(__local_327, String { repr: array.new_data(" condition: `{u:b}` == \"101010\" "), used: 32 }); break __tmpl: __local_327; @@ -3204,17 +3204,17 @@ condition: `{u:b}` == \"101010\" if __cond_61 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_331 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_331, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_331, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_331, 32); - String::append_char(__local_331, 97); - String::append_char(__local_331, 116); - String::append_char(__local_331, 32); - String::append(__local_331, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_331, 58); + String::push_str(__local_331, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_331, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_331, 32); + String::push(__local_331, 97); + String::push(__local_331, 116); + String::push(__local_331, 32); + String::push_str(__local_331, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_331, 58); __local_332 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_331 }; i32::fmt_decimal(170, __local_332); - String::append(__local_331, String { repr: array.new_data(" + String::push_str(__local_331, String { repr: array.new_data(" condition: `{u:08b}` == \"00101010\" "), used: 36 }); break __tmpl: __local_331; @@ -3230,17 +3230,17 @@ condition: `{u:08b}` == \"00101010\" if __cond_62 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_335 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_335, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_335, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_335, 32); - String::append_char(__local_335, 97); - String::append_char(__local_335, 116); - String::append_char(__local_335, 32); - String::append(__local_335, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_335, 58); + String::push_str(__local_335, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_335, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_335, 32); + String::push(__local_335, 97); + String::push(__local_335, 116); + String::push(__local_335, 32); + String::push_str(__local_335, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_335, 58); __local_336 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_335 }; i32::fmt_decimal(171, __local_336); - String::append(__local_335, String { repr: array.new_data(" + String::push_str(__local_335, String { repr: array.new_data(" condition: `{u:#b}` == \"0b101010\" "), used: 35 }); break __tmpl: __local_335; @@ -3256,17 +3256,17 @@ condition: `{u:#b}` == \"0b101010\" if __cond_63 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_339 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_339, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_339, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_339, 32); - String::append_char(__local_339, 97); - String::append_char(__local_339, 116); - String::append_char(__local_339, 32); - String::append(__local_339, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_339, 58); + String::push_str(__local_339, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_339, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_339, 32); + String::push(__local_339, 97); + String::push(__local_339, 116); + String::push(__local_339, 32); + String::push_str(__local_339, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_339, 58); __local_340 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_339 }; i32::fmt_decimal(172, __local_340); - String::append(__local_339, String { repr: array.new_data(" + String::push_str(__local_339, String { repr: array.new_data(" condition: `{u:#010b}` == \"0b00101010\" "), used: 40 }); break __tmpl: __local_339; @@ -3282,17 +3282,17 @@ condition: `{u:#010b}` == \"0b00101010\" if __cond_64 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_343 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_343, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_343, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_343, 32); - String::append_char(__local_343, 97); - String::append_char(__local_343, 116); - String::append_char(__local_343, 32); - String::append(__local_343, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_343, 58); + String::push_str(__local_343, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_343, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_343, 32); + String::push(__local_343, 97); + String::push(__local_343, 116); + String::push(__local_343, 32); + String::push_str(__local_343, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_343, 58); __local_344 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_343 }; i32::fmt_decimal(173, __local_344); - String::append(__local_343, String { repr: array.new_data(" + String::push_str(__local_343, String { repr: array.new_data(" condition: `{u:o}` == \"52\" "), used: 28 }); break __tmpl: __local_343; @@ -3308,17 +3308,17 @@ condition: `{u:o}` == \"52\" if __cond_65 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_347 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_347, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_347, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_347, 32); - String::append_char(__local_347, 97); - String::append_char(__local_347, 116); - String::append_char(__local_347, 32); - String::append(__local_347, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_347, 58); + String::push_str(__local_347, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_347, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_347, 32); + String::push(__local_347, 97); + String::push(__local_347, 116); + String::push(__local_347, 32); + String::push_str(__local_347, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_347, 58); __local_348 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_347 }; i32::fmt_decimal(174, __local_348); - String::append(__local_347, String { repr: array.new_data(" + String::push_str(__local_347, String { repr: array.new_data(" condition: `{u:#o}` == \"0o52\" "), used: 31 }); break __tmpl: __local_347; @@ -3334,17 +3334,17 @@ condition: `{u:#o}` == \"0o52\" if __cond_66 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_351 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_351, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_351, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_351, 32); - String::append_char(__local_351, 97); - String::append_char(__local_351, 116); - String::append_char(__local_351, 32); - String::append(__local_351, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_351, 58); + String::push_str(__local_351, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_351, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_351, 32); + String::push(__local_351, 97); + String::push(__local_351, 116); + String::push(__local_351, 32); + String::push_str(__local_351, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_351, 58); __local_352 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_351 }; i32::fmt_decimal(175, __local_352); - String::append(__local_351, String { repr: array.new_data(" + String::push_str(__local_351, String { repr: array.new_data(" condition: `{u:#010o}` == \"0o00000052\" "), used: 40 }); break __tmpl: __local_351; @@ -3360,17 +3360,17 @@ condition: `{u:#010o}` == \"0o00000052\" if __cond_67 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_355 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_355, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_355, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_355, 32); - String::append_char(__local_355, 97); - String::append_char(__local_355, 116); - String::append_char(__local_355, 32); - String::append(__local_355, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_355, 58); + String::push_str(__local_355, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_355, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_355, 32); + String::push(__local_355, 97); + String::push(__local_355, 116); + String::push(__local_355, 32); + String::push_str(__local_355, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_355, 58); __local_356 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_355 }; i32::fmt_decimal(176, __local_356); - String::append(__local_355, String { repr: array.new_data(" + String::push_str(__local_355, String { repr: array.new_data(" condition: `{u:x}` == \"2a\" "), used: 28 }); break __tmpl: __local_355; @@ -3386,17 +3386,17 @@ condition: `{u:x}` == \"2a\" if __cond_68 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_359 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_359, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_359, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_359, 32); - String::append_char(__local_359, 97); - String::append_char(__local_359, 116); - String::append_char(__local_359, 32); - String::append(__local_359, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_359, 58); + String::push_str(__local_359, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_359, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_359, 32); + String::push(__local_359, 97); + String::push(__local_359, 116); + String::push(__local_359, 32); + String::push_str(__local_359, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_359, 58); __local_360 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_359 }; i32::fmt_decimal(177, __local_360); - String::append(__local_359, String { repr: array.new_data(" + String::push_str(__local_359, String { repr: array.new_data(" condition: `{u:X}` == \"2A\" "), used: 28 }); break __tmpl: __local_359; @@ -3412,17 +3412,17 @@ condition: `{u:X}` == \"2A\" if __cond_69 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_363 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_363, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_363, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_363, 32); - String::append_char(__local_363, 97); - String::append_char(__local_363, 116); - String::append_char(__local_363, 32); - String::append(__local_363, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_363, 58); + String::push_str(__local_363, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_363, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_363, 32); + String::push(__local_363, 97); + String::push(__local_363, 116); + String::push(__local_363, 32); + String::push_str(__local_363, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_363, 58); __local_364 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_363 }; i32::fmt_decimal(178, __local_364); - String::append(__local_363, String { repr: array.new_data(" + String::push_str(__local_363, String { repr: array.new_data(" condition: `{u:#x}` == \"0x2a\" "), used: 31 }); break __tmpl: __local_363; @@ -3438,17 +3438,17 @@ condition: `{u:#x}` == \"0x2a\" if __cond_70 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_367 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_367, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_367, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_367, 32); - String::append_char(__local_367, 97); - String::append_char(__local_367, 116); - String::append_char(__local_367, 32); - String::append(__local_367, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_367, 58); + String::push_str(__local_367, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_367, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_367, 32); + String::push(__local_367, 97); + String::push(__local_367, 116); + String::push(__local_367, 32); + String::push_str(__local_367, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_367, 58); __local_368 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_367 }; i32::fmt_decimal(179, __local_368); - String::append(__local_367, String { repr: array.new_data(" + String::push_str(__local_367, String { repr: array.new_data(" condition: `{u:#X}` == \"0X2A\" "), used: 31 }); break __tmpl: __local_367; @@ -3464,17 +3464,17 @@ condition: `{u:#X}` == \"0X2A\" if __cond_71 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_371 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_371, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_371, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_371, 32); - String::append_char(__local_371, 97); - String::append_char(__local_371, 116); - String::append_char(__local_371, 32); - String::append(__local_371, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_371, 58); + String::push_str(__local_371, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_371, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_371, 32); + String::push(__local_371, 97); + String::push(__local_371, 116); + String::push(__local_371, 32); + String::push_str(__local_371, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_371, 58); __local_372 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_371 }; i32::fmt_decimal(180, __local_372); - String::append(__local_371, String { repr: array.new_data(" + String::push_str(__local_371, String { repr: array.new_data(" condition: `{u:#010x}` == \"0x0000002a\" "), used: 40 }); break __tmpl: __local_371; @@ -3490,17 +3490,17 @@ condition: `{u:#010x}` == \"0x0000002a\" if __cond_72 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_375 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_375, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_375, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_375, 32); - String::append_char(__local_375, 97); - String::append_char(__local_375, 116); - String::append_char(__local_375, 32); - String::append(__local_375, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_375, 58); + String::push_str(__local_375, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_375, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_375, 32); + String::push(__local_375, 97); + String::push(__local_375, 116); + String::push(__local_375, 32); + String::push_str(__local_375, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_375, 58); __local_376 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_375 }; i32::fmt_decimal(181, __local_376); - String::append(__local_375, String { repr: array.new_data(" + String::push_str(__local_375, String { repr: array.new_data(" condition: `{u:<10x}` == \"2a \" "), used: 39 }); break __tmpl: __local_375; @@ -3517,17 +3517,17 @@ condition: `{u:<10x}` == \"2a \" if __cond_74 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_379 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_379, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_379, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_379, 32); - String::append_char(__local_379, 97); - String::append_char(__local_379, 116); - String::append_char(__local_379, 32); - String::append(__local_379, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_379, 58); + String::push_str(__local_379, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_379, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_379, 32); + String::push(__local_379, 97); + String::push(__local_379, 116); + String::push(__local_379, 32); + String::push_str(__local_379, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_379, 58); __local_380 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_379 }; i32::fmt_decimal(183, __local_380); - String::append(__local_379, String { repr: array.new_data(" + String::push_str(__local_379, String { repr: array.new_data(" condition: `{uzero}` == \"0\" "), used: 29 }); break __tmpl: __local_379; @@ -3543,17 +3543,17 @@ condition: `{uzero}` == \"0\" if __cond_75 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_383 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_383, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_383, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_383, 32); - String::append_char(__local_383, 97); - String::append_char(__local_383, 116); - String::append_char(__local_383, 32); - String::append(__local_383, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_383, 58); + String::push_str(__local_383, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_383, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_383, 32); + String::push(__local_383, 97); + String::push(__local_383, 116); + String::push(__local_383, 32); + String::push_str(__local_383, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_383, 58); __local_384 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_383 }; i32::fmt_decimal(184, __local_384); - String::append(__local_383, String { repr: array.new_data(" + String::push_str(__local_383, String { repr: array.new_data(" condition: `{uzero:b}` == \"0\" "), used: 31 }); break __tmpl: __local_383; @@ -3569,17 +3569,17 @@ condition: `{uzero:b}` == \"0\" if __cond_76 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_387 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_387, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_387, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_387, 32); - String::append_char(__local_387, 97); - String::append_char(__local_387, 116); - String::append_char(__local_387, 32); - String::append(__local_387, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_387, 58); + String::push_str(__local_387, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_387, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_387, 32); + String::push(__local_387, 97); + String::push(__local_387, 116); + String::push(__local_387, 32); + String::push_str(__local_387, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_387, 58); __local_388 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_387 }; i32::fmt_decimal(185, __local_388); - String::append(__local_387, String { repr: array.new_data(" + String::push_str(__local_387, String { repr: array.new_data(" condition: `{uzero:#x}` == \"0x0\" "), used: 34 }); break __tmpl: __local_387; @@ -3595,17 +3595,17 @@ condition: `{uzero:#x}` == \"0x0\" if __cond_77 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_391 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_391, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_391, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_391, 32); - String::append_char(__local_391, 97); - String::append_char(__local_391, 116); - String::append_char(__local_391, 32); - String::append(__local_391, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_391, 58); + String::push_str(__local_391, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_391, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_391, 32); + String::push(__local_391, 97); + String::push(__local_391, 116); + String::push(__local_391, 32); + String::push_str(__local_391, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_391, 58); __local_392 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_391 }; i32::fmt_decimal(186, __local_392); - String::append(__local_391, String { repr: array.new_data(" + String::push_str(__local_391, String { repr: array.new_data(" condition: `{uzero:05}` == \"00000\" "), used: 36 }); break __tmpl: __local_391; @@ -3622,17 +3622,17 @@ condition: `{uzero:05}` == \"00000\" if __cond_79 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_395 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_395, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_395, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_395, 32); - String::append_char(__local_395, 97); - String::append_char(__local_395, 116); - String::append_char(__local_395, 32); - String::append(__local_395, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_395, 58); + String::push_str(__local_395, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_395, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_395, 32); + String::push(__local_395, 97); + String::push(__local_395, 116); + String::push(__local_395, 32); + String::push_str(__local_395, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_395, 58); __local_396 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_395 }; i32::fmt_decimal(188, __local_396); - String::append(__local_395, String { repr: array.new_data(" + String::push_str(__local_395, String { repr: array.new_data(" condition: `{i128_max}` == \"170141183460469231731687303715884105727\" "), used: 70 }); break __tmpl: __local_395; @@ -3648,17 +3648,17 @@ condition: `{i128_max}` == \"170141183460469231731687303715884105727\" if __cond_80 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_399 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_399, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_399, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_399, 32); - String::append_char(__local_399, 97); - String::append_char(__local_399, 116); - String::append_char(__local_399, 32); - String::append(__local_399, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_399, 58); + String::push_str(__local_399, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_399, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_399, 32); + String::push(__local_399, 97); + String::push(__local_399, 116); + String::push(__local_399, 32); + String::push_str(__local_399, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_399, 58); __local_400 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_399 }; i32::fmt_decimal(189, __local_400); - String::append(__local_399, String { repr: array.new_data(" + String::push_str(__local_399, String { repr: array.new_data(" condition: `{i128_max:x}` == \"7fffffffffffffffffffffffffffffff\" "), used: 65 }); break __tmpl: __local_399; @@ -3674,17 +3674,17 @@ condition: `{i128_max:x}` == \"7fffffffffffffffffffffffffffffff\" if __cond_81 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_403 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_403, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_403, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_403, 32); - String::append_char(__local_403, 97); - String::append_char(__local_403, 116); - String::append_char(__local_403, 32); - String::append(__local_403, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_403, 58); + String::push_str(__local_403, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_403, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_403, 32); + String::push(__local_403, 97); + String::push(__local_403, 116); + String::push(__local_403, 32); + String::push_str(__local_403, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_403, 58); __local_404 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_403 }; i32::fmt_decimal(190, __local_404); - String::append(__local_403, String { repr: array.new_data(" + String::push_str(__local_403, String { repr: array.new_data(" condition: `{i128_max:X}` == \"7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\" "), used: 65 }); break __tmpl: __local_403; @@ -3700,17 +3700,17 @@ condition: `{i128_max:X}` == \"7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\" if __cond_82 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_407 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_407, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_407, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_407, 32); - String::append_char(__local_407, 97); - String::append_char(__local_407, 116); - String::append_char(__local_407, 32); - String::append(__local_407, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_407, 58); + String::push_str(__local_407, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_407, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_407, 32); + String::push(__local_407, 97); + String::push(__local_407, 116); + String::push(__local_407, 32); + String::push_str(__local_407, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_407, 58); __local_408 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_407 }; i32::fmt_decimal(191, __local_408); - String::append(__local_407, String { repr: array.new_data(" + String::push_str(__local_407, String { repr: array.new_data(" condition: `{i128_max:#x}` == \"0x7fffffffffffffffffffffffffffffff\" "), used: 68 }); break __tmpl: __local_407; @@ -3727,17 +3727,17 @@ condition: `{i128_max:#x}` == \"0x7fffffffffffffffffffffffffffffff\" if __cond_84 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_411 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_411, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_411, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_411, 32); - String::append_char(__local_411, 97); - String::append_char(__local_411, 116); - String::append_char(__local_411, 32); - String::append(__local_411, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_411, 58); + String::push_str(__local_411, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_411, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_411, 32); + String::push(__local_411, 97); + String::push(__local_411, 116); + String::push(__local_411, 32); + String::push_str(__local_411, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_411, 58); __local_412 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_411 }; i32::fmt_decimal(193, __local_412); - String::append(__local_411, String { repr: array.new_data(" + String::push_str(__local_411, String { repr: array.new_data(" condition: `{i128_min}` == \"-170141183460469231731687303715884105728\" "), used: 71 }); break __tmpl: __local_411; @@ -3753,17 +3753,17 @@ condition: `{i128_min}` == \"-170141183460469231731687303715884105728\" if __cond_85 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_415 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_415, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_415, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_415, 32); - String::append_char(__local_415, 97); - String::append_char(__local_415, 116); - String::append_char(__local_415, 32); - String::append(__local_415, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_415, 58); + String::push_str(__local_415, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_415, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_415, 32); + String::push(__local_415, 97); + String::push(__local_415, 116); + String::push(__local_415, 32); + String::push_str(__local_415, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_415, 58); __local_416 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_415 }; i32::fmt_decimal(194, __local_416); - String::append(__local_415, String { repr: array.new_data(" + String::push_str(__local_415, String { repr: array.new_data(" condition: `{i128_min:x}` == \"-80000000000000000000000000000000\" "), used: 66 }); break __tmpl: __local_415; @@ -3779,17 +3779,17 @@ condition: `{i128_min:x}` == \"-80000000000000000000000000000000\" if __cond_86 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_419 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_419, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_419, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_419, 32); - String::append_char(__local_419, 97); - String::append_char(__local_419, 116); - String::append_char(__local_419, 32); - String::append(__local_419, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_419, 58); + String::push_str(__local_419, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_419, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_419, 32); + String::push(__local_419, 97); + String::push(__local_419, 116); + String::push(__local_419, 32); + String::push_str(__local_419, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_419, 58); __local_420 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_419 }; i32::fmt_decimal(195, __local_420); - String::append(__local_419, String { repr: array.new_data(" + String::push_str(__local_419, String { repr: array.new_data(" condition: `{i128_min:#x}` == \"-0x80000000000000000000000000000000\" "), used: 69 }); break __tmpl: __local_419; @@ -3806,17 +3806,17 @@ condition: `{i128_min:#x}` == \"-0x80000000000000000000000000000000\" if __cond_88 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_423 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_423, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_423, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_423, 32); - String::append_char(__local_423, 97); - String::append_char(__local_423, 116); - String::append_char(__local_423, 32); - String::append(__local_423, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_423, 58); + String::push_str(__local_423, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_423, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_423, 32); + String::push(__local_423, 97); + String::push(__local_423, 116); + String::push(__local_423, 32); + String::push_str(__local_423, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_423, 58); __local_424 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_423 }; i32::fmt_decimal(197, __local_424); - String::append(__local_423, String { repr: array.new_data(" + String::push_str(__local_423, String { repr: array.new_data(" condition: `{u128_max}` == \"340282366920938463463374607431768211455\" "), used: 70 }); break __tmpl: __local_423; @@ -3832,17 +3832,17 @@ condition: `{u128_max}` == \"340282366920938463463374607431768211455\" if __cond_89 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_427 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_427, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_427, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_427, 32); - String::append_char(__local_427, 97); - String::append_char(__local_427, 116); - String::append_char(__local_427, 32); - String::append(__local_427, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_427, 58); + String::push_str(__local_427, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_427, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_427, 32); + String::push(__local_427, 97); + String::push(__local_427, 116); + String::push(__local_427, 32); + String::push_str(__local_427, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_427, 58); __local_428 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_427 }; i32::fmt_decimal(198, __local_428); - String::append(__local_427, String { repr: array.new_data(" + String::push_str(__local_427, String { repr: array.new_data(" condition: `{u128_max:x}` == \"ffffffffffffffffffffffffffffffff\" "), used: 65 }); break __tmpl: __local_427; @@ -3858,17 +3858,17 @@ condition: `{u128_max:x}` == \"ffffffffffffffffffffffffffffffff\" if __cond_90 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_431 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_431, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_431, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_431, 32); - String::append_char(__local_431, 97); - String::append_char(__local_431, 116); - String::append_char(__local_431, 32); - String::append(__local_431, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_431, 58); + String::push_str(__local_431, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_431, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_431, 32); + String::push(__local_431, 97); + String::push(__local_431, 116); + String::push(__local_431, 32); + String::push_str(__local_431, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_431, 58); __local_432 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_431 }; i32::fmt_decimal(199, __local_432); - String::append(__local_431, String { repr: array.new_data(" + String::push_str(__local_431, String { repr: array.new_data(" condition: `{u128_max:X}` == \"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\" "), used: 65 }); break __tmpl: __local_431; @@ -3884,17 +3884,17 @@ condition: `{u128_max:X}` == \"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\" if __cond_91 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_435 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_435, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_435, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_435, 32); - String::append_char(__local_435, 97); - String::append_char(__local_435, 116); - String::append_char(__local_435, 32); - String::append(__local_435, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_435, 58); + String::push_str(__local_435, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_435, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_435, 32); + String::push(__local_435, 97); + String::push(__local_435, 116); + String::push(__local_435, 32); + String::push_str(__local_435, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_435, 58); __local_436 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_435 }; i32::fmt_decimal(200, __local_436); - String::append(__local_435, String { repr: array.new_data(" + String::push_str(__local_435, String { repr: array.new_data(" condition: `{u128_max:#x}` == \"0xffffffffffffffffffffffffffffffff\" "), used: 68 }); break __tmpl: __local_435; @@ -3911,17 +3911,17 @@ condition: `{u128_max:#x}` == \"0xffffffffffffffffffffffffffffffff\" if __cond_93 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_439 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_439, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_439, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_439, 32); - String::append_char(__local_439, 97); - String::append_char(__local_439, 116); - String::append_char(__local_439, 32); - String::append(__local_439, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_439, 58); + String::push_str(__local_439, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_439, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_439, 32); + String::push(__local_439, 97); + String::push(__local_439, 116); + String::push(__local_439, 32); + String::push_str(__local_439, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_439, 58); __local_440 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_439 }; i32::fmt_decimal(202, __local_440); - String::append(__local_439, String { repr: array.new_data(" + String::push_str(__local_439, String { repr: array.new_data(" condition: `{u128_one:b}` == \"1\" "), used: 34 }); break __tmpl: __local_439; @@ -3937,17 +3937,17 @@ condition: `{u128_one:b}` == \"1\" if __cond_94 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_443 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_443, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_443, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_443, 32); - String::append_char(__local_443, 97); - String::append_char(__local_443, 116); - String::append_char(__local_443, 32); - String::append(__local_443, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_443, 58); + String::push_str(__local_443, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_443, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_443, 32); + String::push(__local_443, 97); + String::push(__local_443, 116); + String::push(__local_443, 32); + String::push_str(__local_443, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_443, 58); __local_444 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_443 }; i32::fmt_decimal(203, __local_444); - String::append(__local_443, String { repr: array.new_data(" + String::push_str(__local_443, String { repr: array.new_data(" condition: `{u128_one:#b}` == \"0b1\" "), used: 37 }); break __tmpl: __local_443; @@ -3963,17 +3963,17 @@ condition: `{u128_one:#b}` == \"0b1\" if __cond_95 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_447 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_447, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_447, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_447, 32); - String::append_char(__local_447, 97); - String::append_char(__local_447, 116); - String::append_char(__local_447, 32); - String::append(__local_447, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_447, 58); + String::push_str(__local_447, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_447, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_447, 32); + String::push(__local_447, 97); + String::push(__local_447, 116); + String::push(__local_447, 32); + String::push_str(__local_447, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_447, 58); __local_448 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_447 }; i32::fmt_decimal(204, __local_448); - String::append(__local_447, String { repr: array.new_data(" + String::push_str(__local_447, String { repr: array.new_data(" condition: `{u128_one:#x}` == \"0x1\" "), used: 37 }); break __tmpl: __local_447; @@ -3990,17 +3990,17 @@ condition: `{u128_one:#x}` == \"0x1\" if __cond_97 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_451 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_451, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_451, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_451, 32); - String::append_char(__local_451, 97); - String::append_char(__local_451, 116); - String::append_char(__local_451, 32); - String::append(__local_451, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_451, 58); + String::push_str(__local_451, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_451, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_451, 32); + String::push(__local_451, 97); + String::push(__local_451, 116); + String::push(__local_451, 32); + String::push_str(__local_451, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_451, 58); __local_452 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_451 }; i32::fmt_decimal(206, __local_452); - String::append(__local_451, String { repr: array.new_data(" + String::push_str(__local_451, String { repr: array.new_data(" condition: `{u128_256:b}` == \"100000000\" "), used: 42 }); break __tmpl: __local_451; @@ -4016,17 +4016,17 @@ condition: `{u128_256:b}` == \"100000000\" if __cond_98 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_455 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_455, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_455, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_455, 32); - String::append_char(__local_455, 97); - String::append_char(__local_455, 116); - String::append_char(__local_455, 32); - String::append(__local_455, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_455, 58); + String::push_str(__local_455, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_455, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_455, 32); + String::push(__local_455, 97); + String::push(__local_455, 116); + String::push(__local_455, 32); + String::push_str(__local_455, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_455, 58); __local_456 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_455 }; i32::fmt_decimal(207, __local_456); - String::append(__local_455, String { repr: array.new_data(" + String::push_str(__local_455, String { repr: array.new_data(" condition: `{u128_256:o}` == \"400\" "), used: 36 }); break __tmpl: __local_455; @@ -4042,17 +4042,17 @@ condition: `{u128_256:o}` == \"400\" if __cond_99 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_459 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_459, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_459, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_459, 32); - String::append_char(__local_459, 97); - String::append_char(__local_459, 116); - String::append_char(__local_459, 32); - String::append(__local_459, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_459, 58); + String::push_str(__local_459, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_459, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_459, 32); + String::push(__local_459, 97); + String::push(__local_459, 116); + String::push(__local_459, 32); + String::push_str(__local_459, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_459, 58); __local_460 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_459 }; i32::fmt_decimal(208, __local_460); - String::append(__local_459, String { repr: array.new_data(" + String::push_str(__local_459, String { repr: array.new_data(" condition: `{u128_256:x}` == \"100\" "), used: 36 }); break __tmpl: __local_459; @@ -4068,17 +4068,17 @@ condition: `{u128_256:x}` == \"100\" if __cond_100 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_463 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_463, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_463, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); - String::append_char(__local_463, 32); - String::append_char(__local_463, 97); - String::append_char(__local_463, 116); - String::append_char(__local_463, 32); - String::append(__local_463, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_463, 58); + String::push_str(__local_463, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_463, String { repr: array.new_data("test_template_specifiers_i128"), used: 29 }); + String::push(__local_463, 32); + String::push(__local_463, 97); + String::push(__local_463, 116); + String::push(__local_463, 32); + String::push_str(__local_463, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_463, 58); __local_464 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_463 }; i32::fmt_decimal(209, __local_464); - String::append(__local_463, String { repr: array.new_data(" + String::push_str(__local_463, String { repr: array.new_data(" condition: `{u128_256:#x}` == \"0x100\" "), used: 39 }); break __tmpl: __local_463; @@ -4388,17 +4388,17 @@ fn test_template_specifiers_inspect() with Stdout { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_95 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_95, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_95, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_95, 32); - String::append_char(__local_95, 97); - String::append_char(__local_95, 116); - String::append_char(__local_95, 32); - String::append(__local_95, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_95, 58); + String::push_str(__local_95, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_95, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_95, 32); + String::push(__local_95, 97); + String::push(__local_95, 116); + String::push(__local_95, 32); + String::push_str(__local_95, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_95, 58); __local_96 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_95 }; i32::fmt_decimal(215, __local_96); - String::append(__local_95, String { repr: array.new_data(" + String::push_str(__local_95, String { repr: array.new_data(" condition: `{i:?}` == \"42\" "), used: 28 }); break __tmpl: __local_95; @@ -4419,17 +4419,17 @@ condition: `{i:?}` == \"42\" if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_101 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_101, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_101, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_101, 32); - String::append_char(__local_101, 97); - String::append_char(__local_101, 116); - String::append_char(__local_101, 32); - String::append(__local_101, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_101, 58); + String::push_str(__local_101, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_101, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_101, 32); + String::push(__local_101, 97); + String::push(__local_101, 116); + String::push(__local_101, 32); + String::push_str(__local_101, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_101, 58); __local_102 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_101 }; i32::fmt_decimal(216, __local_102); - String::append(__local_101, String { repr: array.new_data(" + String::push_str(__local_101, String { repr: array.new_data(" condition: `{i:?}` == `{i}` "), used: 29 }); break __tmpl: __local_101; @@ -4445,17 +4445,17 @@ condition: `{i:?}` == `{i}` if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_105 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_105, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_105, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_105, 32); - String::append_char(__local_105, 97); - String::append_char(__local_105, 116); - String::append_char(__local_105, 32); - String::append(__local_105, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_105, 58); + String::push_str(__local_105, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_105, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_105, 32); + String::push(__local_105, 97); + String::push(__local_105, 116); + String::push(__local_105, 32); + String::push_str(__local_105, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_105, 58); __local_106 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_105 }; i32::fmt_decimal(218, __local_106); - String::append(__local_105, String { repr: array.new_data(" + String::push_str(__local_105, String { repr: array.new_data(" condition: `{neg:?}` == \"-42\" "), used: 31 }); break __tmpl: __local_105; @@ -4471,17 +4471,17 @@ condition: `{neg:?}` == \"-42\" if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_109 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_109, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_109, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_109, 32); - String::append_char(__local_109, 97); - String::append_char(__local_109, 116); - String::append_char(__local_109, 32); - String::append(__local_109, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_109, 58); + String::push_str(__local_109, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_109, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_109, 32); + String::push(__local_109, 97); + String::push(__local_109, 116); + String::push(__local_109, 32); + String::push_str(__local_109, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_109, 58); __local_110 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_109 }; i32::fmt_decimal(220, __local_110); - String::append(__local_109, String { repr: array.new_data(" + String::push_str(__local_109, String { repr: array.new_data(" condition: `{i64_max:?}` == \"9223372036854775807\" "), used: 51 }); break __tmpl: __local_109; @@ -4497,17 +4497,17 @@ condition: `{i64_max:?}` == \"9223372036854775807\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_113 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_113, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_113, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_113, 32); - String::append_char(__local_113, 97); - String::append_char(__local_113, 116); - String::append_char(__local_113, 32); - String::append(__local_113, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_113, 58); + String::push_str(__local_113, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_113, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_113, 32); + String::push(__local_113, 97); + String::push(__local_113, 116); + String::push(__local_113, 32); + String::push_str(__local_113, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_113, 58); __local_114 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_113 }; i32::fmt_decimal(222, __local_114); - String::append(__local_113, String { repr: array.new_data(" + String::push_str(__local_113, String { repr: array.new_data(" condition: `{u32_max:?}` == \"4294967295\" "), used: 42 }); break __tmpl: __local_113; @@ -4523,17 +4523,17 @@ condition: `{u32_max:?}` == \"4294967295\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_117 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_117, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_117, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_117, 32); - String::append_char(__local_117, 97); - String::append_char(__local_117, 116); - String::append_char(__local_117, 32); - String::append(__local_117, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_117, 58); + String::push_str(__local_117, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_117, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_117, 32); + String::push(__local_117, 97); + String::push(__local_117, 116); + String::push(__local_117, 32); + String::push_str(__local_117, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_117, 58); __local_118 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_117 }; i32::fmt_decimal(224, __local_118); - String::append(__local_117, String { repr: array.new_data(" + String::push_str(__local_117, String { repr: array.new_data(" condition: `{u64_max:?}` == \"18446744073709551615\" "), used: 52 }); break __tmpl: __local_117; @@ -4550,17 +4550,17 @@ condition: `{u64_max:?}` == \"18446744073709551615\" if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_121 = String { repr: builtin::array_new(146), used: 0 }; - String::append(__local_121, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_121, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_121, 32); - String::append_char(__local_121, 97); - String::append_char(__local_121, 116); - String::append_char(__local_121, 32); - String::append(__local_121, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_121, 58); + String::push_str(__local_121, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_121, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_121, 32); + String::push(__local_121, 97); + String::push(__local_121, 116); + String::push(__local_121, 32); + String::push_str(__local_121, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_121, 58); __local_122 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_121 }; i32::fmt_decimal(226, __local_122); - String::append(__local_121, String { repr: array.new_data(" + String::push_str(__local_121, String { repr: array.new_data(" condition: `{i128_val:?}` == \"-170141183460469231731687303715884105728\" "), used: 73 }); break __tmpl: __local_121; @@ -4577,17 +4577,17 @@ condition: `{i128_val:?}` == \"-170141183460469231731687303715884105728\" if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_125 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_125, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_125, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_125, 32); - String::append_char(__local_125, 97); - String::append_char(__local_125, 116); - String::append_char(__local_125, 32); - String::append(__local_125, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_125, 58); + String::push_str(__local_125, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_125, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_125, 32); + String::push(__local_125, 97); + String::push(__local_125, 116); + String::push(__local_125, 32); + String::push_str(__local_125, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_125, 58); __local_126 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_125 }; i32::fmt_decimal(228, __local_126); - String::append(__local_125, String { repr: array.new_data(" + String::push_str(__local_125, String { repr: array.new_data(" condition: `{u128_val:?}` == \"340282366920938463463374607431768211455\" "), used: 72 }); break __tmpl: __local_125; @@ -4603,17 +4603,17 @@ condition: `{u128_val:?}` == \"340282366920938463463374607431768211455\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_129 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_129, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_129, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_129, 32); - String::append_char(__local_129, 97); - String::append_char(__local_129, 116); - String::append_char(__local_129, 32); - String::append(__local_129, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_129, 58); + String::push_str(__local_129, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_129, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_129, 32); + String::push(__local_129, 97); + String::push(__local_129, 116); + String::push(__local_129, 32); + String::push_str(__local_129, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_129, 58); __local_130 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_129 }; i32::fmt_decimal(230, __local_130); - String::append(__local_129, String { repr: array.new_data(" + String::push_str(__local_129, String { repr: array.new_data(" condition: `{i8_val:?}` == \"-128\" "), used: 35 }); break __tmpl: __local_129; @@ -4629,17 +4629,17 @@ condition: `{i8_val:?}` == \"-128\" if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_133 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_133, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_133, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_133, 32); - String::append_char(__local_133, 97); - String::append_char(__local_133, 116); - String::append_char(__local_133, 32); - String::append(__local_133, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_133, 58); + String::push_str(__local_133, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_133, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_133, 32); + String::push(__local_133, 97); + String::push(__local_133, 116); + String::push(__local_133, 32); + String::push_str(__local_133, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_133, 58); __local_134 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_133 }; i32::fmt_decimal(232, __local_134); - String::append(__local_133, String { repr: array.new_data(" + String::push_str(__local_133, String { repr: array.new_data(" condition: `{u8_val:?}` == \"255\" "), used: 34 }); break __tmpl: __local_133; @@ -4655,17 +4655,17 @@ condition: `{u8_val:?}` == \"255\" if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_137 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_137, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_137, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_137, 32); - String::append_char(__local_137, 97); - String::append_char(__local_137, 116); - String::append_char(__local_137, 32); - String::append(__local_137, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_137, 58); + String::push_str(__local_137, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_137, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_137, 32); + String::push(__local_137, 97); + String::push(__local_137, 116); + String::push(__local_137, 32); + String::push_str(__local_137, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_137, 58); __local_138 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_137 }; i32::fmt_decimal(234, __local_138); - String::append(__local_137, String { repr: array.new_data(" + String::push_str(__local_137, String { repr: array.new_data(" condition: `{i16_val:?}` == \"-32768\" "), used: 38 }); break __tmpl: __local_137; @@ -4681,17 +4681,17 @@ condition: `{i16_val:?}` == \"-32768\" if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_141 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_141, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_141, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_141, 32); - String::append_char(__local_141, 97); - String::append_char(__local_141, 116); - String::append_char(__local_141, 32); - String::append(__local_141, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_141, 58); + String::push_str(__local_141, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_141, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_141, 32); + String::push(__local_141, 97); + String::push(__local_141, 116); + String::push(__local_141, 32); + String::push_str(__local_141, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_141, 58); __local_142 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_141 }; i32::fmt_decimal(236, __local_142); - String::append(__local_141, String { repr: array.new_data(" + String::push_str(__local_141, String { repr: array.new_data(" condition: `{u16_val:?}` == \"65535\" "), used: 37 }); break __tmpl: __local_141; @@ -4707,17 +4707,17 @@ condition: `{u16_val:?}` == \"65535\" if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_145 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_145, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_145, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_145, 32); - String::append_char(__local_145, 97); - String::append_char(__local_145, 116); - String::append_char(__local_145, 32); - String::append(__local_145, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_145, 58); + String::push_str(__local_145, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_145, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_145, 32); + String::push(__local_145, 97); + String::push(__local_145, 116); + String::push(__local_145, 32); + String::push_str(__local_145, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_145, 58); __local_146 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_145 }; i32::fmt_decimal(238, __local_146); - String::append(__local_145, String { repr: array.new_data(" + String::push_str(__local_145, String { repr: array.new_data(" condition: `{pi:?}` == \"3.14\" "), used: 31 }); break __tmpl: __local_145; @@ -4733,17 +4733,17 @@ condition: `{pi:?}` == \"3.14\" if __cond_26 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_149 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_149, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_149, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_149, 32); - String::append_char(__local_149, 97); - String::append_char(__local_149, 116); - String::append_char(__local_149, 32); - String::append(__local_149, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_149, 58); + String::push_str(__local_149, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_149, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_149, 32); + String::push(__local_149, 97); + String::push(__local_149, 116); + String::push(__local_149, 32); + String::push_str(__local_149, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_149, 58); __local_150 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_149 }; i32::fmt_decimal(240, __local_150); - String::append(__local_149, String { repr: array.new_data(" + String::push_str(__local_149, String { repr: array.new_data(" condition: `{zero:?}` == \"0.0\" "), used: 32 }); break __tmpl: __local_149; @@ -4759,17 +4759,17 @@ condition: `{zero:?}` == \"0.0\" if __cond_28 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_153 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_153, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_153, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_153, 32); - String::append_char(__local_153, 97); - String::append_char(__local_153, 116); - String::append_char(__local_153, 32); - String::append(__local_153, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_153, 58); + String::push_str(__local_153, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_153, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_153, 32); + String::push(__local_153, 97); + String::push(__local_153, 116); + String::push(__local_153, 32); + String::push_str(__local_153, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_153, 58); __local_154 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_153 }; i32::fmt_decimal(242, __local_154); - String::append(__local_153, String { repr: array.new_data(" + String::push_str(__local_153, String { repr: array.new_data(" condition: `{neg_zero:?}` == \"-0.0\" "), used: 37 }); break __tmpl: __local_153; @@ -4786,17 +4786,17 @@ condition: `{neg_zero:?}` == \"-0.0\" if __cond_30 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_157 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_157, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_157, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_157, 32); - String::append_char(__local_157, 97); - String::append_char(__local_157, 116); - String::append_char(__local_157, 32); - String::append(__local_157, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_157, 58); + String::push_str(__local_157, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_157, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_157, 32); + String::push(__local_157, 97); + String::push(__local_157, 116); + String::push(__local_157, 32); + String::push_str(__local_157, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_157, 58); __local_158 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_157 }; i32::fmt_decimal(244, __local_158); - String::append(__local_157, String { repr: array.new_data(" + String::push_str(__local_157, String { repr: array.new_data(" condition: `{f32_val:?}` == \"2.5\" "), used: 35 }); break __tmpl: __local_157; @@ -4814,17 +4814,17 @@ condition: `{f32_val:?}` == \"2.5\" if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_161 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_161, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_161, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_161, 32); - String::append_char(__local_161, 97); - String::append_char(__local_161, 116); - String::append_char(__local_161, 32); - String::append(__local_161, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_161, 58); + String::push_str(__local_161, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_161, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_161, 32); + String::push(__local_161, 97); + String::push(__local_161, 116); + String::push(__local_161, 32); + String::push_str(__local_161, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_161, 58); __local_162 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_161 }; i32::fmt_decimal(245, __local_162); - String::append(__local_161, String { repr: array.new_data(" + String::push_str(__local_161, String { repr: array.new_data(" condition: `{true:?}` == \"true\" "), used: 33 }); break __tmpl: __local_161; @@ -4842,17 +4842,17 @@ condition: `{true:?}` == \"true\" if __cond_32 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_165 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_165, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_165, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_165, 32); - String::append_char(__local_165, 97); - String::append_char(__local_165, 116); - String::append_char(__local_165, 32); - String::append(__local_165, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_165, 58); + String::push_str(__local_165, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_165, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_165, 32); + String::push(__local_165, 97); + String::push(__local_165, 116); + String::push(__local_165, 32); + String::push_str(__local_165, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_165, 58); __local_166 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_165 }; i32::fmt_decimal(246, __local_166); - String::append(__local_165, String { repr: array.new_data(" + String::push_str(__local_165, String { repr: array.new_data(" condition: `{false:?}` == \"false\" "), used: 35 }); break __tmpl: __local_165; @@ -4868,17 +4868,17 @@ condition: `{false:?}` == \"false\" if __cond_34 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_169 = String { repr: builtin::array_new(98), used: 0 }; - String::append(__local_169, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_169, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_169, 32); - String::append_char(__local_169, 97); - String::append_char(__local_169, 116); - String::append_char(__local_169, 32); - String::append(__local_169, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_169, 58); + String::push_str(__local_169, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_169, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_169, 32); + String::push(__local_169, 97); + String::push(__local_169, 116); + String::push(__local_169, 32); + String::push_str(__local_169, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_169, 58); __local_170 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_169 }; i32::fmt_decimal(248, __local_170); - String::append(__local_169, String { repr: array.new_data(" + String::push_str(__local_169, String { repr: array.new_data(" condition: `{c}` == \"A\" "), used: 25 }); break __tmpl: __local_169; @@ -4894,17 +4894,17 @@ condition: `{c}` == \"A\" if __cond_35 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_173 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_173, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_173, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_173, 32); - String::append_char(__local_173, 97); - String::append_char(__local_173, 116); - String::append_char(__local_173, 32); - String::append(__local_173, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_173, 58); + String::push_str(__local_173, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_173, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_173, 32); + String::push(__local_173, 97); + String::push(__local_173, 116); + String::push(__local_173, 32); + String::push_str(__local_173, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_173, 58); __local_174 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_173 }; i32::fmt_decimal(249, __local_174); - String::append(__local_173, String { repr: array.new_data(" + String::push_str(__local_173, String { repr: array.new_data(" condition: `{c:?}` == \"'A'\" "), used: 29 }); break __tmpl: __local_173; @@ -4920,17 +4920,17 @@ condition: `{c:?}` == \"'A'\" if __cond_37 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_177 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_177, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_177, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_177, 32); - String::append_char(__local_177, 97); - String::append_char(__local_177, 116); - String::append_char(__local_177, 32); - String::append(__local_177, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_177, 58); + String::push_str(__local_177, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_177, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_177, 32); + String::push(__local_177, 97); + String::push(__local_177, 116); + String::push(__local_177, 32); + String::push_str(__local_177, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_177, 58); __local_178 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_177 }; i32::fmt_decimal(251, __local_178); - String::append(__local_177, String { repr: array.new_data(" + String::push_str(__local_177, String { repr: array.new_data(" condition: `{digit}` == \"0\" "), used: 29 }); break __tmpl: __local_177; @@ -4946,17 +4946,17 @@ condition: `{digit}` == \"0\" if __cond_38 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_181 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_181, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_181, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_181, 32); - String::append_char(__local_181, 97); - String::append_char(__local_181, 116); - String::append_char(__local_181, 32); - String::append(__local_181, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_181, 58); + String::push_str(__local_181, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_181, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_181, 32); + String::push(__local_181, 97); + String::push(__local_181, 116); + String::push(__local_181, 32); + String::push_str(__local_181, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_181, 58); __local_182 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_181 }; i32::fmt_decimal(252, __local_182); - String::append(__local_181, String { repr: array.new_data(" + String::push_str(__local_181, String { repr: array.new_data(" condition: `{digit:?}` == \"'0'\" "), used: 33 }); break __tmpl: __local_181; @@ -4972,17 +4972,17 @@ condition: `{digit:?}` == \"'0'\" if __cond_40 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_185 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_185, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_185, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_185, 32); - String::append_char(__local_185, 97); - String::append_char(__local_185, 116); - String::append_char(__local_185, 32); - String::append(__local_185, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_185, 58); + String::push_str(__local_185, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_185, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_185, 32); + String::push(__local_185, 97); + String::push(__local_185, 116); + String::push(__local_185, 32); + String::push_str(__local_185, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_185, 58); __local_186 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_185 }; i32::fmt_decimal(254, __local_186); - String::append(__local_185, String { repr: array.new_data(" + String::push_str(__local_185, String { repr: array.new_data(" condition: `{space}` == \" \" "), used: 29 }); break __tmpl: __local_185; @@ -4998,17 +4998,17 @@ condition: `{space}` == \" \" if __cond_41 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_189 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_189, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_189, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_189, 32); - String::append_char(__local_189, 97); - String::append_char(__local_189, 116); - String::append_char(__local_189, 32); - String::append(__local_189, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_189, 58); + String::push_str(__local_189, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_189, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_189, 32); + String::push(__local_189, 97); + String::push(__local_189, 116); + String::push(__local_189, 32); + String::push_str(__local_189, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_189, 58); __local_190 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_189 }; i32::fmt_decimal(255, __local_190); - String::append(__local_189, String { repr: array.new_data(" + String::push_str(__local_189, String { repr: array.new_data(" condition: `{space:?}` == \"' '\" "), used: 33 }); break __tmpl: __local_189; @@ -5024,17 +5024,17 @@ condition: `{space:?}` == \"' '\" if __cond_43 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_193 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_193, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_193, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_193, 32); - String::append_char(__local_193, 97); - String::append_char(__local_193, 116); - String::append_char(__local_193, 32); - String::append(__local_193, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_193, 58); + String::push_str(__local_193, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_193, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_193, 32); + String::push(__local_193, 97); + String::push(__local_193, 116); + String::push(__local_193, 32); + String::push_str(__local_193, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_193, 58); __local_194 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_193 }; i32::fmt_decimal(257, __local_194); - String::append(__local_193, String { repr: array.new_data(" + String::push_str(__local_193, String { repr: array.new_data(" condition: `{newline:?}` == \"'\\\\n'\" "), used: 37 }); break __tmpl: __local_193; @@ -5050,17 +5050,17 @@ condition: `{newline:?}` == \"'\\\\n'\" if __cond_45 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_197 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_197, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_197, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_197, 32); - String::append_char(__local_197, 97); - String::append_char(__local_197, 116); - String::append_char(__local_197, 32); - String::append(__local_197, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_197, 58); + String::push_str(__local_197, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_197, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_197, 32); + String::push(__local_197, 97); + String::push(__local_197, 116); + String::push(__local_197, 32); + String::push_str(__local_197, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_197, 58); __local_198 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_197 }; i32::fmt_decimal(259, __local_198); - String::append(__local_197, String { repr: array.new_data(" + String::push_str(__local_197, String { repr: array.new_data(" condition: `{tab:?}` == \"'\\\\t'\" "), used: 33 }); break __tmpl: __local_197; @@ -5076,17 +5076,17 @@ condition: `{tab:?}` == \"'\\\\t'\" if __cond_47 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_201 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_201, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_201, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_201, 32); - String::append_char(__local_201, 97); - String::append_char(__local_201, 116); - String::append_char(__local_201, 32); - String::append(__local_201, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_201, 58); + String::push_str(__local_201, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_201, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_201, 32); + String::push(__local_201, 97); + String::push(__local_201, 116); + String::push(__local_201, 32); + String::push_str(__local_201, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_201, 58); __local_202 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_201 }; i32::fmt_decimal(261, __local_202); - String::append(__local_201, String { repr: array.new_data(" + String::push_str(__local_201, String { repr: array.new_data(" condition: `{cr:?}` == \"'\\\\r'\" "), used: 32 }); break __tmpl: __local_201; @@ -5102,17 +5102,17 @@ condition: `{cr:?}` == \"'\\\\r'\" if __cond_49 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_205 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_205, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_205, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_205, 32); - String::append_char(__local_205, 97); - String::append_char(__local_205, 116); - String::append_char(__local_205, 32); - String::append(__local_205, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_205, 58); + String::push_str(__local_205, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_205, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_205, 32); + String::push(__local_205, 97); + String::push(__local_205, 116); + String::push(__local_205, 32); + String::push_str(__local_205, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_205, 58); __local_206 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_205 }; i32::fmt_decimal(263, __local_206); - String::append(__local_205, String { repr: array.new_data(" + String::push_str(__local_205, String { repr: array.new_data(" condition: `{single_quote:?}` == \"'\\\\''\" "), used: 42 }); break __tmpl: __local_205; @@ -5128,17 +5128,17 @@ condition: `{single_quote:?}` == \"'\\\\''\" if __cond_51 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_209 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_209, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_209, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_209, 32); - String::append_char(__local_209, 97); - String::append_char(__local_209, 116); - String::append_char(__local_209, 32); - String::append(__local_209, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_209, 58); + String::push_str(__local_209, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_209, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_209, 32); + String::push(__local_209, 97); + String::push(__local_209, 116); + String::push(__local_209, 32); + String::push_str(__local_209, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_209, 58); __local_210 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_209 }; i32::fmt_decimal(265, __local_210); - String::append(__local_209, String { repr: array.new_data(" + String::push_str(__local_209, String { repr: array.new_data(" condition: `{backslash:?}` == \"'\\\\\\\\'\" "), used: 40 }); break __tmpl: __local_209; @@ -5154,17 +5154,17 @@ condition: `{backslash:?}` == \"'\\\\\\\\'\" if __cond_53 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_213 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_213, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_213, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_213, 32); - String::append_char(__local_213, 97); - String::append_char(__local_213, 116); - String::append_char(__local_213, 32); - String::append(__local_213, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_213, 58); + String::push_str(__local_213, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_213, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_213, 32); + String::push(__local_213, 97); + String::push(__local_213, 116); + String::push(__local_213, 32); + String::push_str(__local_213, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_213, 58); __local_214 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_213 }; i32::fmt_decimal(267, __local_214); - String::append(__local_213, String { repr: array.new_data(" + String::push_str(__local_213, String { repr: array.new_data(" condition: `{z:?}` == \"'Z'\" "), used: 29 }); break __tmpl: __local_213; @@ -5176,17 +5176,17 @@ condition: `{z:?}` == \"'Z'\" if __cond_55 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_215 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_215, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_215, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_215, 32); - String::append_char(__local_215, 97); - String::append_char(__local_215, 116); - String::append_char(__local_215, 32); - String::append(__local_215, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_215, 58); + String::push_str(__local_215, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_215, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_215, 32); + String::push(__local_215, 97); + String::push(__local_215, 116); + String::push(__local_215, 32); + String::push_str(__local_215, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_215, 58); __local_216 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_215 }; i32::fmt_decimal(269, __local_216); - String::append(__local_215, String { repr: array.new_data(" + String::push_str(__local_215, String { repr: array.new_data(" condition: `{s}` == \"hello\" "), used: 29 }); break __tmpl: __local_215; @@ -5202,17 +5202,17 @@ condition: `{s}` == \"hello\" if __cond_56 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_219 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_219, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_219, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_219, 32); - String::append_char(__local_219, 97); - String::append_char(__local_219, 116); - String::append_char(__local_219, 32); - String::append(__local_219, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_219, 58); + String::push_str(__local_219, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_219, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_219, 32); + String::push(__local_219, 97); + String::push(__local_219, 116); + String::push(__local_219, 32); + String::push_str(__local_219, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_219, 58); __local_220 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_219 }; i32::fmt_decimal(270, __local_220); - String::append(__local_219, String { repr: array.new_data(" + String::push_str(__local_219, String { repr: array.new_data(" condition: `{s:?}` == \"\\\"hello\\\"\" "), used: 35 }); break __tmpl: __local_219; @@ -5224,17 +5224,17 @@ condition: `{s:?}` == \"\\\"hello\\\"\" if __cond_58 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_221 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_221, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_221, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_221, 32); - String::append_char(__local_221, 97); - String::append_char(__local_221, 116); - String::append_char(__local_221, 32); - String::append(__local_221, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_221, 58); + String::push_str(__local_221, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_221, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_221, 32); + String::push(__local_221, 97); + String::push(__local_221, 116); + String::push(__local_221, 32); + String::push_str(__local_221, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_221, 58); __local_222 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_221 }; i32::fmt_decimal(272, __local_222); - String::append(__local_221, String { repr: array.new_data(" + String::push_str(__local_221, String { repr: array.new_data(" condition: `{empty}` == \"\" "), used: 28 }); break __tmpl: __local_221; @@ -5250,17 +5250,17 @@ condition: `{empty}` == \"\" if __cond_59 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_225 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_225, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_225, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_225, 32); - String::append_char(__local_225, 97); - String::append_char(__local_225, 116); - String::append_char(__local_225, 32); - String::append(__local_225, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_225, 58); + String::push_str(__local_225, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_225, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_225, 32); + String::push(__local_225, 97); + String::push(__local_225, 116); + String::push(__local_225, 32); + String::push_str(__local_225, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_225, 58); __local_226 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_225 }; i32::fmt_decimal(273, __local_226); - String::append(__local_225, String { repr: array.new_data(" + String::push_str(__local_225, String { repr: array.new_data(" condition: `{empty:?}` == \"\\\"\\\"\" "), used: 34 }); break __tmpl: __local_225; @@ -5277,17 +5277,17 @@ condition: `{empty:?}` == \"\\\"\\\"\" if __cond_61 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_229 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_229, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_229, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_229, 32); - String::append_char(__local_229, 97); - String::append_char(__local_229, 116); - String::append_char(__local_229, 32); - String::append(__local_229, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_229, 58); + String::push_str(__local_229, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_229, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_229, 32); + String::push(__local_229, 97); + String::push(__local_229, 116); + String::push(__local_229, 32); + String::push_str(__local_229, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_229, 58); __local_230 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_229 }; i32::fmt_decimal(275, __local_230); - String::append(__local_229, String { repr: array.new_data(" + String::push_str(__local_229, String { repr: array.new_data(" condition: `{with_quote:?}` == \"\\\"say \\\\\\\"hi\\\\\\\"\\\"\" "), used: 53 }); break __tmpl: __local_229; @@ -5305,17 +5305,17 @@ line2"), used: 11 }; if __cond_63 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_233 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_233, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_233, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_233, 32); - String::append_char(__local_233, 97); - String::append_char(__local_233, 116); - String::append_char(__local_233, 32); - String::append(__local_233, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_233, 58); + String::push_str(__local_233, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_233, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_233, 32); + String::push(__local_233, 97); + String::push(__local_233, 116); + String::push(__local_233, 32); + String::push_str(__local_233, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_233, 58); __local_234 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_233 }; i32::fmt_decimal(277, __local_234); - String::append(__local_233, String { repr: array.new_data(" + String::push_str(__local_233, String { repr: array.new_data(" condition: `{with_newline:?}` == \"\\\"line1\\\\nline2\\\"\" "), used: 54 }); break __tmpl: __local_233; @@ -5332,17 +5332,17 @@ condition: `{with_newline:?}` == \"\\\"line1\\\\nline2\\\"\" if __cond_65 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_237 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_237, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_237, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_237, 32); - String::append_char(__local_237, 97); - String::append_char(__local_237, 116); - String::append_char(__local_237, 32); - String::append(__local_237, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_237, 58); + String::push_str(__local_237, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_237, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_237, 32); + String::push(__local_237, 97); + String::push(__local_237, 116); + String::push(__local_237, 32); + String::push_str(__local_237, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_237, 58); __local_238 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_237 }; i32::fmt_decimal(279, __local_238); - String::append(__local_237, String { repr: array.new_data(" + String::push_str(__local_237, String { repr: array.new_data(" condition: `{some_i32:?}` == \"Option::Some(42)\" "), used: 49 }); break __tmpl: __local_237; @@ -5358,17 +5358,17 @@ condition: `{some_i32:?}` == \"Option::Some(42)\" if __cond_66 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_241 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_241, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_241, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_241, 32); - String::append_char(__local_241, 97); - String::append_char(__local_241, 116); - String::append_char(__local_241, 32); - String::append(__local_241, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_241, 58); + String::push_str(__local_241, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_241, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_241, 32); + String::push(__local_241, 97); + String::push(__local_241, 116); + String::push(__local_241, 32); + String::push_str(__local_241, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_241, 58); __local_242 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_241 }; i32::fmt_decimal(280, __local_242); - String::append(__local_241, String { repr: array.new_data(" + String::push_str(__local_241, String { repr: array.new_data(" condition: `{some_i32}` == \"Option::Some(42)\" "), used: 47 }); break __tmpl: __local_241; @@ -5385,17 +5385,17 @@ condition: `{some_i32}` == \"Option::Some(42)\" if __cond_68 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_245 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_245, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_245, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_245, 32); - String::append_char(__local_245, 97); - String::append_char(__local_245, 116); - String::append_char(__local_245, 32); - String::append(__local_245, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_245, 58); + String::push_str(__local_245, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_245, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_245, 32); + String::push(__local_245, 97); + String::push(__local_245, 116); + String::push(__local_245, 32); + String::push_str(__local_245, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_245, 58); __local_246 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_245 }; i32::fmt_decimal(282, __local_246); - String::append(__local_245, String { repr: array.new_data(" + String::push_str(__local_245, String { repr: array.new_data(" condition: `{none_i32:?}` == \"Option::None\" "), used: 45 }); break __tmpl: __local_245; @@ -5412,17 +5412,17 @@ condition: `{none_i32:?}` == \"Option::None\" if __cond_69 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_249 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_249, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_249, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_249, 32); - String::append_char(__local_249, 97); - String::append_char(__local_249, 116); - String::append_char(__local_249, 32); - String::append(__local_249, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_249, 58); + String::push_str(__local_249, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_249, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_249, 32); + String::push(__local_249, 97); + String::push(__local_249, 116); + String::push(__local_249, 32); + String::push_str(__local_249, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_249, 58); __local_250 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_249 }; i32::fmt_decimal(283, __local_250); - String::append(__local_249, String { repr: array.new_data(" + String::push_str(__local_249, String { repr: array.new_data(" condition: `{none_i32}` == \"Option::None\" "), used: 43 }); break __tmpl: __local_249; @@ -5439,17 +5439,17 @@ condition: `{none_i32}` == \"Option::None\" if __cond_71 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_253 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_253, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_253, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_253, 32); - String::append_char(__local_253, 97); - String::append_char(__local_253, 116); - String::append_char(__local_253, 32); - String::append(__local_253, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_253, 58); + String::push_str(__local_253, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_253, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_253, 32); + String::push(__local_253, 97); + String::push(__local_253, 116); + String::push(__local_253, 32); + String::push_str(__local_253, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_253, 58); __local_254 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_253 }; i32::fmt_decimal(285, __local_254); - String::append(__local_253, String { repr: array.new_data(" + String::push_str(__local_253, String { repr: array.new_data(" condition: `{some_str:?}` == \"Option::Some(\\\"world\\\")\" "), used: 56 }); break __tmpl: __local_253; @@ -5466,17 +5466,17 @@ condition: `{some_str:?}` == \"Option::Some(\\\"world\\\")\" if __cond_73 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_257 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_257, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_257, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_257, 32); - String::append_char(__local_257, 97); - String::append_char(__local_257, 116); - String::append_char(__local_257, 32); - String::append(__local_257, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_257, 58); + String::push_str(__local_257, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_257, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_257, 32); + String::push(__local_257, 97); + String::push(__local_257, 116); + String::push(__local_257, 32); + String::push_str(__local_257, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_257, 58); __local_258 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_257 }; i32::fmt_decimal(287, __local_258); - String::append(__local_257, String { repr: array.new_data(" + String::push_str(__local_257, String { repr: array.new_data(" condition: `{some_some:?}` == \"Option::Some(Option::Some(7))\" "), used: 63 }); break __tmpl: __local_257; @@ -5493,17 +5493,17 @@ condition: `{some_some:?}` == \"Option::Some(Option::Some(7))\" if __cond_75 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_261 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_261, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_261, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_261, 32); - String::append_char(__local_261, 97); - String::append_char(__local_261, 116); - String::append_char(__local_261, 32); - String::append(__local_261, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_261, 58); + String::push_str(__local_261, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_261, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_261, 32); + String::push(__local_261, 97); + String::push(__local_261, 116); + String::push(__local_261, 32); + String::push_str(__local_261, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_261, 58); __local_262 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_261 }; i32::fmt_decimal(289, __local_262); - String::append(__local_261, String { repr: array.new_data(" + String::push_str(__local_261, String { repr: array.new_data(" condition: `{some_none:?}` == \"Option::Some(Option::None)\" "), used: 60 }); break __tmpl: __local_261; @@ -5520,17 +5520,17 @@ condition: `{some_none:?}` == \"Option::Some(Option::None)\" if __cond_77 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_265 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_265, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_265, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_265, 32); - String::append_char(__local_265, 97); - String::append_char(__local_265, 116); - String::append_char(__local_265, 32); - String::append(__local_265, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_265, 58); + String::push_str(__local_265, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_265, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_265, 32); + String::push(__local_265, 97); + String::push(__local_265, 116); + String::push(__local_265, 32); + String::push_str(__local_265, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_265, 58); __local_266 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_265 }; i32::fmt_decimal(291, __local_266); - String::append(__local_265, String { repr: array.new_data(" + String::push_str(__local_265, String { repr: array.new_data(" condition: `{ok_val:?}` == \"Result::Ok(42)\" "), used: 45 }); break __tmpl: __local_265; @@ -5546,17 +5546,17 @@ condition: `{ok_val:?}` == \"Result::Ok(42)\" if __cond_78 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_269 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_269, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_269, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_269, 32); - String::append_char(__local_269, 97); - String::append_char(__local_269, 116); - String::append_char(__local_269, 32); - String::append(__local_269, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_269, 58); + String::push_str(__local_269, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_269, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_269, 32); + String::push(__local_269, 97); + String::push(__local_269, 116); + String::push(__local_269, 32); + String::push_str(__local_269, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_269, 58); __local_270 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_269 }; i32::fmt_decimal(292, __local_270); - String::append(__local_269, String { repr: array.new_data(" + String::push_str(__local_269, String { repr: array.new_data(" condition: `{ok_val}` == \"Result::Ok(42)\" "), used: 43 }); break __tmpl: __local_269; @@ -5573,17 +5573,17 @@ condition: `{ok_val}` == \"Result::Ok(42)\" if __cond_80 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_273 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_273, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_273, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_273, 32); - String::append_char(__local_273, 97); - String::append_char(__local_273, 116); - String::append_char(__local_273, 32); - String::append(__local_273, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_273, 58); + String::push_str(__local_273, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_273, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_273, 32); + String::push(__local_273, 97); + String::push(__local_273, 116); + String::push(__local_273, 32); + String::push_str(__local_273, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_273, 58); __local_274 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_273 }; i32::fmt_decimal(294, __local_274); - String::append(__local_273, String { repr: array.new_data(" + String::push_str(__local_273, String { repr: array.new_data(" condition: `{err_val:?}` == \"Result::Err(\\\"fail\\\")\" "), used: 53 }); break __tmpl: __local_273; @@ -5600,17 +5600,17 @@ condition: `{err_val:?}` == \"Result::Err(\\\"fail\\\")\" if __cond_82 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_277 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_277, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_277, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_277, 32); - String::append_char(__local_277, 97); - String::append_char(__local_277, 116); - String::append_char(__local_277, 32); - String::append(__local_277, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_277, 58); + String::push_str(__local_277, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_277, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_277, 32); + String::push(__local_277, 97); + String::push(__local_277, 116); + String::push(__local_277, 32); + String::push_str(__local_277, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_277, 58); __local_278 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_277 }; i32::fmt_decimal(296, __local_278); - String::append(__local_277, String { repr: array.new_data(" + String::push_str(__local_277, String { repr: array.new_data(" condition: `{err_int:?}` == \"Result::Err(-1)\" "), used: 47 }); break __tmpl: __local_277; @@ -5626,17 +5626,17 @@ condition: `{err_int:?}` == \"Result::Err(-1)\" if __cond_84 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_281 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_281, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_281, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_281, 32); - String::append_char(__local_281, 97); - String::append_char(__local_281, 116); - String::append_char(__local_281, 32); - String::append(__local_281, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_281, 58); + String::push_str(__local_281, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_281, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_281, 32); + String::push(__local_281, 97); + String::push(__local_281, 116); + String::push(__local_281, 32); + String::push_str(__local_281, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_281, 58); __local_282 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_281 }; i32::fmt_decimal(298, __local_282); - String::append(__local_281, String { repr: array.new_data(" + String::push_str(__local_281, String { repr: array.new_data(" condition: `{x:10?}` == \" 42\" "), used: 38 }); break __tmpl: __local_281; @@ -5652,17 +5652,17 @@ condition: `{x:10?}` == \" 42\" if __cond_85 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_285 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_285, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_285, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_285, 32); - String::append_char(__local_285, 97); - String::append_char(__local_285, 116); - String::append_char(__local_285, 32); - String::append(__local_285, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_285, 58); + String::push_str(__local_285, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_285, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_285, 32); + String::push(__local_285, 97); + String::push(__local_285, 116); + String::push(__local_285, 32); + String::push_str(__local_285, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_285, 58); __local_286 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_285 }; i32::fmt_decimal(299, __local_286); - String::append(__local_285, String { repr: array.new_data(" + String::push_str(__local_285, String { repr: array.new_data(" condition: `{x:<10?}` == \"42 \" "), used: 39 }); break __tmpl: __local_285; @@ -5678,17 +5678,17 @@ condition: `{x:<10?}` == \"42 \" if __cond_86 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_289 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_289, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_289, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_289, 32); - String::append_char(__local_289, 97); - String::append_char(__local_289, 116); - String::append_char(__local_289, 32); - String::append(__local_289, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_289, 58); + String::push_str(__local_289, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_289, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_289, 32); + String::push(__local_289, 97); + String::push(__local_289, 116); + String::push(__local_289, 32); + String::push_str(__local_289, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_289, 58); __local_290 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_289 }; i32::fmt_decimal(300, __local_290); - String::append(__local_289, String { repr: array.new_data(" + String::push_str(__local_289, String { repr: array.new_data(" condition: `{x:^10?}` == \" 42 \" "), used: 39 }); break __tmpl: __local_289; @@ -5704,17 +5704,17 @@ condition: `{x:^10?}` == \" 42 \" if __cond_87 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_293 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_293, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_293, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_293, 32); - String::append_char(__local_293, 97); - String::append_char(__local_293, 116); - String::append_char(__local_293, 32); - String::append(__local_293, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_293, 58); + String::push_str(__local_293, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_293, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_293, 32); + String::push(__local_293, 97); + String::push(__local_293, 116); + String::push(__local_293, 32); + String::push_str(__local_293, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_293, 58); __local_294 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_293 }; i32::fmt_decimal(301, __local_294); - String::append(__local_293, String { repr: array.new_data(" + String::push_str(__local_293, String { repr: array.new_data(" condition: `{x:*^10?}` == \"****42****\" "), used: 40 }); break __tmpl: __local_293; @@ -5731,17 +5731,17 @@ condition: `{x:*^10?}` == \"****42****\" if __cond_89 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_297 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_297, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_297, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_297, 32); - String::append_char(__local_297, 97); - String::append_char(__local_297, 116); - String::append_char(__local_297, 32); - String::append(__local_297, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_297, 58); + String::push_str(__local_297, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_297, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_297, 32); + String::push(__local_297, 97); + String::push(__local_297, 116); + String::push(__local_297, 32); + String::push_str(__local_297, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_297, 58); __local_298 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_297 }; i32::fmt_decimal(303, __local_298); - String::append(__local_297, String { repr: array.new_data(" + String::push_str(__local_297, String { repr: array.new_data(" condition: `{i128_pos:10?}` == \" 42\" "), used: 45 }); break __tmpl: __local_297; @@ -5757,17 +5757,17 @@ condition: `{i128_pos:10?}` == \" 42\" if __cond_90 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_301 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_301, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_301, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_301, 32); - String::append_char(__local_301, 97); - String::append_char(__local_301, 116); - String::append_char(__local_301, 32); - String::append(__local_301, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_301, 58); + String::push_str(__local_301, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_301, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_301, 32); + String::push(__local_301, 97); + String::push(__local_301, 116); + String::push(__local_301, 32); + String::push_str(__local_301, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_301, 58); __local_302 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_301 }; i32::fmt_decimal(304, __local_302); - String::append(__local_301, String { repr: array.new_data(" + String::push_str(__local_301, String { repr: array.new_data(" condition: `{i128_pos:<10?}` == \"42 \" "), used: 46 }); break __tmpl: __local_301; @@ -5785,17 +5785,17 @@ condition: `{i128_pos:<10?}` == \"42 \" if __cond_91 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_305 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_305, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_305, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_305, 32); - String::append_char(__local_305, 97); - String::append_char(__local_305, 116); - String::append_char(__local_305, 32); - String::append(__local_305, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_305, 58); + String::push_str(__local_305, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_305, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_305, 32); + String::push(__local_305, 97); + String::push(__local_305, 116); + String::push(__local_305, 32); + String::push_str(__local_305, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_305, 58); __local_306 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_305 }; i32::fmt_decimal(305, __local_306); - String::append(__local_305, String { repr: array.new_data(" + String::push_str(__local_305, String { repr: array.new_data(" condition: `{true:10?}` == \" true\" "), used: 41 }); break __tmpl: __local_305; @@ -5813,17 +5813,17 @@ condition: `{true:10?}` == \" true\" if __cond_92 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_309 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_309, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_309, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); - String::append_char(__local_309, 32); - String::append_char(__local_309, 97); - String::append_char(__local_309, 116); - String::append_char(__local_309, 32); - String::append(__local_309, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); - String::append_char(__local_309, 58); + String::push_str(__local_309, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_309, String { repr: array.new_data("test_template_specifiers_inspect"), used: 32 }); + String::push(__local_309, 32); + String::push(__local_309, 97); + String::push(__local_309, 116); + String::push(__local_309, 32); + String::push_str(__local_309, String { repr: array.new_data("wado-compiler/tests/fixtures/display_1.wado"), used: 43 }); + String::push(__local_309, 58); __local_310 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_309 }; i32::fmt_decimal(306, __local_310); - String::append(__local_309, String { repr: array.new_data(" + String::push_str(__local_309, String { repr: array.new_data(" condition: `{false:<10?}` == \"false \" "), used: 43 }); break __tmpl: __local_309; @@ -6753,8 +6753,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -6809,13 +6809,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -6823,25 +6823,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -6849,7 +6849,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -6891,8 +6891,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -6924,7 +6924,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -7053,27 +7053,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -7895,9 +7895,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -7966,9 +7966,9 @@ fn f32::inspect_into(self, f) { break __inline_String__len_6: __local_23.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -7978,8 +7978,8 @@ fn f32::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -8045,9 +8045,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -8114,9 +8114,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -8126,8 +8126,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -8182,13 +8182,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -8223,9 +8223,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -8236,37 +8236,37 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } fn char^Inspect::inspect(self, f) { let c: char; - String::append_char(f.buf, 39); + String::push(f.buf, 39); c = self; if c == 39 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 39); + String::push(f.buf, 92); + String::push(f.buf, 39); } else if c == 92 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 92); + String::push(f.buf, 92); + String::push(f.buf, 92); } else if c == 10 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 110); + String::push(f.buf, 92); + String::push(f.buf, 110); } else if c == 13 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 114); + String::push(f.buf, 92); + String::push(f.buf, 114); } else if c == 9 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 116); + String::push(f.buf, 92); + String::push(f.buf, 116); } else { - String::append_char(f.buf, c); + String::push(f.buf, c); }; - String::append_char(f.buf, 39); + String::push(f.buf, 39); } fn String::grow(self, min_capacity) { @@ -8316,7 +8316,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -8404,7 +8404,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -8439,24 +8439,24 @@ fn DisplayPoint^Display::fmt(self, f) { let s_16: ref String; let __local_18: ref String; let __local_19: ref Formatter; - String::append_char(f.buf, 40); + String::push(f.buf, 40); s_5 = __inline_i32__to_string_2: block -> ref String { __local_7 = String { repr: builtin::array_new(12), used: 0 }; __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(self.x, __local_8); break __inline_i32__to_string_2: __local_7; }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); s_14 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_14); + String::push_str(f.buf, s_14); s_16 = __inline_i32__to_string_8: block -> ref String { __local_18 = String { repr: builtin::array_new(12), used: 0 }; __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(self.y, __local_19); break __inline_i32__to_string_8: __local_18; }; - String::append(f.buf, s_16); - String::append_char(f.buf, 41); + String::push_str(f.buf, s_16); + String::push(f.buf, 41); } fn Result^Inspect::inspect(self, f) { @@ -8466,16 +8466,16 @@ fn Result^Inspect::inspect(self, f) { let __local_13: ref String; if ref.test Result::Ok(self) { __local_3 = String { repr: array.new_data("Result::Ok("), used: 11 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); String^Inspect::inspect(ref.cast Result::Ok(self).payload_0, f); __local_5 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if ref.test Result::Err(self) { __local_7 = String { repr: array.new_data("Result::Err("), used: 12 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); i32::fmt_decimal(ref.cast Result::Err(self).payload_0, f); __local_13 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_13); + String::push_str(f.buf, __local_13); }; } @@ -8486,16 +8486,16 @@ fn Result^Inspect::inspect(self, f) { let __local_13: ref String; if ref.test Result::Ok(self) { __local_3 = String { repr: array.new_data("Result::Ok("), used: 11 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); i32::fmt_decimal(ref.cast Result::Ok(self).payload_0, f); __local_9 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); } else if ref.test Result::Err(self) { __local_11 = String { repr: array.new_data("Result::Err("), used: 12 }; - String::append(f.buf, __local_11); + String::push_str(f.buf, __local_11); String^Inspect::inspect(ref.cast Result::Err(self).payload_0, f); __local_13 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_13); + String::push_str(f.buf, __local_13); }; } @@ -8505,13 +8505,13 @@ fn Option>^Inspect::inspect(self, f) { let __local_7: ref String; if ref.is_null(self) == 0 { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); Option^Inspect::inspect(ref.as_non_null(self), f); __local_5 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if ref.is_null(self) { __local_7 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -8521,13 +8521,13 @@ fn Option^Inspect::inspect(self, f) { let __local_7: ref String; if ref.is_null(self) == 0 { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); String^Inspect::inspect(ref.as_non_null(self), f); __local_5 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if ref.is_null(self) { __local_7 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -8537,13 +8537,13 @@ fn Option^Inspect::inspect(self, f) { let __local_11: ref String; if ref.test Option::Some(self) { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); i32::fmt_decimal(ref.cast Option::Some(self).payload_0, f); __local_9 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); } else if self.discriminant == 1 { __local_11 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_11); + String::push_str(f.buf, __local_11); }; } @@ -8558,7 +8558,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l475; }; @@ -8578,7 +8578,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -8586,17 +8586,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -8750,20 +8750,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -8773,10 +8773,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -8786,10 +8786,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -8797,10 +8797,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -8812,7 +8812,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -8829,22 +8829,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b514; @@ -8852,7 +8852,7 @@ fn String^Inspect::inspect(self, f) { continue l515; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/display_2.wir.wado b/wado-compiler/tests/fixtures.golden/display_2.wir.wado index b1e190867..b71a69c42 100644 --- a/wado-compiler/tests/fixtures.golden/display_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/display_2.wir.wado @@ -137,7 +137,7 @@ type "functype/write_u64_base_digits" = fn(ref array, i32, i64, i32, i32, i3 type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -151,13 +151,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -320,24 +320,24 @@ fn test_format_base() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(208), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("test_format_base"), used: 16 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("test_format_base"), used: 16 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_29 = __local_15; i32::fmt_decimal(43, __local_29); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: fmt_with(&x, true, false, -1, Alignment::Right) == \"+42\" "), used: 69 }); - String::append(__local_14, String { repr: array.new_data("fmt_with(&x, true, false, -1, Alignment::Right): "), used: 49 }); + String::push_str(__local_14, String { repr: array.new_data("fmt_with(&x, true, false, -1, Alignment::Right): "), used: 49 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; String^Inspect::inspect(__v0_2, __local_15); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -347,24 +347,24 @@ condition: fmt_with(&x, true, false, -1, Alignment::Right) == \"+42\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(212), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("test_format_base"), used: 16 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("test_format_base"), used: 16 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_36 = __local_17; i32::fmt_decimal(44, __local_36); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: fmt_with(&neg, true, false, -1, Alignment::Right) == \"-42\" "), used: 71 }); - String::append(__local_16, String { repr: array.new_data("fmt_with(&neg, true, false, -1, Alignment::Right): "), used: 51 }); + String::push_str(__local_16, String { repr: array.new_data("fmt_with(&neg, true, false, -1, Alignment::Right): "), used: 51 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_4, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -374,24 +374,24 @@ condition: fmt_with(&neg, true, false, -1, Alignment::Right) == \"-42\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(209), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("test_format_base"), used: 16 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("test_format_base"), used: 16 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_43 = __local_19; i32::fmt_decimal(45, __local_43); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: fmt_with(&x, true, true, 8, Alignment::Right) == \"+0000042\" "), used: 72 }); - String::append(__local_18, String { repr: array.new_data("fmt_with(&x, true, true, 8, Alignment::Right): "), used: 47 }); + String::push_str(__local_18, String { repr: array.new_data("fmt_with(&x, true, true, 8, Alignment::Right): "), used: 47 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; String^Inspect::inspect(__v0_6, __local_19); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -401,24 +401,24 @@ condition: fmt_with(&x, true, true, 8, Alignment::Right) == \"+0000042\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(215), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("test_format_base"), used: 16 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("test_format_base"), used: 16 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_50 = __local_21; i32::fmt_decimal(46, __local_50); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: fmt_with(&neg, false, true, 8, Alignment::Right) == \"-0000042\" "), used: 75 }); - String::append(__local_20, String { repr: array.new_data("fmt_with(&neg, false, true, 8, Alignment::Right): "), used: 50 }); + String::push_str(__local_20, String { repr: array.new_data("fmt_with(&neg, false, true, 8, Alignment::Right): "), used: 50 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; String^Inspect::inspect(__v0_8, __local_21); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -428,24 +428,24 @@ condition: fmt_with(&neg, false, true, 8, Alignment::Right) == \"-0000042\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(215), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("test_format_base"), used: 16 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("test_format_base"), used: 16 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_57 = __local_23; i32::fmt_decimal(47, __local_57); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: fmt_with(&x, true, false, 10, Alignment::Right) == \" +42\" "), used: 76 }); - String::append(__local_22, String { repr: array.new_data("fmt_with(&x, true, false, 10, Alignment::Right): "), used: 49 }); + String::push_str(__local_22, String { repr: array.new_data("fmt_with(&x, true, false, 10, Alignment::Right): "), used: 49 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; String^Inspect::inspect(__v0_10, __local_23); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -455,24 +455,24 @@ condition: fmt_with(&x, true, false, 10, Alignment::Right) == \" +42\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(219), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("test_format_base"), used: 16 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("test_format_base"), used: 16 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_64 = __local_25; i32::fmt_decimal(48, __local_64); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: fmt_with(&neg, false, false, 10, Alignment::Left) == \"-42 \" "), used: 78 }); - String::append(__local_24, String { repr: array.new_data("fmt_with(&neg, false, false, 10, Alignment::Left): "), used: 51 }); + String::push_str(__local_24, String { repr: array.new_data("fmt_with(&neg, false, false, 10, Alignment::Left): "), used: 51 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; String^Inspect::inspect(__v0_12, __local_25); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -535,24 +535,24 @@ fn test_format_padding() with Stdout { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(225), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("test_format_padding"), used: 19 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("test_format_padding"), used: 19 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_44 = __local_24; i32::fmt_decimal(56, __local_44); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: fmt_int(&x, ' ', Alignment::Right, false, false, 10) == \" 42\" "), used: 81 }); - String::append(__local_23, String { repr: array.new_data("fmt_int(&x, ' ', Alignment::Right, false, false, 10): "), used: 54 }); + String::push_str(__local_23, String { repr: array.new_data("fmt_int(&x, ' ', Alignment::Right, false, false, 10): "), used: 54 }); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; String^Inspect::inspect(__v0_3, __local_24); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -562,24 +562,24 @@ condition: fmt_int(&x, ' ', Alignment::Right, false, false, 10) == \" 42\ if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(223), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("test_format_padding"), used: 19 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("test_format_padding"), used: 19 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_51 = __local_26; i32::fmt_decimal(57, __local_51); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: fmt_int(&x, ' ', Alignment::Left, false, false, 10) == \"42 \" "), used: 80 }); - String::append(__local_25, String { repr: array.new_data("fmt_int(&x, ' ', Alignment::Left, false, false, 10): "), used: 53 }); + String::push_str(__local_25, String { repr: array.new_data("fmt_int(&x, ' ', Alignment::Left, false, false, 10): "), used: 53 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; String^Inspect::inspect(__v0_5, __local_26); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -589,24 +589,24 @@ condition: fmt_int(&x, ' ', Alignment::Left, false, false, 10) == \"42 \" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(227), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("test_format_padding"), used: 19 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("test_format_padding"), used: 19 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_58 = __local_28; i32::fmt_decimal(58, __local_58); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: fmt_int(&x, ' ', Alignment::Center, false, false, 10) == \" 42 \" "), used: 82 }); - String::append(__local_27, String { repr: array.new_data("fmt_int(&x, ' ', Alignment::Center, false, false, 10): "), used: 55 }); + String::push_str(__local_27, String { repr: array.new_data("fmt_int(&x, ' ', Alignment::Center, false, false, 10): "), used: 55 }); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; String^Inspect::inspect(__v0_7, __local_28); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -616,24 +616,24 @@ condition: fmt_int(&x, ' ', Alignment::Center, false, false, 10) == \" 42 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(219), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_29, String { repr: array.new_data("test_format_padding"), used: 19 }); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_29, String { repr: array.new_data("test_format_padding"), used: 19 }); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_65 = __local_30; i32::fmt_decimal(59, __local_65); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: fmt_int(&x, '0', Alignment::Right, false, true, 8) == \"00000042\" "), used: 77 }); - String::append(__local_29, String { repr: array.new_data("fmt_int(&x, '0', Alignment::Right, false, true, 8): "), used: 52 }); + String::push_str(__local_29, String { repr: array.new_data("fmt_int(&x, '0', Alignment::Right, false, true, 8): "), used: 52 }); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; String^Inspect::inspect(__v0_9, __local_30); - String::append_char(__local_29, 10); + String::push(__local_29, 10); break __tmpl: __local_29; }); unreachable; @@ -643,24 +643,24 @@ condition: fmt_int(&x, '0', Alignment::Right, false, true, 8) == \"00000042\" if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(223), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_31, String { repr: array.new_data("test_format_padding"), used: 19 }); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_31, String { repr: array.new_data("test_format_padding"), used: 19 }); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_72 = __local_32; i32::fmt_decimal(60, __local_72); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: fmt_int(&neg, '0', Alignment::Right, false, true, 8) == \"-0000042\" "), used: 79 }); - String::append(__local_31, String { repr: array.new_data("fmt_int(&neg, '0', Alignment::Right, false, true, 8): "), used: 54 }); + String::push_str(__local_31, String { repr: array.new_data("fmt_int(&neg, '0', Alignment::Right, false, true, 8): "), used: 54 }); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; String^Inspect::inspect(__v0_11, __local_32); - String::append_char(__local_31, 10); + String::push(__local_31, 10); break __tmpl: __local_31; }); unreachable; @@ -670,24 +670,24 @@ condition: fmt_int(&neg, '0', Alignment::Right, false, true, 8) == \"-0000042\" if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(216), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_33, String { repr: array.new_data("test_format_padding"), used: 19 }); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_33, String { repr: array.new_data("test_format_padding"), used: 19 }); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_79 = __local_34; i32::fmt_decimal(61, __local_79); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: fmt_int(&x, ' ', Alignment::Right, true, false, -1) == \"+42\" "), used: 73 }); - String::append(__local_33, String { repr: array.new_data("fmt_int(&x, ' ', Alignment::Right, true, false, -1): "), used: 53 }); + String::push_str(__local_33, String { repr: array.new_data("fmt_int(&x, ' ', Alignment::Right, true, false, -1): "), used: 53 }); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; String^Inspect::inspect(__v0_13, __local_34); - String::append_char(__local_33, 10); + String::push(__local_33, 10); break __tmpl: __local_33; }); unreachable; @@ -697,24 +697,24 @@ condition: fmt_int(&x, ' ', Alignment::Right, true, false, -1) == \"+42\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_35 = String { repr: builtin::array_new(227), used: 0 }; - String::append(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_35, String { repr: array.new_data("test_format_padding"), used: 19 }); - String::append_char(__local_35, 32); - String::append_char(__local_35, 97); - String::append_char(__local_35, 116); - String::append_char(__local_35, 32); - String::append(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_35, 58); + String::push_str(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_35, String { repr: array.new_data("test_format_padding"), used: 19 }); + String::push(__local_35, 32); + String::push(__local_35, 97); + String::push(__local_35, 116); + String::push(__local_35, 32); + String::push_str(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_35, 58); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_86 = __local_36; i32::fmt_decimal(62, __local_86); - String::append(__local_35, String { repr: array.new_data(" + String::push_str(__local_35, String { repr: array.new_data(" condition: fmt_int(&x, '*', Alignment::Center, false, false, 10) == \"****42****\" "), used: 82 }); - String::append(__local_35, String { repr: array.new_data("fmt_int(&x, '*', Alignment::Center, false, false, 10): "), used: 55 }); + String::push_str(__local_35, String { repr: array.new_data("fmt_int(&x, '*', Alignment::Center, false, false, 10): "), used: 55 }); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; String^Inspect::inspect(__v0_15, __local_36); - String::append_char(__local_35, 10); + String::push(__local_35, 10); break __tmpl: __local_35; }); unreachable; @@ -727,28 +727,28 @@ condition: fmt_int(&x, '*', Alignment::Center, false, false, 10) == \"****42**** if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_37 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_37, String { repr: array.new_data("test_format_padding"), used: 19 }); - String::append_char(__local_37, 32); - String::append_char(__local_37, 97); - String::append_char(__local_37, 116); - String::append_char(__local_37, 32); - String::append(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_37, 58); + String::push_str(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_37, String { repr: array.new_data("test_format_padding"), used: 19 }); + String::push(__local_37, 32); + String::push(__local_37, 97); + String::push(__local_37, 116); + String::push(__local_37, 32); + String::push_str(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_37, 58); __local_38 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_37 }; __local_98 = __local_38; i32::fmt_decimal(75, __local_98); - String::append(__local_37, String { repr: array.new_data(" + String::push_str(__local_37, String { repr: array.new_data(" condition: buf == \"true \" "), used: 30 }); - String::append_char(__local_37, 98); - String::append_char(__local_37, 117); - String::append_char(__local_37, 102); - String::append_char(__local_37, 58); - String::append_char(__local_37, 32); + String::push(__local_37, 98); + String::push(__local_37, 117); + String::push(__local_37, 102); + String::push(__local_37, 58); + String::push(__local_37, 32); __local_38 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_37 }; String^Inspect::inspect(__v0_19, __local_38); - String::append_char(__local_37, 10); + String::push(__local_37, 10); break __tmpl: __local_37; }); unreachable; @@ -758,24 +758,24 @@ condition: buf == \"true \" if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_39 = String { repr: builtin::array_new(222), used: 0 }; - String::append(__local_39, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_39, String { repr: array.new_data("test_format_padding"), used: 19 }); - String::append_char(__local_39, 32); - String::append_char(__local_39, 97); - String::append_char(__local_39, 116); - String::append_char(__local_39, 32); - String::append(__local_39, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_39, 58); + String::push_str(__local_39, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_39, String { repr: array.new_data("test_format_padding"), used: 19 }); + String::push(__local_39, 32); + String::push(__local_39, 97); + String::push(__local_39, 116); + String::push(__local_39, 32); + String::push_str(__local_39, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_39, 58); __local_40 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_39 }; __local_105 = __local_40; i32::fmt_decimal(76, __local_105); - String::append(__local_39, String { repr: array.new_data(" + String::push_str(__local_39, String { repr: array.new_data(" condition: fmt_int(&big, ' ', Alignment::Right, false, false, 2) == \"12345\" "), used: 77 }); - String::append(__local_39, String { repr: array.new_data("fmt_int(&big, ' ', Alignment::Right, false, false, 2): "), used: 55 }); + String::push_str(__local_39, String { repr: array.new_data("fmt_int(&big, ' ', Alignment::Right, false, false, 2): "), used: 55 }); __local_40 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_39 }; String^Inspect::inspect(__v0_21, __local_40); - String::append_char(__local_39, 10); + String::push(__local_39, 10); break __tmpl: __local_39; }); unreachable; @@ -1110,17 +1110,17 @@ fn test_template_specifiers() with Stdout { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_80 = String { repr: builtin::array_new(99), used: 0 }; - String::append(__local_80, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_80, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_80, 32); - String::append_char(__local_80, 97); - String::append_char(__local_80, 116); - String::append_char(__local_80, 32); - String::append(__local_80, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_80, 58); + String::push_str(__local_80, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_80, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_80, 32); + String::push(__local_80, 97); + String::push(__local_80, 116); + String::push(__local_80, 32); + String::push_str(__local_80, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_80, 58); __local_81 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_80 }; i32::fmt_decimal(82, __local_81); - String::append(__local_80, String { repr: array.new_data(" + String::push_str(__local_80, String { repr: array.new_data(" condition: `{i}` == \"42\" "), used: 26 }); break __tmpl: __local_80; @@ -1136,17 +1136,17 @@ condition: `{i}` == \"42\" if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_84 = String { repr: builtin::array_new(100), used: 0 }; - String::append(__local_84, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_84, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_84, 32); - String::append_char(__local_84, 97); - String::append_char(__local_84, 116); - String::append_char(__local_84, 32); - String::append(__local_84, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_84, 58); + String::push_str(__local_84, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_84, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_84, 32); + String::push(__local_84, 97); + String::push(__local_84, 116); + String::push(__local_84, 32); + String::push_str(__local_84, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_84, 58); __local_85 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_84 }; i32::fmt_decimal(83, __local_85); - String::append(__local_84, String { repr: array.new_data(" + String::push_str(__local_84, String { repr: array.new_data(" condition: `{-1}` == \"-1\" "), used: 27 }); break __tmpl: __local_84; @@ -1158,17 +1158,17 @@ condition: `{-1}` == \"-1\" if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_86 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_86, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_86, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_86, 32); - String::append_char(__local_86, 97); - String::append_char(__local_86, 116); - String::append_char(__local_86, 32); - String::append(__local_86, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_86, 58); + String::push_str(__local_86, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_86, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_86, 32); + String::push(__local_86, 97); + String::push(__local_86, 116); + String::push(__local_86, 32); + String::push_str(__local_86, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_86, 58); __local_87 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_86 }; i32::fmt_decimal(85, __local_87); - String::append(__local_86, String { repr: array.new_data(" + String::push_str(__local_86, String { repr: array.new_data(" condition: `{s}` == \"hello\" "), used: 29 }); break __tmpl: __local_86; @@ -1184,17 +1184,17 @@ condition: `{s}` == \"hello\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_90 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_90, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_90, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_90, 32); - String::append_char(__local_90, 97); - String::append_char(__local_90, 116); - String::append_char(__local_90, 32); - String::append(__local_90, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_90, 58); + String::push_str(__local_90, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_90, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_90, 32); + String::push(__local_90, 97); + String::push(__local_90, 116); + String::push(__local_90, 32); + String::push_str(__local_90, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_90, 58); __local_91 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_90 }; i32::fmt_decimal(86, __local_91); - String::append(__local_90, String { repr: array.new_data(" + String::push_str(__local_90, String { repr: array.new_data(" condition: `{i:10}` == \" 42\" "), used: 37 }); break __tmpl: __local_90; @@ -1210,17 +1210,17 @@ condition: `{i:10}` == \" 42\" if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_94 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_94, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_94, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_94, 32); - String::append_char(__local_94, 97); - String::append_char(__local_94, 116); - String::append_char(__local_94, 32); - String::append(__local_94, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_94, 58); + String::push_str(__local_94, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_94, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_94, 32); + String::push(__local_94, 97); + String::push(__local_94, 116); + String::push(__local_94, 32); + String::push_str(__local_94, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_94, 58); __local_95 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_94 }; i32::fmt_decimal(87, __local_95); - String::append(__local_94, String { repr: array.new_data(" + String::push_str(__local_94, String { repr: array.new_data(" condition: `{i:<10}` == \"42 \" "), used: 38 }); break __tmpl: __local_94; @@ -1236,17 +1236,17 @@ condition: `{i:<10}` == \"42 \" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_98 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_98, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_98, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_98, 32); - String::append_char(__local_98, 97); - String::append_char(__local_98, 116); - String::append_char(__local_98, 32); - String::append(__local_98, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_98, 58); + String::push_str(__local_98, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_98, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_98, 32); + String::push(__local_98, 97); + String::push(__local_98, 116); + String::push(__local_98, 32); + String::push_str(__local_98, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_98, 58); __local_99 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_98 }; i32::fmt_decimal(88, __local_99); - String::append(__local_98, String { repr: array.new_data(" + String::push_str(__local_98, String { repr: array.new_data(" condition: `{i:^10}` == \" 42 \" "), used: 38 }); break __tmpl: __local_98; @@ -1262,17 +1262,17 @@ condition: `{i:^10}` == \" 42 \" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_102 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_102, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_102, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_102, 32); - String::append_char(__local_102, 97); - String::append_char(__local_102, 116); - String::append_char(__local_102, 32); - String::append(__local_102, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_102, 58); + String::push_str(__local_102, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_102, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_102, 32); + String::push(__local_102, 97); + String::push(__local_102, 116); + String::push(__local_102, 32); + String::push_str(__local_102, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_102, 58); __local_103 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_102 }; i32::fmt_decimal(89, __local_103); - String::append(__local_102, String { repr: array.new_data(" + String::push_str(__local_102, String { repr: array.new_data(" condition: `{i:*^10}` == \"****42****\" "), used: 39 }); break __tmpl: __local_102; @@ -1288,17 +1288,17 @@ condition: `{i:*^10}` == \"****42****\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_106 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_106, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_106, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_106, 32); - String::append_char(__local_106, 97); - String::append_char(__local_106, 116); - String::append_char(__local_106, 32); - String::append(__local_106, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_106, 58); + String::push_str(__local_106, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_106, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_106, 32); + String::push(__local_106, 97); + String::push(__local_106, 116); + String::push(__local_106, 32); + String::push_str(__local_106, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_106, 58); __local_107 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_106 }; i32::fmt_decimal(90, __local_107); - String::append(__local_106, String { repr: array.new_data(" + String::push_str(__local_106, String { repr: array.new_data(" condition: `{i:0>8}` == \"00000042\" "), used: 36 }); break __tmpl: __local_106; @@ -1314,17 +1314,17 @@ condition: `{i:0>8}` == \"00000042\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_110 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_110, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_110, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_110, 32); - String::append_char(__local_110, 97); - String::append_char(__local_110, 116); - String::append_char(__local_110, 32); - String::append(__local_110, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_110, 58); + String::push_str(__local_110, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_110, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_110, 32); + String::push(__local_110, 97); + String::push(__local_110, 116); + String::push(__local_110, 32); + String::push_str(__local_110, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_110, 58); __local_111 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_110 }; i32::fmt_decimal(91, __local_111); - String::append(__local_110, String { repr: array.new_data(" + String::push_str(__local_110, String { repr: array.new_data(" condition: `{i:-<8}` == \"42------\" "), used: 36 }); break __tmpl: __local_110; @@ -1340,17 +1340,17 @@ condition: `{i:-<8}` == \"42------\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_114 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_114, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_114, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_114, 32); - String::append_char(__local_114, 97); - String::append_char(__local_114, 116); - String::append_char(__local_114, 32); - String::append(__local_114, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_114, 58); + String::push_str(__local_114, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_114, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_114, 32); + String::push(__local_114, 97); + String::push(__local_114, 116); + String::push(__local_114, 32); + String::push_str(__local_114, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_114, 58); __local_115 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_114 }; i32::fmt_decimal(92, __local_115); - String::append(__local_114, String { repr: array.new_data(" + String::push_str(__local_114, String { repr: array.new_data(" condition: `{i:+}` == \"+42\" "), used: 29 }); break __tmpl: __local_114; @@ -1366,17 +1366,17 @@ condition: `{i:+}` == \"+42\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_118 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_118, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_118, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_118, 32); - String::append_char(__local_118, 97); - String::append_char(__local_118, 116); - String::append_char(__local_118, 32); - String::append(__local_118, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_118, 58); + String::push_str(__local_118, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_118, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_118, 32); + String::push(__local_118, 97); + String::push(__local_118, 116); + String::push(__local_118, 32); + String::push_str(__local_118, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_118, 58); __local_119 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_118 }; i32::fmt_decimal(94, __local_119); - String::append(__local_118, String { repr: array.new_data(" + String::push_str(__local_118, String { repr: array.new_data(" condition: `{neg:+}` == \"-42\" "), used: 31 }); break __tmpl: __local_118; @@ -1392,17 +1392,17 @@ condition: `{neg:+}` == \"-42\" if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_122 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_122, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_122, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_122, 32); - String::append_char(__local_122, 97); - String::append_char(__local_122, 116); - String::append_char(__local_122, 32); - String::append(__local_122, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_122, 58); + String::push_str(__local_122, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_122, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_122, 32); + String::push(__local_122, 97); + String::push(__local_122, 116); + String::push(__local_122, 32); + String::push_str(__local_122, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_122, 58); __local_123 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_122 }; i32::fmt_decimal(95, __local_123); - String::append(__local_122, String { repr: array.new_data(" + String::push_str(__local_122, String { repr: array.new_data(" condition: `{neg}` == \"-42\" "), used: 29 }); break __tmpl: __local_122; @@ -1418,17 +1418,17 @@ condition: `{neg}` == \"-42\" if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_126 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_126, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_126, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_126, 32); - String::append_char(__local_126, 97); - String::append_char(__local_126, 116); - String::append_char(__local_126, 32); - String::append(__local_126, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_126, 58); + String::push_str(__local_126, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_126, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_126, 32); + String::push(__local_126, 97); + String::push(__local_126, 116); + String::push(__local_126, 32); + String::push_str(__local_126, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_126, 58); __local_127 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_126 }; i32::fmt_decimal(96, __local_127); - String::append(__local_126, String { repr: array.new_data(" + String::push_str(__local_126, String { repr: array.new_data(" condition: `{i:08}` == \"00000042\" "), used: 35 }); break __tmpl: __local_126; @@ -1444,17 +1444,17 @@ condition: `{i:08}` == \"00000042\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_130 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_130, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_130, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_130, 32); - String::append_char(__local_130, 97); - String::append_char(__local_130, 116); - String::append_char(__local_130, 32); - String::append(__local_130, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_130, 58); + String::push_str(__local_130, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_130, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_130, 32); + String::push(__local_130, 97); + String::push(__local_130, 116); + String::push(__local_130, 32); + String::push_str(__local_130, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_130, 58); __local_131 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_130 }; i32::fmt_decimal(97, __local_131); - String::append(__local_130, String { repr: array.new_data(" + String::push_str(__local_130, String { repr: array.new_data(" condition: `{neg:08}` == \"-0000042\" "), used: 37 }); break __tmpl: __local_130; @@ -1470,17 +1470,17 @@ condition: `{neg:08}` == \"-0000042\" if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_134 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_134, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_134, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_134, 32); - String::append_char(__local_134, 97); - String::append_char(__local_134, 116); - String::append_char(__local_134, 32); - String::append(__local_134, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_134, 58); + String::push_str(__local_134, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_134, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_134, 32); + String::push(__local_134, 97); + String::push(__local_134, 116); + String::push(__local_134, 32); + String::push_str(__local_134, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_134, 58); __local_135 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_134 }; i32::fmt_decimal(98, __local_135); - String::append(__local_134, String { repr: array.new_data(" + String::push_str(__local_134, String { repr: array.new_data(" condition: `{i:+08}` == \"+0000042\" "), used: 36 }); break __tmpl: __local_134; @@ -1496,17 +1496,17 @@ condition: `{i:+08}` == \"+0000042\" if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_138 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_138, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_138, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_138, 32); - String::append_char(__local_138, 97); - String::append_char(__local_138, 116); - String::append_char(__local_138, 32); - String::append(__local_138, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_138, 58); + String::push_str(__local_138, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_138, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_138, 32); + String::push(__local_138, 97); + String::push(__local_138, 116); + String::push(__local_138, 32); + String::push_str(__local_138, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_138, 58); __local_139 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_138 }; i32::fmt_decimal(99, __local_139); - String::append(__local_138, String { repr: array.new_data(" + String::push_str(__local_138, String { repr: array.new_data(" condition: `{i:b}` == \"101010\" "), used: 32 }); break __tmpl: __local_138; @@ -1522,17 +1522,17 @@ condition: `{i:b}` == \"101010\" if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_142 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_142, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_142, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_142, 32); - String::append_char(__local_142, 97); - String::append_char(__local_142, 116); - String::append_char(__local_142, 32); - String::append(__local_142, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_142, 58); + String::push_str(__local_142, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_142, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_142, 32); + String::push(__local_142, 97); + String::push(__local_142, 116); + String::push(__local_142, 32); + String::push_str(__local_142, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_142, 58); __local_143 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_142 }; i32::fmt_decimal(101, __local_143); - String::append(__local_142, String { repr: array.new_data(" + String::push_str(__local_142, String { repr: array.new_data(" condition: `{byte:b}` == \"11111111\" "), used: 37 }); break __tmpl: __local_142; @@ -1548,17 +1548,17 @@ condition: `{byte:b}` == \"11111111\" if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_146 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_146, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_146, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_146, 32); - String::append_char(__local_146, 97); - String::append_char(__local_146, 116); - String::append_char(__local_146, 32); - String::append(__local_146, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_146, 58); + String::push_str(__local_146, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_146, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_146, 32); + String::push(__local_146, 97); + String::push(__local_146, 116); + String::push(__local_146, 32); + String::push_str(__local_146, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_146, 58); __local_147 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_146 }; i32::fmt_decimal(102, __local_147); - String::append(__local_146, String { repr: array.new_data(" + String::push_str(__local_146, String { repr: array.new_data(" condition: `{byte:#b}` == \"0b11111111\" "), used: 40 }); break __tmpl: __local_146; @@ -1574,17 +1574,17 @@ condition: `{byte:#b}` == \"0b11111111\" if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_150 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_150, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_150, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_150, 32); - String::append_char(__local_150, 97); - String::append_char(__local_150, 116); - String::append_char(__local_150, 32); - String::append(__local_150, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_150, 58); + String::push_str(__local_150, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_150, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_150, 32); + String::push(__local_150, 97); + String::push(__local_150, 116); + String::push(__local_150, 32); + String::push_str(__local_150, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_150, 58); __local_151 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_150 }; i32::fmt_decimal(103, __local_151); - String::append(__local_150, String { repr: array.new_data(" + String::push_str(__local_150, String { repr: array.new_data(" condition: `{i:08b}` == \"00101010\" "), used: 36 }); break __tmpl: __local_150; @@ -1600,17 +1600,17 @@ condition: `{i:08b}` == \"00101010\" if __cond_23 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_154 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_154, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_154, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_154, 32); - String::append_char(__local_154, 97); - String::append_char(__local_154, 116); - String::append_char(__local_154, 32); - String::append(__local_154, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_154, 58); + String::push_str(__local_154, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_154, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_154, 32); + String::push(__local_154, 97); + String::push(__local_154, 116); + String::push(__local_154, 32); + String::push_str(__local_154, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_154, 58); __local_155 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_154 }; i32::fmt_decimal(104, __local_155); - String::append(__local_154, String { repr: array.new_data(" + String::push_str(__local_154, String { repr: array.new_data(" condition: `{i:#010b}` == \"0b00101010\" "), used: 40 }); break __tmpl: __local_154; @@ -1626,17 +1626,17 @@ condition: `{i:#010b}` == \"0b00101010\" if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_158 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_158, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_158, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_158, 32); - String::append_char(__local_158, 97); - String::append_char(__local_158, 116); - String::append_char(__local_158, 32); - String::append(__local_158, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_158, 58); + String::push_str(__local_158, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_158, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_158, 32); + String::push(__local_158, 97); + String::push(__local_158, 116); + String::push(__local_158, 32); + String::push_str(__local_158, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_158, 58); __local_159 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_158 }; i32::fmt_decimal(105, __local_159); - String::append(__local_158, String { repr: array.new_data(" + String::push_str(__local_158, String { repr: array.new_data(" condition: `{i:o}` == \"52\" "), used: 28 }); break __tmpl: __local_158; @@ -1652,17 +1652,17 @@ condition: `{i:o}` == \"52\" if __cond_26 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_162 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_162, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_162, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_162, 32); - String::append_char(__local_162, 97); - String::append_char(__local_162, 116); - String::append_char(__local_162, 32); - String::append(__local_162, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_162, 58); + String::push_str(__local_162, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_162, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_162, 32); + String::push(__local_162, 97); + String::push(__local_162, 116); + String::push(__local_162, 32); + String::push_str(__local_162, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_162, 58); __local_163 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_162 }; i32::fmt_decimal(107, __local_163); - String::append(__local_162, String { repr: array.new_data(" + String::push_str(__local_162, String { repr: array.new_data(" condition: `{oct_val:o}` == \"777\" "), used: 35 }); break __tmpl: __local_162; @@ -1678,17 +1678,17 @@ condition: `{oct_val:o}` == \"777\" if __cond_27 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_166 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_166, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_166, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_166, 32); - String::append_char(__local_166, 97); - String::append_char(__local_166, 116); - String::append_char(__local_166, 32); - String::append(__local_166, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_166, 58); + String::push_str(__local_166, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_166, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_166, 32); + String::push(__local_166, 97); + String::push(__local_166, 116); + String::push(__local_166, 32); + String::push_str(__local_166, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_166, 58); __local_167 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_166 }; i32::fmt_decimal(108, __local_167); - String::append(__local_166, String { repr: array.new_data(" + String::push_str(__local_166, String { repr: array.new_data(" condition: `{oct_val:#o}` == \"0o777\" "), used: 38 }); break __tmpl: __local_166; @@ -1704,17 +1704,17 @@ condition: `{oct_val:#o}` == \"0o777\" if __cond_28 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_170 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_170, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_170, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_170, 32); - String::append_char(__local_170, 97); - String::append_char(__local_170, 116); - String::append_char(__local_170, 32); - String::append(__local_170, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_170, 58); + String::push_str(__local_170, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_170, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_170, 32); + String::push(__local_170, 97); + String::push(__local_170, 116); + String::push(__local_170, 32); + String::push_str(__local_170, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_170, 58); __local_171 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_170 }; i32::fmt_decimal(109, __local_171); - String::append(__local_170, String { repr: array.new_data(" + String::push_str(__local_170, String { repr: array.new_data(" condition: `{i:x}` == \"2a\" "), used: 28 }); break __tmpl: __local_170; @@ -1730,17 +1730,17 @@ condition: `{i:x}` == \"2a\" if __cond_29 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_174 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_174, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_174, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_174, 32); - String::append_char(__local_174, 97); - String::append_char(__local_174, 116); - String::append_char(__local_174, 32); - String::append(__local_174, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_174, 58); + String::push_str(__local_174, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_174, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_174, 32); + String::push(__local_174, 97); + String::push(__local_174, 116); + String::push(__local_174, 32); + String::push_str(__local_174, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_174, 58); __local_175 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_174 }; i32::fmt_decimal(110, __local_175); - String::append(__local_174, String { repr: array.new_data(" + String::push_str(__local_174, String { repr: array.new_data(" condition: `{i:X}` == \"2A\" "), used: 28 }); break __tmpl: __local_174; @@ -1756,17 +1756,17 @@ condition: `{i:X}` == \"2A\" if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_178 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_178, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_178, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_178, 32); - String::append_char(__local_178, 97); - String::append_char(__local_178, 116); - String::append_char(__local_178, 32); - String::append(__local_178, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_178, 58); + String::push_str(__local_178, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_178, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_178, 32); + String::push(__local_178, 97); + String::push(__local_178, 116); + String::push(__local_178, 32); + String::push_str(__local_178, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_178, 58); __local_179 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_178 }; i32::fmt_decimal(112, __local_179); - String::append(__local_178, String { repr: array.new_data(" + String::push_str(__local_178, String { repr: array.new_data(" condition: `{hex_val:x}` == \"ff\" "), used: 34 }); break __tmpl: __local_178; @@ -1782,17 +1782,17 @@ condition: `{hex_val:x}` == \"ff\" if __cond_32 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_182 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_182, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_182, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_182, 32); - String::append_char(__local_182, 97); - String::append_char(__local_182, 116); - String::append_char(__local_182, 32); - String::append(__local_182, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_182, 58); + String::push_str(__local_182, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_182, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_182, 32); + String::push(__local_182, 97); + String::push(__local_182, 116); + String::push(__local_182, 32); + String::push_str(__local_182, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_182, 58); __local_183 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_182 }; i32::fmt_decimal(113, __local_183); - String::append(__local_182, String { repr: array.new_data(" + String::push_str(__local_182, String { repr: array.new_data(" condition: `{hex_val:X}` == \"FF\" "), used: 34 }); break __tmpl: __local_182; @@ -1808,17 +1808,17 @@ condition: `{hex_val:X}` == \"FF\" if __cond_33 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_186 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_186, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_186, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_186, 32); - String::append_char(__local_186, 97); - String::append_char(__local_186, 116); - String::append_char(__local_186, 32); - String::append(__local_186, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_186, 58); + String::push_str(__local_186, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_186, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_186, 32); + String::push(__local_186, 97); + String::push(__local_186, 116); + String::push(__local_186, 32); + String::push_str(__local_186, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_186, 58); __local_187 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_186 }; i32::fmt_decimal(114, __local_187); - String::append(__local_186, String { repr: array.new_data(" + String::push_str(__local_186, String { repr: array.new_data(" condition: `{hex_val:#x}` == \"0xff\" "), used: 37 }); break __tmpl: __local_186; @@ -1834,17 +1834,17 @@ condition: `{hex_val:#x}` == \"0xff\" if __cond_34 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_190 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_190, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_190, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_190, 32); - String::append_char(__local_190, 97); - String::append_char(__local_190, 116); - String::append_char(__local_190, 32); - String::append(__local_190, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_190, 58); + String::push_str(__local_190, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_190, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_190, 32); + String::push(__local_190, 97); + String::push(__local_190, 116); + String::push(__local_190, 32); + String::push_str(__local_190, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_190, 58); __local_191 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_190 }; i32::fmt_decimal(115, __local_191); - String::append(__local_190, String { repr: array.new_data(" + String::push_str(__local_190, String { repr: array.new_data(" condition: `{hex_val:#X}` == \"0XFF\" "), used: 37 }); break __tmpl: __local_190; @@ -1860,17 +1860,17 @@ condition: `{hex_val:#X}` == \"0XFF\" if __cond_35 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_194 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_194, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_194, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_194, 32); - String::append_char(__local_194, 97); - String::append_char(__local_194, 116); - String::append_char(__local_194, 32); - String::append(__local_194, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_194, 58); + String::push_str(__local_194, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_194, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_194, 32); + String::push(__local_194, 97); + String::push(__local_194, 116); + String::push(__local_194, 32); + String::push_str(__local_194, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_194, 58); __local_195 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_194 }; i32::fmt_decimal(116, __local_195); - String::append(__local_194, String { repr: array.new_data(" + String::push_str(__local_194, String { repr: array.new_data(" condition: `{hex_val:#010x}` == \"0x000000ff\" "), used: 46 }); break __tmpl: __local_194; @@ -1886,17 +1886,17 @@ condition: `{hex_val:#010x}` == \"0x000000ff\" if __cond_37 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_198 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_198, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_198, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_198, 32); - String::append_char(__local_198, 97); - String::append_char(__local_198, 116); - String::append_char(__local_198, 32); - String::append(__local_198, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_198, 58); + String::push_str(__local_198, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_198, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_198, 32); + String::push(__local_198, 97); + String::push(__local_198, 116); + String::push(__local_198, 32); + String::push_str(__local_198, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_198, 58); __local_199 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_198 }; i32::fmt_decimal(118, __local_199); - String::append(__local_198, String { repr: array.new_data(" + String::push_str(__local_198, String { repr: array.new_data(" condition: `{u32_max:x}` == \"ffffffff\" "), used: 40 }); break __tmpl: __local_198; @@ -1912,17 +1912,17 @@ condition: `{u32_max:x}` == \"ffffffff\" if __cond_38 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_202 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_202, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_202, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_202, 32); - String::append_char(__local_202, 97); - String::append_char(__local_202, 116); - String::append_char(__local_202, 32); - String::append(__local_202, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_202, 58); + String::push_str(__local_202, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_202, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_202, 32); + String::push(__local_202, 97); + String::push(__local_202, 116); + String::push(__local_202, 32); + String::push_str(__local_202, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_202, 58); __local_203 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_202 }; i32::fmt_decimal(119, __local_203); - String::append(__local_202, String { repr: array.new_data(" + String::push_str(__local_202, String { repr: array.new_data(" condition: `{u32_max:b}` == \"11111111111111111111111111111111\" "), used: 64 }); break __tmpl: __local_202; @@ -1938,17 +1938,17 @@ condition: `{u32_max:b}` == \"11111111111111111111111111111111\" if __cond_40 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_206 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_206, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_206, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_206, 32); - String::append_char(__local_206, 97); - String::append_char(__local_206, 116); - String::append_char(__local_206, 32); - String::append(__local_206, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_206, 58); + String::push_str(__local_206, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_206, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_206, 32); + String::push(__local_206, 97); + String::push(__local_206, 116); + String::push(__local_206, 32); + String::push_str(__local_206, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_206, 58); __local_207 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_206 }; i32::fmt_decimal(121, __local_207); - String::append(__local_206, String { repr: array.new_data(" + String::push_str(__local_206, String { repr: array.new_data(" condition: `{big_i64:x}` == \"7fffffffffffffff\" "), used: 48 }); break __tmpl: __local_206; @@ -1964,17 +1964,17 @@ condition: `{big_i64:x}` == \"7fffffffffffffff\" if __cond_42 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_210 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_210, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_210, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_210, 32); - String::append_char(__local_210, 97); - String::append_char(__local_210, 116); - String::append_char(__local_210, 32); - String::append(__local_210, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_210, 58); + String::push_str(__local_210, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_210, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_210, 32); + String::push(__local_210, 97); + String::push(__local_210, 116); + String::push(__local_210, 32); + String::push_str(__local_210, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_210, 58); __local_211 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_210 }; i32::fmt_decimal(123, __local_211); - String::append(__local_210, String { repr: array.new_data(" + String::push_str(__local_210, String { repr: array.new_data(" condition: `{neg_i64}` == \"-1\" "), used: 32 }); break __tmpl: __local_210; @@ -1990,17 +1990,17 @@ condition: `{neg_i64}` == \"-1\" if __cond_43 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_214 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_214, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_214, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_214, 32); - String::append_char(__local_214, 97); - String::append_char(__local_214, 116); - String::append_char(__local_214, 32); - String::append(__local_214, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_214, 58); + String::push_str(__local_214, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_214, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_214, 32); + String::push(__local_214, 97); + String::push(__local_214, 116); + String::push(__local_214, 32); + String::push_str(__local_214, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_214, 58); __local_215 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_214 }; i32::fmt_decimal(124, __local_215); - String::append(__local_214, String { repr: array.new_data(" + String::push_str(__local_214, String { repr: array.new_data(" condition: `{neg_i64:x}` == \"-1\" "), used: 34 }); break __tmpl: __local_214; @@ -2016,17 +2016,17 @@ condition: `{neg_i64:x}` == \"-1\" if __cond_45 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_218 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_218, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_218, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_218, 32); - String::append_char(__local_218, 97); - String::append_char(__local_218, 116); - String::append_char(__local_218, 32); - String::append(__local_218, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_218, 58); + String::push_str(__local_218, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_218, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_218, 32); + String::push(__local_218, 97); + String::push(__local_218, 116); + String::push(__local_218, 32); + String::push_str(__local_218, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_218, 58); __local_219 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_218 }; i32::fmt_decimal(126, __local_219); - String::append(__local_218, String { repr: array.new_data(" + String::push_str(__local_218, String { repr: array.new_data(" condition: `{u64_max:x}` == \"ffffffffffffffff\" "), used: 48 }); break __tmpl: __local_218; @@ -2042,17 +2042,17 @@ condition: `{u64_max:x}` == \"ffffffffffffffff\" if __cond_46 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_222 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_222, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_222, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_222, 32); - String::append_char(__local_222, 97); - String::append_char(__local_222, 116); - String::append_char(__local_222, 32); - String::append(__local_222, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_222, 58); + String::push_str(__local_222, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_222, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_222, 32); + String::push(__local_222, 97); + String::push(__local_222, 116); + String::push(__local_222, 32); + String::push_str(__local_222, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_222, 58); __local_223 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_222 }; i32::fmt_decimal(127, __local_223); - String::append(__local_222, String { repr: array.new_data(" + String::push_str(__local_222, String { repr: array.new_data(" condition: `{u64_max:X}` == \"FFFFFFFFFFFFFFFF\" "), used: 48 }); break __tmpl: __local_222; @@ -2068,17 +2068,17 @@ condition: `{u64_max:X}` == \"FFFFFFFFFFFFFFFF\" if __cond_47 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_226 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_226, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_226, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_226, 32); - String::append_char(__local_226, 97); - String::append_char(__local_226, 116); - String::append_char(__local_226, 32); - String::append(__local_226, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_226, 58); + String::push_str(__local_226, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_226, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_226, 32); + String::push(__local_226, 97); + String::push(__local_226, 116); + String::push(__local_226, 32); + String::push_str(__local_226, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_226, 58); __local_227 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_226 }; i32::fmt_decimal(128, __local_227); - String::append(__local_226, String { repr: array.new_data(" + String::push_str(__local_226, String { repr: array.new_data(" condition: `{u64_max:o}` == \"1777777777777777777777\" "), used: 54 }); break __tmpl: __local_226; @@ -2094,17 +2094,17 @@ condition: `{u64_max:o}` == \"1777777777777777777777\" if __cond_49 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_230 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_230, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_230, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_230, 32); - String::append_char(__local_230, 97); - String::append_char(__local_230, 116); - String::append_char(__local_230, 32); - String::append(__local_230, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_230, 58); + String::push_str(__local_230, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_230, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_230, 32); + String::push(__local_230, 97); + String::push(__local_230, 116); + String::push(__local_230, 32); + String::push_str(__local_230, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_230, 58); __local_231 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_230 }; i32::fmt_decimal(130, __local_231); - String::append(__local_230, String { repr: array.new_data(" + String::push_str(__local_230, String { repr: array.new_data(" condition: `{u64_one:b}` == \"1\" "), used: 33 }); break __tmpl: __local_230; @@ -2120,17 +2120,17 @@ condition: `{u64_one:b}` == \"1\" if __cond_50 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_234 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_234, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_234, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_234, 32); - String::append_char(__local_234, 97); - String::append_char(__local_234, 116); - String::append_char(__local_234, 32); - String::append(__local_234, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_234, 58); + String::push_str(__local_234, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_234, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_234, 32); + String::push(__local_234, 97); + String::push(__local_234, 116); + String::push(__local_234, 32); + String::push_str(__local_234, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_234, 58); __local_235 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_234 }; i32::fmt_decimal(131, __local_235); - String::append(__local_234, String { repr: array.new_data(" + String::push_str(__local_234, String { repr: array.new_data(" condition: `{u64_one:#x}` == \"0x1\" "), used: 36 }); break __tmpl: __local_234; @@ -2147,17 +2147,17 @@ condition: `{u64_one:#x}` == \"0x1\" if __cond_52 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_238 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_238, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_238, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_238, 32); - String::append_char(__local_238, 97); - String::append_char(__local_238, 116); - String::append_char(__local_238, 32); - String::append(__local_238, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_238, 58); + String::push_str(__local_238, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_238, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_238, 32); + String::push(__local_238, 97); + String::push(__local_238, 116); + String::push(__local_238, 32); + String::push_str(__local_238, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_238, 58); __local_239 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_238 }; i32::fmt_decimal(133, __local_239); - String::append(__local_238, String { repr: array.new_data(" + String::push_str(__local_238, String { repr: array.new_data(" condition: `{i128_val:x}` == \"ff\" "), used: 35 }); break __tmpl: __local_238; @@ -2173,17 +2173,17 @@ condition: `{i128_val:x}` == \"ff\" if __cond_53 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_242 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_242, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_242, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_242, 32); - String::append_char(__local_242, 97); - String::append_char(__local_242, 116); - String::append_char(__local_242, 32); - String::append(__local_242, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_242, 58); + String::push_str(__local_242, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_242, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_242, 32); + String::push(__local_242, 97); + String::push(__local_242, 116); + String::push(__local_242, 32); + String::push_str(__local_242, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_242, 58); __local_243 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_242 }; i32::fmt_decimal(134, __local_243); - String::append(__local_242, String { repr: array.new_data(" + String::push_str(__local_242, String { repr: array.new_data(" condition: `{i128_val:X}` == \"FF\" "), used: 35 }); break __tmpl: __local_242; @@ -2199,17 +2199,17 @@ condition: `{i128_val:X}` == \"FF\" if __cond_54 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_246 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_246, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_246, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_246, 32); - String::append_char(__local_246, 97); - String::append_char(__local_246, 116); - String::append_char(__local_246, 32); - String::append(__local_246, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_246, 58); + String::push_str(__local_246, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_246, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_246, 32); + String::push(__local_246, 97); + String::push(__local_246, 116); + String::push(__local_246, 32); + String::push_str(__local_246, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_246, 58); __local_247 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_246 }; i32::fmt_decimal(135, __local_247); - String::append(__local_246, String { repr: array.new_data(" + String::push_str(__local_246, String { repr: array.new_data(" condition: `{i128_val:b}` == \"11111111\" "), used: 41 }); break __tmpl: __local_246; @@ -2225,17 +2225,17 @@ condition: `{i128_val:b}` == \"11111111\" if __cond_55 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_250 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_250, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_250, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_250, 32); - String::append_char(__local_250, 97); - String::append_char(__local_250, 116); - String::append_char(__local_250, 32); - String::append(__local_250, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_250, 58); + String::push_str(__local_250, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_250, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_250, 32); + String::push(__local_250, 97); + String::push(__local_250, 116); + String::push(__local_250, 32); + String::push_str(__local_250, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_250, 58); __local_251 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_250 }; i32::fmt_decimal(136, __local_251); - String::append(__local_250, String { repr: array.new_data(" + String::push_str(__local_250, String { repr: array.new_data(" condition: `{i128_val:o}` == \"377\" "), used: 36 }); break __tmpl: __local_250; @@ -2251,17 +2251,17 @@ condition: `{i128_val:o}` == \"377\" if __cond_56 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_254 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_254, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_254, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_254, 32); - String::append_char(__local_254, 97); - String::append_char(__local_254, 116); - String::append_char(__local_254, 32); - String::append(__local_254, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_254, 58); + String::push_str(__local_254, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_254, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_254, 32); + String::push(__local_254, 97); + String::push(__local_254, 116); + String::push(__local_254, 32); + String::push_str(__local_254, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_254, 58); __local_255 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_254 }; i32::fmt_decimal(137, __local_255); - String::append(__local_254, String { repr: array.new_data(" + String::push_str(__local_254, String { repr: array.new_data(" condition: `{i128_val:#x}` == \"0xff\" "), used: 38 }); break __tmpl: __local_254; @@ -2278,17 +2278,17 @@ condition: `{i128_val:#x}` == \"0xff\" if __cond_58 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_258 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_258, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_258, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_258, 32); - String::append_char(__local_258, 97); - String::append_char(__local_258, 116); - String::append_char(__local_258, 32); - String::append(__local_258, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_258, 58); + String::push_str(__local_258, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_258, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_258, 32); + String::push(__local_258, 97); + String::push(__local_258, 116); + String::push(__local_258, 32); + String::push_str(__local_258, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_258, 58); __local_259 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_258 }; i32::fmt_decimal(139, __local_259); - String::append(__local_258, String { repr: array.new_data(" + String::push_str(__local_258, String { repr: array.new_data(" condition: `{neg_i128:x}` == \"-1\" "), used: 35 }); break __tmpl: __local_258; @@ -2304,17 +2304,17 @@ condition: `{neg_i128:x}` == \"-1\" if __cond_59 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_262 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_262, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_262, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_262, 32); - String::append_char(__local_262, 97); - String::append_char(__local_262, 116); - String::append_char(__local_262, 32); - String::append(__local_262, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_262, 58); + String::push_str(__local_262, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_262, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_262, 32); + String::push(__local_262, 97); + String::push(__local_262, 116); + String::push(__local_262, 32); + String::push_str(__local_262, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_262, 58); __local_263 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_262 }; i32::fmt_decimal(140, __local_263); - String::append(__local_262, String { repr: array.new_data(" + String::push_str(__local_262, String { repr: array.new_data(" condition: `{neg_i128:b}` == \"-1\" "), used: 35 }); break __tmpl: __local_262; @@ -2331,17 +2331,17 @@ condition: `{neg_i128:b}` == \"-1\" if __cond_61 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_266 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_266, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_266, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_266, 32); - String::append_char(__local_266, 97); - String::append_char(__local_266, 116); - String::append_char(__local_266, 32); - String::append(__local_266, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_266, 58); + String::push_str(__local_266, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_266, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_266, 32); + String::push(__local_266, 97); + String::push(__local_266, 116); + String::push(__local_266, 32); + String::push_str(__local_266, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_266, 58); __local_267 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_266 }; i32::fmt_decimal(142, __local_267); - String::append(__local_266, String { repr: array.new_data(" + String::push_str(__local_266, String { repr: array.new_data(" condition: `{u128_val:x}` == \"100\" "), used: 36 }); break __tmpl: __local_266; @@ -2357,17 +2357,17 @@ condition: `{u128_val:x}` == \"100\" if __cond_62 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_270 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_270, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_270, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_270, 32); - String::append_char(__local_270, 97); - String::append_char(__local_270, 116); - String::append_char(__local_270, 32); - String::append(__local_270, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_270, 58); + String::push_str(__local_270, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_270, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_270, 32); + String::push(__local_270, 97); + String::push(__local_270, 116); + String::push(__local_270, 32); + String::push_str(__local_270, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_270, 58); __local_271 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_270 }; i32::fmt_decimal(143, __local_271); - String::append(__local_270, String { repr: array.new_data(" + String::push_str(__local_270, String { repr: array.new_data(" condition: `{u128_val:b}` == \"100000000\" "), used: 42 }); break __tmpl: __local_270; @@ -2383,17 +2383,17 @@ condition: `{u128_val:b}` == \"100000000\" if __cond_63 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_274 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_274, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_274, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_274, 32); - String::append_char(__local_274, 97); - String::append_char(__local_274, 116); - String::append_char(__local_274, 32); - String::append(__local_274, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_274, 58); + String::push_str(__local_274, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_274, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_274, 32); + String::push(__local_274, 97); + String::push(__local_274, 116); + String::push(__local_274, 32); + String::push_str(__local_274, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_274, 58); __local_275 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_274 }; i32::fmt_decimal(144, __local_275); - String::append(__local_274, String { repr: array.new_data(" + String::push_str(__local_274, String { repr: array.new_data(" condition: `{u128_val:o}` == \"400\" "), used: 36 }); break __tmpl: __local_274; @@ -2409,17 +2409,17 @@ condition: `{u128_val:o}` == \"400\" if __cond_64 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_278 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_278, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_278, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_278, 32); - String::append_char(__local_278, 97); - String::append_char(__local_278, 116); - String::append_char(__local_278, 32); - String::append(__local_278, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_278, 58); + String::push_str(__local_278, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_278, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_278, 32); + String::push(__local_278, 97); + String::push(__local_278, 116); + String::push(__local_278, 32); + String::push_str(__local_278, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_278, 58); __local_279 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_278 }; i32::fmt_decimal(145, __local_279); - String::append(__local_278, String { repr: array.new_data(" + String::push_str(__local_278, String { repr: array.new_data(" condition: `{u128_val:#X}` == \"0X100\" "), used: 39 }); break __tmpl: __local_278; @@ -2435,17 +2435,17 @@ condition: `{u128_val:#X}` == \"0X100\" if __cond_65 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_282 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_282, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_282, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_282, 32); - String::append_char(__local_282, 97); - String::append_char(__local_282, 116); - String::append_char(__local_282, 32); - String::append(__local_282, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_282, 58); + String::push_str(__local_282, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_282, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_282, 32); + String::push(__local_282, 97); + String::push(__local_282, 116); + String::push(__local_282, 32); + String::push_str(__local_282, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_282, 58); __local_283 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_282 }; i32::fmt_decimal(146, __local_283); - String::append(__local_282, String { repr: array.new_data(" + String::push_str(__local_282, String { repr: array.new_data(" condition: `{i:+010}` == \"+000000042\" "), used: 39 }); break __tmpl: __local_282; @@ -2461,17 +2461,17 @@ condition: `{i:+010}` == \"+000000042\" if __cond_66 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_286 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_286, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_286, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_286, 32); - String::append_char(__local_286, 97); - String::append_char(__local_286, 116); - String::append_char(__local_286, 32); - String::append(__local_286, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_286, 58); + String::push_str(__local_286, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_286, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_286, 32); + String::push(__local_286, 97); + String::push(__local_286, 116); + String::push(__local_286, 32); + String::push_str(__local_286, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_286, 58); __local_287 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_286 }; i32::fmt_decimal(147, __local_287); - String::append(__local_286, String { repr: array.new_data(" + String::push_str(__local_286, String { repr: array.new_data(" condition: `{i:#010x}` == \"0x0000002a\" "), used: 40 }); break __tmpl: __local_286; @@ -2487,17 +2487,17 @@ condition: `{i:#010x}` == \"0x0000002a\" if __cond_67 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_290 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_290, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_290, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_290, 32); - String::append_char(__local_290, 97); - String::append_char(__local_290, 116); - String::append_char(__local_290, 32); - String::append(__local_290, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_290, 58); + String::push_str(__local_290, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_290, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_290, 32); + String::push(__local_290, 97); + String::push(__local_290, 116); + String::push(__local_290, 32); + String::push_str(__local_290, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_290, 58); __local_291 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_290 }; i32::fmt_decimal(148, __local_291); - String::append(__local_290, String { repr: array.new_data(" + String::push_str(__local_290, String { repr: array.new_data(" condition: `{i:<10x}` == \"2a \" "), used: 39 }); break __tmpl: __local_290; @@ -2513,17 +2513,17 @@ condition: `{i:<10x}` == \"2a \" if __cond_68 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_294 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_294, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_294, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_294, 32); - String::append_char(__local_294, 97); - String::append_char(__local_294, 116); - String::append_char(__local_294, 32); - String::append(__local_294, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_294, 58); + String::push_str(__local_294, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_294, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_294, 32); + String::push(__local_294, 97); + String::push(__local_294, 116); + String::push(__local_294, 32); + String::push_str(__local_294, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_294, 58); __local_295 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_294 }; i32::fmt_decimal(149, __local_295); - String::append(__local_294, String { repr: array.new_data(" + String::push_str(__local_294, String { repr: array.new_data(" condition: `{s:>10}` == \" hello\" "), used: 38 }); break __tmpl: __local_294; @@ -2539,17 +2539,17 @@ condition: `{s:>10}` == \" hello\" if __cond_69 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_298 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_298, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_298, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_298, 32); - String::append_char(__local_298, 97); - String::append_char(__local_298, 116); - String::append_char(__local_298, 32); - String::append(__local_298, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_298, 58); + String::push_str(__local_298, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_298, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_298, 32); + String::push(__local_298, 97); + String::push(__local_298, 116); + String::push(__local_298, 32); + String::push_str(__local_298, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_298, 58); __local_299 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_298 }; i32::fmt_decimal(150, __local_299); - String::append(__local_298, String { repr: array.new_data(" + String::push_str(__local_298, String { repr: array.new_data(" condition: `{s:<10}` == \"hello \" "), used: 38 }); break __tmpl: __local_298; @@ -2565,17 +2565,17 @@ condition: `{s:<10}` == \"hello \" if __cond_70 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_302 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_302, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_302, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_302, 32); - String::append_char(__local_302, 97); - String::append_char(__local_302, 116); - String::append_char(__local_302, 32); - String::append(__local_302, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_302, 58); + String::push_str(__local_302, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_302, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_302, 32); + String::push(__local_302, 97); + String::push(__local_302, 116); + String::push(__local_302, 32); + String::push_str(__local_302, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_302, 58); __local_303 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_302 }; i32::fmt_decimal(151, __local_303); - String::append(__local_302, String { repr: array.new_data(" + String::push_str(__local_302, String { repr: array.new_data(" condition: `{s:^10}` == \" hello \" "), used: 38 }); break __tmpl: __local_302; @@ -2593,17 +2593,17 @@ condition: `{s:^10}` == \" hello \" if __cond_71 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_306 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_306, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_306, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_306, 32); - String::append_char(__local_306, 97); - String::append_char(__local_306, 116); - String::append_char(__local_306, 32); - String::append(__local_306, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_306, 58); + String::push_str(__local_306, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_306, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_306, 32); + String::push(__local_306, 97); + String::push(__local_306, 116); + String::push(__local_306, 32); + String::push_str(__local_306, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_306, 58); __local_307 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_306 }; i32::fmt_decimal(152, __local_307); - String::append(__local_306, String { repr: array.new_data(" + String::push_str(__local_306, String { repr: array.new_data(" condition: `{true}` == \"true\" "), used: 31 }); break __tmpl: __local_306; @@ -2621,17 +2621,17 @@ condition: `{true}` == \"true\" if __cond_72 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_310 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_310, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_310, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_310, 32); - String::append_char(__local_310, 97); - String::append_char(__local_310, 116); - String::append_char(__local_310, 32); - String::append(__local_310, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_310, 58); + String::push_str(__local_310, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_310, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_310, 32); + String::push(__local_310, 97); + String::push(__local_310, 116); + String::push(__local_310, 32); + String::push_str(__local_310, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_310, 58); __local_311 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_310 }; i32::fmt_decimal(153, __local_311); - String::append(__local_310, String { repr: array.new_data(" + String::push_str(__local_310, String { repr: array.new_data(" condition: `{false}` == \"false\" "), used: 33 }); break __tmpl: __local_310; @@ -2647,17 +2647,17 @@ condition: `{false}` == \"false\" if __cond_74 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_314 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_314, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_314, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_314, 32); - String::append_char(__local_314, 97); - String::append_char(__local_314, 116); - String::append_char(__local_314, 32); - String::append(__local_314, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_314, 58); + String::push_str(__local_314, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_314, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_314, 32); + String::push(__local_314, 97); + String::push(__local_314, 116); + String::push(__local_314, 32); + String::push_str(__local_314, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_314, 58); __local_315 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_314 }; i32::fmt_decimal(155, __local_315); - String::append(__local_314, String { repr: array.new_data(" + String::push_str(__local_314, String { repr: array.new_data(" condition: `{neg_i32:b}` == \"-101010\" "), used: 39 }); break __tmpl: __local_314; @@ -2673,17 +2673,17 @@ condition: `{neg_i32:b}` == \"-101010\" if __cond_75 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_318 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_318, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_318, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_318, 32); - String::append_char(__local_318, 97); - String::append_char(__local_318, 116); - String::append_char(__local_318, 32); - String::append(__local_318, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_318, 58); + String::push_str(__local_318, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_318, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_318, 32); + String::push(__local_318, 97); + String::push(__local_318, 116); + String::push(__local_318, 32); + String::push_str(__local_318, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_318, 58); __local_319 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_318 }; i32::fmt_decimal(156, __local_319); - String::append(__local_318, String { repr: array.new_data(" + String::push_str(__local_318, String { repr: array.new_data(" condition: `{neg_i32:o}` == \"-52\" "), used: 35 }); break __tmpl: __local_318; @@ -2699,17 +2699,17 @@ condition: `{neg_i32:o}` == \"-52\" if __cond_76 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_322 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_322, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_322, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_322, 32); - String::append_char(__local_322, 97); - String::append_char(__local_322, 116); - String::append_char(__local_322, 32); - String::append(__local_322, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_322, 58); + String::push_str(__local_322, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_322, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_322, 32); + String::push(__local_322, 97); + String::push(__local_322, 116); + String::push(__local_322, 32); + String::push_str(__local_322, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_322, 58); __local_323 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_322 }; i32::fmt_decimal(157, __local_323); - String::append(__local_322, String { repr: array.new_data(" + String::push_str(__local_322, String { repr: array.new_data(" condition: `{neg_i32:x}` == \"-2a\" "), used: 35 }); break __tmpl: __local_322; @@ -2725,17 +2725,17 @@ condition: `{neg_i32:x}` == \"-2a\" if __cond_77 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_326 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_326, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_326, String { repr: array.new_data("test_template_specifiers"), used: 24 }); - String::append_char(__local_326, 32); - String::append_char(__local_326, 97); - String::append_char(__local_326, 116); - String::append_char(__local_326, 32); - String::append(__local_326, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_326, 58); + String::push_str(__local_326, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_326, String { repr: array.new_data("test_template_specifiers"), used: 24 }); + String::push(__local_326, 32); + String::push(__local_326, 97); + String::push(__local_326, 116); + String::push(__local_326, 32); + String::push_str(__local_326, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_326, 58); __local_327 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_326 }; i32::fmt_decimal(158, __local_327); - String::append(__local_326, String { repr: array.new_data(" + String::push_str(__local_326, String { repr: array.new_data(" condition: `{neg_i32:#x}` == \"-0x2a\" "), used: 38 }); break __tmpl: __local_326; @@ -3136,17 +3136,17 @@ fn test_template_specifiers_float() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_77 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_77, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_77, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_77, 32); - String::append_char(__local_77, 97); - String::append_char(__local_77, 116); - String::append_char(__local_77, 32); - String::append(__local_77, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_77, 58); + String::push_str(__local_77, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_77, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_77, 32); + String::push(__local_77, 97); + String::push(__local_77, 116); + String::push(__local_77, 32); + String::push_str(__local_77, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_77, 58); __local_78 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_77 }; i32::fmt_decimal(165, __local_78); - String::append(__local_77, String { repr: array.new_data(" + String::push_str(__local_77, String { repr: array.new_data(" condition: `{pi}` == \"3.14159\" "), used: 32 }); break __tmpl: __local_77; @@ -3162,17 +3162,17 @@ condition: `{pi}` == \"3.14159\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_81 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_81, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_81, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_81, 32); - String::append_char(__local_81, 97); - String::append_char(__local_81, 116); - String::append_char(__local_81, 32); - String::append(__local_81, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_81, 58); + String::push_str(__local_81, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_81, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_81, 32); + String::push(__local_81, 97); + String::push(__local_81, 116); + String::push(__local_81, 32); + String::push_str(__local_81, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_81, 58); __local_82 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_81 }; i32::fmt_decimal(166, __local_82); - String::append(__local_81, String { repr: array.new_data(" + String::push_str(__local_81, String { repr: array.new_data(" condition: `{neg}` == \"-2.71828\" "), used: 34 }); break __tmpl: __local_81; @@ -3188,17 +3188,17 @@ condition: `{neg}` == \"-2.71828\" if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_85 = String { repr: builtin::array_new(100), used: 0 }; - String::append(__local_85, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_85, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_85, 32); - String::append_char(__local_85, 97); - String::append_char(__local_85, 116); - String::append_char(__local_85, 32); - String::append(__local_85, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_85, 58); + String::push_str(__local_85, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_85, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_85, 32); + String::push(__local_85, 97); + String::push(__local_85, 116); + String::push(__local_85, 32); + String::push_str(__local_85, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_85, 58); __local_86 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_85 }; i32::fmt_decimal(167, __local_86); - String::append(__local_85, String { repr: array.new_data(" + String::push_str(__local_85, String { repr: array.new_data(" condition: `{0.0}` == \"0\" "), used: 27 }); break __tmpl: __local_85; @@ -3214,17 +3214,17 @@ condition: `{0.0}` == \"0\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_89 = String { repr: builtin::array_new(100), used: 0 }; - String::append(__local_89, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_89, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_89, 32); - String::append_char(__local_89, 97); - String::append_char(__local_89, 116); - String::append_char(__local_89, 32); - String::append(__local_89, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_89, 58); + String::push_str(__local_89, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_89, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_89, 32); + String::push(__local_89, 97); + String::push(__local_89, 116); + String::push(__local_89, 32); + String::push_str(__local_89, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_89, 58); __local_90 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_89 }; i32::fmt_decimal(168, __local_90); - String::append(__local_89, String { repr: array.new_data(" + String::push_str(__local_89, String { repr: array.new_data(" condition: `{1.0}` == \"1\" "), used: 27 }); break __tmpl: __local_89; @@ -3240,17 +3240,17 @@ condition: `{1.0}` == \"1\" if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_93 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_93, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_93, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_93, 32); - String::append_char(__local_93, 97); - String::append_char(__local_93, 116); - String::append_char(__local_93, 32); - String::append(__local_93, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_93, 58); + String::push_str(__local_93, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_93, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_93, 32); + String::push(__local_93, 97); + String::push(__local_93, 116); + String::push(__local_93, 32); + String::push_str(__local_93, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_93, 58); __local_94 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_93 }; i32::fmt_decimal(169, __local_94); - String::append(__local_93, String { repr: array.new_data(" + String::push_str(__local_93, String { repr: array.new_data(" condition: `{0.5}` == \"0.5\" "), used: 29 }); break __tmpl: __local_93; @@ -3266,17 +3266,17 @@ condition: `{0.5}` == \"0.5\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_97 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_97, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_97, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_97, 32); - String::append_char(__local_97, 97); - String::append_char(__local_97, 116); - String::append_char(__local_97, 32); - String::append(__local_97, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_97, 58); + String::push_str(__local_97, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_97, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_97, 32); + String::push(__local_97, 97); + String::push(__local_97, 116); + String::push(__local_97, 32); + String::push_str(__local_97, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_97, 58); __local_98 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_97 }; i32::fmt_decimal(170, __local_98); - String::append(__local_97, String { repr: array.new_data(" + String::push_str(__local_97, String { repr: array.new_data(" condition: `{-0.5}` == \"-0.5\" "), used: 31 }); break __tmpl: __local_97; @@ -3292,17 +3292,17 @@ condition: `{-0.5}` == \"-0.5\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_101 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_101, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_101, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_101, 32); - String::append_char(__local_101, 97); - String::append_char(__local_101, 116); - String::append_char(__local_101, 32); - String::append(__local_101, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_101, 58); + String::push_str(__local_101, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_101, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_101, 32); + String::push(__local_101, 97); + String::push(__local_101, 116); + String::push(__local_101, 32); + String::push_str(__local_101, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_101, 58); __local_102 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_101 }; i32::fmt_decimal(171, __local_102); - String::append(__local_101, String { repr: array.new_data(" + String::push_str(__local_101, String { repr: array.new_data(" condition: `{100.0}` == \"100\" "), used: 31 }); break __tmpl: __local_101; @@ -3318,17 +3318,17 @@ condition: `{100.0}` == \"100\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_105 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_105, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_105, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_105, 32); - String::append_char(__local_105, 97); - String::append_char(__local_105, 116); - String::append_char(__local_105, 32); - String::append(__local_105, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_105, 58); + String::push_str(__local_105, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_105, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_105, 32); + String::push(__local_105, 97); + String::push(__local_105, 116); + String::push(__local_105, 32); + String::push_str(__local_105, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_105, 58); __local_106 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_105 }; i32::fmt_decimal(172, __local_106); - String::append(__local_105, String { repr: array.new_data(" + String::push_str(__local_105, String { repr: array.new_data(" condition: `{pi:.1}` == \"3.1\" "), used: 31 }); break __tmpl: __local_105; @@ -3344,17 +3344,17 @@ condition: `{pi:.1}` == \"3.1\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_109 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_109, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_109, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_109, 32); - String::append_char(__local_109, 97); - String::append_char(__local_109, 116); - String::append_char(__local_109, 32); - String::append(__local_109, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_109, 58); + String::push_str(__local_109, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_109, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_109, 32); + String::push(__local_109, 97); + String::push(__local_109, 116); + String::push(__local_109, 32); + String::push_str(__local_109, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_109, 58); __local_110 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_109 }; i32::fmt_decimal(173, __local_110); - String::append(__local_109, String { repr: array.new_data(" + String::push_str(__local_109, String { repr: array.new_data(" condition: `{pi:.2}` == \"3.14\" "), used: 32 }); break __tmpl: __local_109; @@ -3370,17 +3370,17 @@ condition: `{pi:.2}` == \"3.14\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_113 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_113, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_113, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_113, 32); - String::append_char(__local_113, 97); - String::append_char(__local_113, 116); - String::append_char(__local_113, 32); - String::append(__local_113, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_113, 58); + String::push_str(__local_113, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_113, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_113, 32); + String::push(__local_113, 97); + String::push(__local_113, 116); + String::push(__local_113, 32); + String::push_str(__local_113, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_113, 58); __local_114 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_113 }; i32::fmt_decimal(174, __local_114); - String::append(__local_113, String { repr: array.new_data(" + String::push_str(__local_113, String { repr: array.new_data(" condition: `{pi:.3}` == \"3.142\" "), used: 33 }); break __tmpl: __local_113; @@ -3396,17 +3396,17 @@ condition: `{pi:.3}` == \"3.142\" if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_117 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_117, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_117, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_117, 32); - String::append_char(__local_117, 97); - String::append_char(__local_117, 116); - String::append_char(__local_117, 32); - String::append(__local_117, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_117, 58); + String::push_str(__local_117, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_117, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_117, 32); + String::push(__local_117, 97); + String::push(__local_117, 116); + String::push(__local_117, 32); + String::push_str(__local_117, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_117, 58); __local_118 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_117 }; i32::fmt_decimal(175, __local_118); - String::append(__local_117, String { repr: array.new_data(" + String::push_str(__local_117, String { repr: array.new_data(" condition: `{pi:.4}` == \"3.1416\" "), used: 34 }); break __tmpl: __local_117; @@ -3422,17 +3422,17 @@ condition: `{pi:.4}` == \"3.1416\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_121 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_121, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_121, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_121, 32); - String::append_char(__local_121, 97); - String::append_char(__local_121, 116); - String::append_char(__local_121, 32); - String::append(__local_121, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_121, 58); + String::push_str(__local_121, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_121, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_121, 32); + String::push(__local_121, 97); + String::push(__local_121, 116); + String::push(__local_121, 32); + String::push_str(__local_121, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_121, 58); __local_122 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_121 }; i32::fmt_decimal(176, __local_122); - String::append(__local_121, String { repr: array.new_data(" + String::push_str(__local_121, String { repr: array.new_data(" condition: `{pi:.5}` == \"3.14159\" "), used: 35 }); break __tmpl: __local_121; @@ -3448,17 +3448,17 @@ condition: `{pi:.5}` == \"3.14159\" if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_125 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_125, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_125, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_125, 32); - String::append_char(__local_125, 97); - String::append_char(__local_125, 116); - String::append_char(__local_125, 32); - String::append(__local_125, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_125, 58); + String::push_str(__local_125, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_125, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_125, 32); + String::push(__local_125, 97); + String::push(__local_125, 116); + String::push(__local_125, 32); + String::push_str(__local_125, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_125, 58); __local_126 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_125 }; i32::fmt_decimal(177, __local_126); - String::append(__local_125, String { repr: array.new_data(" + String::push_str(__local_125, String { repr: array.new_data(" condition: `{pi:.6}` == \"3.141590\" "), used: 36 }); break __tmpl: __local_125; @@ -3474,17 +3474,17 @@ condition: `{pi:.6}` == \"3.141590\" if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_129 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_129, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_129, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_129, 32); - String::append_char(__local_129, 97); - String::append_char(__local_129, 116); - String::append_char(__local_129, 32); - String::append(__local_129, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_129, 58); + String::push_str(__local_129, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_129, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_129, 32); + String::push(__local_129, 97); + String::push(__local_129, 116); + String::push(__local_129, 32); + String::push_str(__local_129, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_129, 58); __local_130 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_129 }; i32::fmt_decimal(178, __local_130); - String::append(__local_129, String { repr: array.new_data(" + String::push_str(__local_129, String { repr: array.new_data(" condition: `{neg:.2}` == \"-2.72\" "), used: 34 }); break __tmpl: __local_129; @@ -3500,17 +3500,17 @@ condition: `{neg:.2}` == \"-2.72\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_133 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_133, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_133, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_133, 32); - String::append_char(__local_133, 97); - String::append_char(__local_133, 116); - String::append_char(__local_133, 32); - String::append(__local_133, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_133, 58); + String::push_str(__local_133, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_133, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_133, 32); + String::push(__local_133, 97); + String::push(__local_133, 116); + String::push(__local_133, 32); + String::push_str(__local_133, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_133, 58); __local_134 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_133 }; i32::fmt_decimal(179, __local_134); - String::append(__local_133, String { repr: array.new_data(" + String::push_str(__local_133, String { repr: array.new_data(" condition: `{neg:.4}` == \"-2.7183\" "), used: 36 }); break __tmpl: __local_133; @@ -3526,17 +3526,17 @@ condition: `{neg:.4}` == \"-2.7183\" if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_137 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_137, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_137, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_137, 32); - String::append_char(__local_137, 97); - String::append_char(__local_137, 116); - String::append_char(__local_137, 32); - String::append(__local_137, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_137, 58); + String::push_str(__local_137, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_137, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_137, 32); + String::push(__local_137, 97); + String::push(__local_137, 116); + String::push(__local_137, 32); + String::push_str(__local_137, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_137, 58); __local_138 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_137 }; i32::fmt_decimal(180, __local_138); - String::append(__local_137, String { repr: array.new_data(" + String::push_str(__local_137, String { repr: array.new_data(" condition: `{0.0:.2}` == \"0.00\" "), used: 33 }); break __tmpl: __local_137; @@ -3552,17 +3552,17 @@ condition: `{0.0:.2}` == \"0.00\" if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_141 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_141, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_141, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_141, 32); - String::append_char(__local_141, 97); - String::append_char(__local_141, 116); - String::append_char(__local_141, 32); - String::append(__local_141, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_141, 58); + String::push_str(__local_141, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_141, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_141, 32); + String::push(__local_141, 97); + String::push(__local_141, 116); + String::push(__local_141, 32); + String::push_str(__local_141, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_141, 58); __local_142 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_141 }; i32::fmt_decimal(181, __local_142); - String::append(__local_141, String { repr: array.new_data(" + String::push_str(__local_141, String { repr: array.new_data(" condition: `{100.0:.2}` == \"100.00\" "), used: 37 }); break __tmpl: __local_141; @@ -3579,17 +3579,17 @@ condition: `{100.0:.2}` == \"100.00\" if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_145 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_145, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_145, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_145, 32); - String::append_char(__local_145, 97); - String::append_char(__local_145, 116); - String::append_char(__local_145, 32); - String::append(__local_145, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_145, 58); + String::push_str(__local_145, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_145, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_145, 32); + String::push(__local_145, 97); + String::push(__local_145, 116); + String::push(__local_145, 32); + String::push_str(__local_145, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_145, 58); __local_146 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_145 }; i32::fmt_decimal(182, __local_146); - String::append(__local_145, String { repr: array.new_data(" + String::push_str(__local_145, String { repr: array.new_data(" condition: `{pi:e}` == \"3.14159e0\" "), used: 36 }); break __tmpl: __local_145; @@ -3606,17 +3606,17 @@ condition: `{pi:e}` == \"3.14159e0\" if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_149 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_149, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_149, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_149, 32); - String::append_char(__local_149, 97); - String::append_char(__local_149, 116); - String::append_char(__local_149, 32); - String::append(__local_149, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_149, 58); + String::push_str(__local_149, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_149, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_149, 32); + String::push(__local_149, 97); + String::push(__local_149, 116); + String::push(__local_149, 32); + String::push_str(__local_149, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_149, 58); __local_150 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_149 }; i32::fmt_decimal(183, __local_150); - String::append(__local_149, String { repr: array.new_data(" + String::push_str(__local_149, String { repr: array.new_data(" condition: `{neg:e}` == \"-2.71828e0\" "), used: 38 }); break __tmpl: __local_149; @@ -3633,17 +3633,17 @@ condition: `{neg:e}` == \"-2.71828e0\" if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_153 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_153, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_153, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_153, 32); - String::append_char(__local_153, 97); - String::append_char(__local_153, 116); - String::append_char(__local_153, 32); - String::append(__local_153, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_153, 58); + String::push_str(__local_153, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_153, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_153, 32); + String::push(__local_153, 97); + String::push(__local_153, 116); + String::push(__local_153, 32); + String::push_str(__local_153, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_153, 58); __local_154 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_153 }; i32::fmt_decimal(184, __local_154); - String::append(__local_153, String { repr: array.new_data(" + String::push_str(__local_153, String { repr: array.new_data(" condition: `{0.0:e}` == \"0e0\" "), used: 31 }); break __tmpl: __local_153; @@ -3660,17 +3660,17 @@ condition: `{0.0:e}` == \"0e0\" if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_157 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_157, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_157, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_157, 32); - String::append_char(__local_157, 97); - String::append_char(__local_157, 116); - String::append_char(__local_157, 32); - String::append(__local_157, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_157, 58); + String::push_str(__local_157, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_157, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_157, 32); + String::push(__local_157, 97); + String::push(__local_157, 116); + String::push(__local_157, 32); + String::push_str(__local_157, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_157, 58); __local_158 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_157 }; i32::fmt_decimal(185, __local_158); - String::append(__local_157, String { repr: array.new_data(" + String::push_str(__local_157, String { repr: array.new_data(" condition: `{1.0:e}` == \"1e0\" "), used: 31 }); break __tmpl: __local_157; @@ -3687,17 +3687,17 @@ condition: `{1.0:e}` == \"1e0\" if __cond_23 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_161 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_161, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_161, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_161, 32); - String::append_char(__local_161, 97); - String::append_char(__local_161, 116); - String::append_char(__local_161, 32); - String::append(__local_161, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_161, 58); + String::push_str(__local_161, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_161, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_161, 32); + String::push(__local_161, 97); + String::push(__local_161, 116); + String::push(__local_161, 32); + String::push_str(__local_161, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_161, 58); __local_162 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_161 }; i32::fmt_decimal(186, __local_162); - String::append(__local_161, String { repr: array.new_data(" + String::push_str(__local_161, String { repr: array.new_data(" condition: `{100.0:e}` == \"1e2\" "), used: 33 }); break __tmpl: __local_161; @@ -3714,17 +3714,17 @@ condition: `{100.0:e}` == \"1e2\" if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_165 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_165, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_165, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_165, 32); - String::append_char(__local_165, 97); - String::append_char(__local_165, 116); - String::append_char(__local_165, 32); - String::append(__local_165, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_165, 58); + String::push_str(__local_165, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_165, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_165, 32); + String::push(__local_165, 97); + String::push(__local_165, 116); + String::push(__local_165, 32); + String::push_str(__local_165, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_165, 58); __local_166 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_165 }; i32::fmt_decimal(188, __local_166); - String::append(__local_165, String { repr: array.new_data(" + String::push_str(__local_165, String { repr: array.new_data(" condition: `{big:e}` == \"1.23e15\" "), used: 35 }); break __tmpl: __local_165; @@ -3741,17 +3741,17 @@ condition: `{big:e}` == \"1.23e15\" if __cond_27 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_169 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_169, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_169, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_169, 32); - String::append_char(__local_169, 97); - String::append_char(__local_169, 116); - String::append_char(__local_169, 32); - String::append(__local_169, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_169, 58); + String::push_str(__local_169, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_169, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_169, 32); + String::push(__local_169, 97); + String::push(__local_169, 116); + String::push(__local_169, 32); + String::push_str(__local_169, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_169, 58); __local_170 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_169 }; i32::fmt_decimal(190, __local_170); - String::append(__local_169, String { repr: array.new_data(" + String::push_str(__local_169, String { repr: array.new_data(" condition: `{small:e}` == \"1.5e-10\" "), used: 37 }); break __tmpl: __local_169; @@ -3768,17 +3768,17 @@ condition: `{small:e}` == \"1.5e-10\" if __cond_28 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_173 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_173, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_173, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_173, 32); - String::append_char(__local_173, 97); - String::append_char(__local_173, 116); - String::append_char(__local_173, 32); - String::append(__local_173, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_173, 58); + String::push_str(__local_173, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_173, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_173, 32); + String::push(__local_173, 97); + String::push(__local_173, 116); + String::push(__local_173, 32); + String::push_str(__local_173, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_173, 58); __local_174 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_173 }; i32::fmt_decimal(191, __local_174); - String::append(__local_173, String { repr: array.new_data(" + String::push_str(__local_173, String { repr: array.new_data(" condition: `{pi:E}` == \"3.14159E0\" "), used: 36 }); break __tmpl: __local_173; @@ -3795,17 +3795,17 @@ condition: `{pi:E}` == \"3.14159E0\" if __cond_29 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_177 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_177, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_177, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_177, 32); - String::append_char(__local_177, 97); - String::append_char(__local_177, 116); - String::append_char(__local_177, 32); - String::append(__local_177, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_177, 58); + String::push_str(__local_177, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_177, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_177, 32); + String::push(__local_177, 97); + String::push(__local_177, 116); + String::push(__local_177, 32); + String::push_str(__local_177, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_177, 58); __local_178 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_177 }; i32::fmt_decimal(192, __local_178); - String::append(__local_177, String { repr: array.new_data(" + String::push_str(__local_177, String { repr: array.new_data(" condition: `{neg:E}` == \"-2.71828E0\" "), used: 38 }); break __tmpl: __local_177; @@ -3822,17 +3822,17 @@ condition: `{neg:E}` == \"-2.71828E0\" if __cond_30 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_181 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_181, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_181, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_181, 32); - String::append_char(__local_181, 97); - String::append_char(__local_181, 116); - String::append_char(__local_181, 32); - String::append(__local_181, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_181, 58); + String::push_str(__local_181, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_181, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_181, 32); + String::push(__local_181, 97); + String::push(__local_181, 116); + String::push(__local_181, 32); + String::push_str(__local_181, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_181, 58); __local_182 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_181 }; i32::fmt_decimal(193, __local_182); - String::append(__local_181, String { repr: array.new_data(" + String::push_str(__local_181, String { repr: array.new_data(" condition: `{0.0:E}` == \"0E0\" "), used: 31 }); break __tmpl: __local_181; @@ -3849,17 +3849,17 @@ condition: `{0.0:E}` == \"0E0\" if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_185 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_185, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_185, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_185, 32); - String::append_char(__local_185, 97); - String::append_char(__local_185, 116); - String::append_char(__local_185, 32); - String::append(__local_185, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_185, 58); + String::push_str(__local_185, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_185, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_185, 32); + String::push(__local_185, 97); + String::push(__local_185, 116); + String::push(__local_185, 32); + String::push_str(__local_185, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_185, 58); __local_186 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_185 }; i32::fmt_decimal(194, __local_186); - String::append(__local_185, String { repr: array.new_data(" + String::push_str(__local_185, String { repr: array.new_data(" condition: `{big:E}` == \"1.23E15\" "), used: 35 }); break __tmpl: __local_185; @@ -3876,17 +3876,17 @@ condition: `{big:E}` == \"1.23E15\" if __cond_32 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_189 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_189, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_189, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_189, 32); - String::append_char(__local_189, 97); - String::append_char(__local_189, 116); - String::append_char(__local_189, 32); - String::append(__local_189, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_189, 58); + String::push_str(__local_189, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_189, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_189, 32); + String::push(__local_189, 97); + String::push(__local_189, 116); + String::push(__local_189, 32); + String::push_str(__local_189, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_189, 58); __local_190 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_189 }; i32::fmt_decimal(195, __local_190); - String::append(__local_189, String { repr: array.new_data(" + String::push_str(__local_189, String { repr: array.new_data(" condition: `{small:E}` == \"1.5E-10\" "), used: 37 }); break __tmpl: __local_189; @@ -3903,17 +3903,17 @@ condition: `{small:E}` == \"1.5E-10\" if __cond_33 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_193 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_193, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_193, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_193, 32); - String::append_char(__local_193, 97); - String::append_char(__local_193, 116); - String::append_char(__local_193, 32); - String::append(__local_193, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_193, 58); + String::push_str(__local_193, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_193, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_193, 32); + String::push(__local_193, 97); + String::push(__local_193, 116); + String::push(__local_193, 32); + String::push_str(__local_193, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_193, 58); __local_194 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_193 }; i32::fmt_decimal(196, __local_194); - String::append(__local_193, String { repr: array.new_data(" + String::push_str(__local_193, String { repr: array.new_data(" condition: `{pi:.1e}` == \"3.1e0\" "), used: 34 }); break __tmpl: __local_193; @@ -3930,17 +3930,17 @@ condition: `{pi:.1e}` == \"3.1e0\" if __cond_34 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_197 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_197, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_197, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_197, 32); - String::append_char(__local_197, 97); - String::append_char(__local_197, 116); - String::append_char(__local_197, 32); - String::append(__local_197, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_197, 58); + String::push_str(__local_197, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_197, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_197, 32); + String::push(__local_197, 97); + String::push(__local_197, 116); + String::push(__local_197, 32); + String::push_str(__local_197, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_197, 58); __local_198 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_197 }; i32::fmt_decimal(197, __local_198); - String::append(__local_197, String { repr: array.new_data(" + String::push_str(__local_197, String { repr: array.new_data(" condition: `{pi:.2e}` == \"3.14e0\" "), used: 35 }); break __tmpl: __local_197; @@ -3957,17 +3957,17 @@ condition: `{pi:.2e}` == \"3.14e0\" if __cond_35 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_201 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_201, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_201, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_201, 32); - String::append_char(__local_201, 97); - String::append_char(__local_201, 116); - String::append_char(__local_201, 32); - String::append(__local_201, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_201, 58); + String::push_str(__local_201, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_201, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_201, 32); + String::push(__local_201, 97); + String::push(__local_201, 116); + String::push(__local_201, 32); + String::push_str(__local_201, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_201, 58); __local_202 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_201 }; i32::fmt_decimal(198, __local_202); - String::append(__local_201, String { repr: array.new_data(" + String::push_str(__local_201, String { repr: array.new_data(" condition: `{pi:.4e}` == \"3.1416e0\" "), used: 37 }); break __tmpl: __local_201; @@ -3984,17 +3984,17 @@ condition: `{pi:.4e}` == \"3.1416e0\" if __cond_36 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_205 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_205, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_205, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_205, 32); - String::append_char(__local_205, 97); - String::append_char(__local_205, 116); - String::append_char(__local_205, 32); - String::append(__local_205, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_205, 58); + String::push_str(__local_205, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_205, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_205, 32); + String::push(__local_205, 97); + String::push(__local_205, 116); + String::push(__local_205, 32); + String::push_str(__local_205, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_205, 58); __local_206 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_205 }; i32::fmt_decimal(199, __local_206); - String::append(__local_205, String { repr: array.new_data(" + String::push_str(__local_205, String { repr: array.new_data(" condition: `{pi:.1E}` == \"3.1E0\" "), used: 34 }); break __tmpl: __local_205; @@ -4011,17 +4011,17 @@ condition: `{pi:.1E}` == \"3.1E0\" if __cond_37 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_209 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_209, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_209, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_209, 32); - String::append_char(__local_209, 97); - String::append_char(__local_209, 116); - String::append_char(__local_209, 32); - String::append(__local_209, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_209, 58); + String::push_str(__local_209, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_209, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_209, 32); + String::push(__local_209, 97); + String::push(__local_209, 116); + String::push(__local_209, 32); + String::push_str(__local_209, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_209, 58); __local_210 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_209 }; i32::fmt_decimal(200, __local_210); - String::append(__local_209, String { repr: array.new_data(" + String::push_str(__local_209, String { repr: array.new_data(" condition: `{pi:.2E}` == \"3.14E0\" "), used: 35 }); break __tmpl: __local_209; @@ -4038,17 +4038,17 @@ condition: `{pi:.2E}` == \"3.14E0\" if __cond_38 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_213 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_213, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_213, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_213, 32); - String::append_char(__local_213, 97); - String::append_char(__local_213, 116); - String::append_char(__local_213, 32); - String::append(__local_213, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_213, 58); + String::push_str(__local_213, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_213, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_213, 32); + String::push(__local_213, 97); + String::push(__local_213, 116); + String::push(__local_213, 32); + String::push_str(__local_213, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_213, 58); __local_214 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_213 }; i32::fmt_decimal(201, __local_214); - String::append(__local_213, String { repr: array.new_data(" + String::push_str(__local_213, String { repr: array.new_data(" condition: `{neg:.2e}` == \"-2.72e0\" "), used: 37 }); break __tmpl: __local_213; @@ -4065,17 +4065,17 @@ condition: `{neg:.2e}` == \"-2.72e0\" if __cond_39 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_217 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_217, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_217, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_217, 32); - String::append_char(__local_217, 97); - String::append_char(__local_217, 116); - String::append_char(__local_217, 32); - String::append(__local_217, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_217, 58); + String::push_str(__local_217, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_217, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_217, 32); + String::push(__local_217, 97); + String::push(__local_217, 116); + String::push(__local_217, 32); + String::push_str(__local_217, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_217, 58); __local_218 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_217 }; i32::fmt_decimal(202, __local_218); - String::append(__local_217, String { repr: array.new_data(" + String::push_str(__local_217, String { repr: array.new_data(" condition: `{big:.1e}` == \"1.2e15\" "), used: 36 }); break __tmpl: __local_217; @@ -4092,17 +4092,17 @@ condition: `{big:.1e}` == \"1.2e15\" if __cond_40 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_221 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_221, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_221, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_221, 32); - String::append_char(__local_221, 97); - String::append_char(__local_221, 116); - String::append_char(__local_221, 32); - String::append(__local_221, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_221, 58); + String::push_str(__local_221, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_221, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_221, 32); + String::push(__local_221, 97); + String::push(__local_221, 116); + String::push(__local_221, 32); + String::push_str(__local_221, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_221, 58); __local_222 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_221 }; i32::fmt_decimal(203, __local_222); - String::append(__local_221, String { repr: array.new_data(" + String::push_str(__local_221, String { repr: array.new_data(" condition: `{big:.2e}` == \"1.23e15\" "), used: 37 }); break __tmpl: __local_221; @@ -4119,17 +4119,17 @@ condition: `{big:.2e}` == \"1.23e15\" if __cond_41 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_225 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_225, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_225, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_225, 32); - String::append_char(__local_225, 97); - String::append_char(__local_225, 116); - String::append_char(__local_225, 32); - String::append(__local_225, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_225, 58); + String::push_str(__local_225, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_225, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_225, 32); + String::push(__local_225, 97); + String::push(__local_225, 116); + String::push(__local_225, 32); + String::push_str(__local_225, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_225, 58); __local_226 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_225 }; i32::fmt_decimal(204, __local_226); - String::append(__local_225, String { repr: array.new_data(" + String::push_str(__local_225, String { repr: array.new_data(" condition: `{small:.3e}` == \"1.500e-10\" "), used: 41 }); break __tmpl: __local_225; @@ -4146,17 +4146,17 @@ condition: `{small:.3e}` == \"1.500e-10\" if __cond_42 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_229 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_229, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_229, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_229, 32); - String::append_char(__local_229, 97); - String::append_char(__local_229, 116); - String::append_char(__local_229, 32); - String::append(__local_229, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_229, 58); + String::push_str(__local_229, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_229, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_229, 32); + String::push(__local_229, 97); + String::push(__local_229, 116); + String::push(__local_229, 32); + String::push_str(__local_229, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_229, 58); __local_230 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_229 }; i32::fmt_decimal(205, __local_230); - String::append(__local_229, String { repr: array.new_data(" + String::push_str(__local_229, String { repr: array.new_data(" condition: `{0.0:.2e}` == \"0.00e0\" "), used: 36 }); break __tmpl: __local_229; @@ -4173,17 +4173,17 @@ condition: `{0.0:.2e}` == \"0.00e0\" if __cond_44 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_233 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_233, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_233, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_233, 32); - String::append_char(__local_233, 97); - String::append_char(__local_233, 116); - String::append_char(__local_233, 32); - String::append(__local_233, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_233, 58); + String::push_str(__local_233, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_233, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_233, 32); + String::push(__local_233, 97); + String::push(__local_233, 116); + String::push(__local_233, 32); + String::push_str(__local_233, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_233, 58); __local_234 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_233 }; i32::fmt_decimal(207, __local_234); - String::append(__local_233, String { repr: array.new_data(" + String::push_str(__local_233, String { repr: array.new_data(" condition: `{large:e}` == \"1.23456789e5\" "), used: 42 }); break __tmpl: __local_233; @@ -4200,17 +4200,17 @@ condition: `{large:e}` == \"1.23456789e5\" if __cond_45 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_237 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_237, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_237, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_237, 32); - String::append_char(__local_237, 97); - String::append_char(__local_237, 116); - String::append_char(__local_237, 32); - String::append(__local_237, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_237, 58); + String::push_str(__local_237, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_237, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_237, 32); + String::push(__local_237, 97); + String::push(__local_237, 116); + String::push(__local_237, 32); + String::push_str(__local_237, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_237, 58); __local_238 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_237 }; i32::fmt_decimal(208, __local_238); - String::append(__local_237, String { repr: array.new_data(" + String::push_str(__local_237, String { repr: array.new_data(" condition: `{large:.1e}` == \"1.2e5\" "), used: 37 }); break __tmpl: __local_237; @@ -4227,17 +4227,17 @@ condition: `{large:.1e}` == \"1.2e5\" if __cond_46 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_241 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_241, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_241, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_241, 32); - String::append_char(__local_241, 97); - String::append_char(__local_241, 116); - String::append_char(__local_241, 32); - String::append(__local_241, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_241, 58); + String::push_str(__local_241, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_241, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_241, 32); + String::push(__local_241, 97); + String::push(__local_241, 116); + String::push(__local_241, 32); + String::push_str(__local_241, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_241, 58); __local_242 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_241 }; i32::fmt_decimal(209, __local_242); - String::append(__local_241, String { repr: array.new_data(" + String::push_str(__local_241, String { repr: array.new_data(" condition: `{large:.4e}` == \"1.2346e5\" "), used: 40 }); break __tmpl: __local_241; @@ -4253,17 +4253,17 @@ condition: `{large:.4e}` == \"1.2346e5\" if __cond_47 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_245 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_245, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_245, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_245, 32); - String::append_char(__local_245, 97); - String::append_char(__local_245, 116); - String::append_char(__local_245, 32); - String::append(__local_245, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_245, 58); + String::push_str(__local_245, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_245, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_245, 32); + String::push(__local_245, 97); + String::push(__local_245, 116); + String::push(__local_245, 32); + String::push_str(__local_245, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_245, 58); __local_246 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_245 }; i32::fmt_decimal(210, __local_246); - String::append(__local_245, String { repr: array.new_data(" + String::push_str(__local_245, String { repr: array.new_data(" condition: `{pi:10.2}` == \" 3.14\" "), used: 40 }); break __tmpl: __local_245; @@ -4279,17 +4279,17 @@ condition: `{pi:10.2}` == \" 3.14\" if __cond_48 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_249 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_249, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_249, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_249, 32); - String::append_char(__local_249, 97); - String::append_char(__local_249, 116); - String::append_char(__local_249, 32); - String::append(__local_249, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_249, 58); + String::push_str(__local_249, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_249, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_249, 32); + String::push(__local_249, 97); + String::push(__local_249, 116); + String::push(__local_249, 32); + String::push_str(__local_249, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_249, 58); __local_250 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_249 }; i32::fmt_decimal(211, __local_250); - String::append(__local_249, String { repr: array.new_data(" + String::push_str(__local_249, String { repr: array.new_data(" condition: `{pi:<10.2}` == \"3.14 \" "), used: 41 }); break __tmpl: __local_249; @@ -4305,17 +4305,17 @@ condition: `{pi:<10.2}` == \"3.14 \" if __cond_49 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_253 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_253, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_253, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_253, 32); - String::append_char(__local_253, 97); - String::append_char(__local_253, 116); - String::append_char(__local_253, 32); - String::append(__local_253, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_253, 58); + String::push_str(__local_253, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_253, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_253, 32); + String::push(__local_253, 97); + String::push(__local_253, 116); + String::push(__local_253, 32); + String::push_str(__local_253, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_253, 58); __local_254 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_253 }; i32::fmt_decimal(212, __local_254); - String::append(__local_253, String { repr: array.new_data(" + String::push_str(__local_253, String { repr: array.new_data(" condition: `{pi:^10.2}` == \" 3.14 \" "), used: 41 }); break __tmpl: __local_253; @@ -4331,17 +4331,17 @@ condition: `{pi:^10.2}` == \" 3.14 \" if __cond_50 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_257 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_257, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_257, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_257, 32); - String::append_char(__local_257, 97); - String::append_char(__local_257, 116); - String::append_char(__local_257, 32); - String::append(__local_257, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_257, 58); + String::push_str(__local_257, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_257, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_257, 32); + String::push(__local_257, 97); + String::push(__local_257, 116); + String::push(__local_257, 32); + String::push_str(__local_257, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_257, 58); __local_258 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_257 }; i32::fmt_decimal(213, __local_258); - String::append(__local_257, String { repr: array.new_data(" + String::push_str(__local_257, String { repr: array.new_data(" condition: `{pi:*>10.2}` == \"******3.14\" "), used: 42 }); break __tmpl: __local_257; @@ -4357,17 +4357,17 @@ condition: `{pi:*>10.2}` == \"******3.14\" if __cond_51 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_261 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_261, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_261, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_261, 32); - String::append_char(__local_261, 97); - String::append_char(__local_261, 116); - String::append_char(__local_261, 32); - String::append(__local_261, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_261, 58); + String::push_str(__local_261, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_261, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_261, 32); + String::push(__local_261, 97); + String::push(__local_261, 116); + String::push(__local_261, 32); + String::push_str(__local_261, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_261, 58); __local_262 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_261 }; i32::fmt_decimal(214, __local_262); - String::append(__local_261, String { repr: array.new_data(" + String::push_str(__local_261, String { repr: array.new_data(" condition: `{pi:*<10.2}` == \"3.14******\" "), used: 42 }); break __tmpl: __local_261; @@ -4383,17 +4383,17 @@ condition: `{pi:*<10.2}` == \"3.14******\" if __cond_52 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_265 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_265, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_265, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_265, 32); - String::append_char(__local_265, 97); - String::append_char(__local_265, 116); - String::append_char(__local_265, 32); - String::append(__local_265, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_265, 58); + String::push_str(__local_265, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_265, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_265, 32); + String::push(__local_265, 97); + String::push(__local_265, 116); + String::push(__local_265, 32); + String::push_str(__local_265, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_265, 58); __local_266 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_265 }; i32::fmt_decimal(215, __local_266); - String::append(__local_265, String { repr: array.new_data(" + String::push_str(__local_265, String { repr: array.new_data(" condition: `{pi:*^10.2}` == \"***3.14***\" "), used: 42 }); break __tmpl: __local_265; @@ -4409,17 +4409,17 @@ condition: `{pi:*^10.2}` == \"***3.14***\" if __cond_53 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_269 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_269, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_269, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_269, 32); - String::append_char(__local_269, 97); - String::append_char(__local_269, 116); - String::append_char(__local_269, 32); - String::append(__local_269, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_269, 58); + String::push_str(__local_269, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_269, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_269, 32); + String::push(__local_269, 97); + String::push(__local_269, 116); + String::push(__local_269, 32); + String::push_str(__local_269, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_269, 58); __local_270 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_269 }; i32::fmt_decimal(216, __local_270); - String::append(__local_269, String { repr: array.new_data(" + String::push_str(__local_269, String { repr: array.new_data(" condition: `{pi:>15}` == \" 3.14159\" "), used: 44 }); break __tmpl: __local_269; @@ -4435,17 +4435,17 @@ condition: `{pi:>15}` == \" 3.14159\" if __cond_54 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_273 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_273, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_273, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_273, 32); - String::append_char(__local_273, 97); - String::append_char(__local_273, 116); - String::append_char(__local_273, 32); - String::append(__local_273, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_273, 58); + String::push_str(__local_273, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_273, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_273, 32); + String::push(__local_273, 97); + String::push(__local_273, 116); + String::push(__local_273, 32); + String::push_str(__local_273, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_273, 58); __local_274 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_273 }; i32::fmt_decimal(217, __local_274); - String::append(__local_273, String { repr: array.new_data(" + String::push_str(__local_273, String { repr: array.new_data(" condition: `{pi:<15}` == \"3.14159 \" "), used: 44 }); break __tmpl: __local_273; @@ -4462,17 +4462,17 @@ condition: `{pi:<15}` == \"3.14159 \" if __cond_55 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_277 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_277, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_277, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_277, 32); - String::append_char(__local_277, 97); - String::append_char(__local_277, 116); - String::append_char(__local_277, 32); - String::append(__local_277, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_277, 58); + String::push_str(__local_277, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_277, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_277, 32); + String::push(__local_277, 97); + String::push(__local_277, 116); + String::push(__local_277, 32); + String::push_str(__local_277, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_277, 58); __local_278 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_277 }; i32::fmt_decimal(218, __local_278); - String::append(__local_277, String { repr: array.new_data(" + String::push_str(__local_277, String { repr: array.new_data(" condition: `{pi:>15e}` == \" 3.14159e0\" "), used: 45 }); break __tmpl: __local_277; @@ -4489,17 +4489,17 @@ condition: `{pi:>15e}` == \" 3.14159e0\" if __cond_56 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_281 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_281, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_281, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_281, 32); - String::append_char(__local_281, 97); - String::append_char(__local_281, 116); - String::append_char(__local_281, 32); - String::append(__local_281, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_281, 58); + String::push_str(__local_281, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_281, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_281, 32); + String::push(__local_281, 97); + String::push(__local_281, 116); + String::push(__local_281, 32); + String::push_str(__local_281, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_281, 58); __local_282 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_281 }; i32::fmt_decimal(219, __local_282); - String::append(__local_281, String { repr: array.new_data(" + String::push_str(__local_281, String { repr: array.new_data(" condition: `{pi:<15e}` == \"3.14159e0 \" "), used: 45 }); break __tmpl: __local_281; @@ -4516,17 +4516,17 @@ condition: `{pi:<15e}` == \"3.14159e0 \" if __cond_57 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_285 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_285, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_285, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_285, 32); - String::append_char(__local_285, 97); - String::append_char(__local_285, 116); - String::append_char(__local_285, 32); - String::append(__local_285, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_285, 58); + String::push_str(__local_285, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_285, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_285, 32); + String::push(__local_285, 97); + String::push(__local_285, 116); + String::push(__local_285, 32); + String::push_str(__local_285, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_285, 58); __local_286 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_285 }; i32::fmt_decimal(220, __local_286); - String::append(__local_285, String { repr: array.new_data(" + String::push_str(__local_285, String { repr: array.new_data(" condition: `{neg:>15e}` == \" -2.71828e0\" "), used: 46 }); break __tmpl: __local_285; @@ -4543,17 +4543,17 @@ condition: `{neg:>15e}` == \" -2.71828e0\" if __cond_58 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_289 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_289, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_289, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_289, 32); - String::append_char(__local_289, 97); - String::append_char(__local_289, 116); - String::append_char(__local_289, 32); - String::append(__local_289, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_289, 58); + String::push_str(__local_289, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_289, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_289, 32); + String::push(__local_289, 97); + String::push(__local_289, 116); + String::push(__local_289, 32); + String::push_str(__local_289, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_289, 58); __local_290 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_289 }; i32::fmt_decimal(221, __local_290); - String::append(__local_289, String { repr: array.new_data(" + String::push_str(__local_289, String { repr: array.new_data(" condition: `{neg:<15e}` == \"-2.71828e0 \" "), used: 46 }); break __tmpl: __local_289; @@ -4570,17 +4570,17 @@ condition: `{neg:<15e}` == \"-2.71828e0 \" if __cond_60 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_293 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_293, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_293, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_293, 32); - String::append_char(__local_293, 97); - String::append_char(__local_293, 116); - String::append_char(__local_293, 32); - String::append(__local_293, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_293, 58); + String::push_str(__local_293, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_293, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_293, 32); + String::push(__local_293, 97); + String::push(__local_293, 116); + String::push(__local_293, 32); + String::push_str(__local_293, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_293, 58); __local_294 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_293 }; i32::fmt_decimal(223, __local_294); - String::append(__local_293, String { repr: array.new_data(" + String::push_str(__local_293, String { repr: array.new_data(" condition: `{f:.2}` == \"3.14\" "), used: 31 }); break __tmpl: __local_293; @@ -4596,17 +4596,17 @@ condition: `{f:.2}` == \"3.14\" if __cond_61 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_297 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_297, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_297, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_297, 32); - String::append_char(__local_297, 97); - String::append_char(__local_297, 116); - String::append_char(__local_297, 32); - String::append(__local_297, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_297, 58); + String::push_str(__local_297, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_297, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_297, 32); + String::push(__local_297, 97); + String::push(__local_297, 116); + String::push(__local_297, 32); + String::push_str(__local_297, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_297, 58); __local_298 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_297 }; i32::fmt_decimal(224, __local_298); - String::append(__local_297, String { repr: array.new_data(" + String::push_str(__local_297, String { repr: array.new_data(" condition: `{f:.4}` == \"3.1400\" "), used: 33 }); break __tmpl: __local_297; @@ -4623,17 +4623,17 @@ condition: `{f:.4}` == \"3.1400\" if __cond_63 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_301 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_301, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_301, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_301, 32); - String::append_char(__local_301, 97); - String::append_char(__local_301, 116); - String::append_char(__local_301, 32); - String::append(__local_301, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_301, 58); + String::push_str(__local_301, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_301, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_301, 32); + String::push(__local_301, 97); + String::push(__local_301, 116); + String::push(__local_301, 32); + String::push_str(__local_301, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_301, 58); __local_302 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_301 }; i32::fmt_decimal(226, __local_302); - String::append(__local_301, String { repr: array.new_data(" + String::push_str(__local_301, String { repr: array.new_data(" condition: `{f2:.1}` == \"2.5\" "), used: 31 }); break __tmpl: __local_301; @@ -4649,17 +4649,17 @@ condition: `{f2:.1}` == \"2.5\" if __cond_64 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_305 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_305, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_305, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_305, 32); - String::append_char(__local_305, 97); - String::append_char(__local_305, 116); - String::append_char(__local_305, 32); - String::append(__local_305, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_305, 58); + String::push_str(__local_305, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_305, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_305, 32); + String::push(__local_305, 97); + String::push(__local_305, 116); + String::push(__local_305, 32); + String::push_str(__local_305, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_305, 58); __local_306 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_305 }; i32::fmt_decimal(227, __local_306); - String::append(__local_305, String { repr: array.new_data(" + String::push_str(__local_305, String { repr: array.new_data(" condition: `{f2:.3}` == \"2.500\" "), used: 33 }); break __tmpl: __local_305; @@ -4678,17 +4678,17 @@ condition: `{f2:.3}` == \"2.500\" if __cond_65 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_309 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_309, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_309, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_309, 32); - String::append_char(__local_309, 97); - String::append_char(__local_309, 116); - String::append_char(__local_309, 32); - String::append(__local_309, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_309, 58); + String::push_str(__local_309, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_309, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_309, 32); + String::push(__local_309, 97); + String::push(__local_309, 116); + String::push(__local_309, 32); + String::push_str(__local_309, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_309, 58); __local_310 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_309 }; i32::fmt_decimal(228, __local_310); - String::append(__local_309, String { repr: array.new_data(" + String::push_str(__local_309, String { repr: array.new_data(" condition: `{f2:.1e}` == \"2.5e0\" "), used: 34 }); break __tmpl: __local_309; @@ -4707,17 +4707,17 @@ condition: `{f2:.1e}` == \"2.5e0\" if __cond_66 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_313 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_313, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_313, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_313, 32); - String::append_char(__local_313, 97); - String::append_char(__local_313, 116); - String::append_char(__local_313, 32); - String::append(__local_313, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_313, 58); + String::push_str(__local_313, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_313, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_313, 32); + String::push(__local_313, 97); + String::push(__local_313, 116); + String::push(__local_313, 32); + String::push_str(__local_313, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_313, 58); __local_314 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_313 }; i32::fmt_decimal(229, __local_314); - String::append(__local_313, String { repr: array.new_data(" + String::push_str(__local_313, String { repr: array.new_data(" condition: `{f2:.1E}` == \"2.5E0\" "), used: 34 }); break __tmpl: __local_313; @@ -4736,17 +4736,17 @@ condition: `{f2:.1E}` == \"2.5E0\" if __cond_67 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_317 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_317, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_317, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_317, 32); - String::append_char(__local_317, 97); - String::append_char(__local_317, 116); - String::append_char(__local_317, 32); - String::append(__local_317, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_317, 58); + String::push_str(__local_317, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_317, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_317, 32); + String::push(__local_317, 97); + String::push(__local_317, 116); + String::push(__local_317, 32); + String::push_str(__local_317, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_317, 58); __local_318 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_317 }; i32::fmt_decimal(230, __local_318); - String::append(__local_317, String { repr: array.new_data(" + String::push_str(__local_317, String { repr: array.new_data(" condition: `{f2:e}` == \"2.5e0\" "), used: 32 }); break __tmpl: __local_317; @@ -4763,17 +4763,17 @@ condition: `{f2:e}` == \"2.5e0\" if __cond_69 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_321 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_321, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_321, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_321, 32); - String::append_char(__local_321, 97); - String::append_char(__local_321, 116); - String::append_char(__local_321, 32); - String::append(__local_321, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_321, 58); + String::push_str(__local_321, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_321, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_321, 32); + String::push(__local_321, 97); + String::push(__local_321, 116); + String::push(__local_321, 32); + String::push_str(__local_321, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_321, 58); __local_322 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_321 }; i32::fmt_decimal(232, __local_322); - String::append(__local_321, String { repr: array.new_data(" + String::push_str(__local_321, String { repr: array.new_data(" condition: `{fz:.2}` == \"0.00\" "), used: 32 }); break __tmpl: __local_321; @@ -4792,17 +4792,17 @@ condition: `{fz:.2}` == \"0.00\" if __cond_70 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_325 = String { repr: builtin::array_new(103), used: 0 }; - String::append(__local_325, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_325, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_325, 32); - String::append_char(__local_325, 97); - String::append_char(__local_325, 116); - String::append_char(__local_325, 32); - String::append(__local_325, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_325, 58); + String::push_str(__local_325, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_325, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_325, 32); + String::push(__local_325, 97); + String::push(__local_325, 116); + String::push(__local_325, 32); + String::push_str(__local_325, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_325, 58); __local_326 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_325 }; i32::fmt_decimal(233, __local_326); - String::append(__local_325, String { repr: array.new_data(" + String::push_str(__local_325, String { repr: array.new_data(" condition: `{fz:e}` == \"0e0\" "), used: 30 }); break __tmpl: __local_325; @@ -4819,17 +4819,17 @@ condition: `{fz:e}` == \"0e0\" if __cond_71 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_329 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_329, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_329, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_329, 32); - String::append_char(__local_329, 97); - String::append_char(__local_329, 116); - String::append_char(__local_329, 32); - String::append(__local_329, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_329, 58); + String::push_str(__local_329, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_329, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_329, 32); + String::push(__local_329, 97); + String::push(__local_329, 116); + String::push(__local_329, 32); + String::push_str(__local_329, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_329, 58); __local_330 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_329 }; i32::fmt_decimal(234, __local_330); - String::append(__local_329, String { repr: array.new_data(" + String::push_str(__local_329, String { repr: array.new_data(" condition: `{pi:.0e}` == \"3e0\" "), used: 32 }); break __tmpl: __local_329; @@ -4846,17 +4846,17 @@ condition: `{pi:.0e}` == \"3e0\" if __cond_72 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_333 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_333, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_333, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_333, 32); - String::append_char(__local_333, 97); - String::append_char(__local_333, 116); - String::append_char(__local_333, 32); - String::append(__local_333, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_333, 58); + String::push_str(__local_333, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_333, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_333, 32); + String::push(__local_333, 97); + String::push(__local_333, 116); + String::push(__local_333, 32); + String::push_str(__local_333, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_333, 58); __local_334 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_333 }; i32::fmt_decimal(235, __local_334); - String::append(__local_333, String { repr: array.new_data(" + String::push_str(__local_333, String { repr: array.new_data(" condition: `{large:.0e}` == \"1e5\" "), used: 35 }); break __tmpl: __local_333; @@ -4872,17 +4872,17 @@ condition: `{large:.0e}` == \"1e5\" if __cond_73 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_337 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_337, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_337, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_337, 32); - String::append_char(__local_337, 97); - String::append_char(__local_337, 116); - String::append_char(__local_337, 32); - String::append(__local_337, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_337, 58); + String::push_str(__local_337, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_337, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_337, 32); + String::push(__local_337, 97); + String::push(__local_337, 116); + String::push(__local_337, 32); + String::push_str(__local_337, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_337, 58); __local_338 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_337 }; i32::fmt_decimal(236, __local_338); - String::append(__local_337, String { repr: array.new_data(" + String::push_str(__local_337, String { repr: array.new_data(" condition: `{-0.0:.2}` == \"-0.00\" "), used: 35 }); break __tmpl: __local_337; @@ -4898,17 +4898,17 @@ condition: `{-0.0:.2}` == \"-0.00\" if __cond_74 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_341 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_341, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_341, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); - String::append_char(__local_341, 32); - String::append_char(__local_341, 97); - String::append_char(__local_341, 116); - String::append_char(__local_341, 32); - String::append(__local_341, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); - String::append_char(__local_341, 58); + String::push_str(__local_341, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_341, String { repr: array.new_data("test_template_specifiers_float"), used: 30 }); + String::push(__local_341, 32); + String::push(__local_341, 97); + String::push(__local_341, 116); + String::push(__local_341, 32); + String::push_str(__local_341, String { repr: array.new_data("wado-compiler/tests/fixtures/display_2.wado"), used: 43 }); + String::push(__local_341, 58); __local_342 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_341 }; i32::fmt_decimal(237, __local_342); - String::append(__local_341, String { repr: array.new_data(" + String::push_str(__local_341, String { repr: array.new_data(" condition: `{1.0:.10}` == \"1.0000000000\" "), used: 42 }); break __tmpl: __local_341; @@ -5121,1110 +5121,1110 @@ fn test_fts_precision() with Stdout { let __local_209: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_10, 97); - String::append_char(__local_10, 95); - String::append_char(__local_10, 49); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 95); + String::push(__local_10, 49); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_10 }; f64::fmt_into(0.582307589706, __local_11); break __tmpl: __local_10; }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_12, 97); - String::append_char(__local_12, 95); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 95); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 2, indent: 0, buf: __local_12 }; f64::fmt_into(0.582307589706, __local_13); break __tmpl: __local_12; }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_14, 97); - String::append_char(__local_14, 95); - String::append_char(__local_14, 51); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 95); + String::push(__local_14, 51); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 3, indent: 0, buf: __local_14 }; f64::fmt_into(0.582307589706, __local_15); break __tmpl: __local_14; }); "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_16, 97); - String::append_char(__local_16, 95); - String::append_char(__local_16, 52); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 95); + String::push(__local_16, 52); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 4, indent: 0, buf: __local_16 }; f64::fmt_into(0.582307589706, __local_17); break __tmpl: __local_16; }); "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_18, 97); - String::append_char(__local_18, 95); - String::append_char(__local_18, 53); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 95); + String::push(__local_18, 53); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 5, indent: 0, buf: __local_18 }; f64::fmt_into(0.582307589706, __local_19); break __tmpl: __local_18; }); "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_20, 97); - String::append_char(__local_20, 95); - String::append_char(__local_20, 54); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 95); + String::push(__local_20, 54); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 6, indent: 0, buf: __local_20 }; f64::fmt_into(0.582307589706, __local_21); break __tmpl: __local_20; }); "core:cli/println"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_22, 97); - String::append_char(__local_22, 95); - String::append_char(__local_22, 55); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 95); + String::push(__local_22, 55); + String::push(__local_22, 58); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 7, indent: 0, buf: __local_22 }; f64::fmt_into(0.582307589706, __local_23); break __tmpl: __local_22; }); "core:cli/println"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_24, 97); - String::append_char(__local_24, 95); - String::append_char(__local_24, 56); - String::append_char(__local_24, 58); - String::append_char(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 95); + String::push(__local_24, 56); + String::push(__local_24, 58); + String::push(__local_24, 32); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 8, indent: 0, buf: __local_24 }; f64::fmt_into(0.582307589706, __local_25); break __tmpl: __local_24; }); "core:cli/println"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_26, 97); - String::append_char(__local_26, 95); - String::append_char(__local_26, 57); - String::append_char(__local_26, 58); - String::append_char(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 95); + String::push(__local_26, 57); + String::push(__local_26, 58); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 9, indent: 0, buf: __local_26 }; f64::fmt_into(0.582307589706, __local_27); break __tmpl: __local_26; }); "core:cli/println"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_28, 97); - String::append_char(__local_28, 95); - String::append_char(__local_28, 49); - String::append_char(__local_28, 48); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 95); + String::push(__local_28, 49); + String::push(__local_28, 48); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 10, indent: 0, buf: __local_28 }; f64::fmt_into(0.582307589706, __local_29); break __tmpl: __local_28; }); "core:cli/println"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_30, 98); - String::append_char(__local_30, 95); - String::append_char(__local_30, 49); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 98); + String::push(__local_30, 95); + String::push(__local_30, 49); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_30 }; f64::fmt_into(0.001234567, __local_31); break __tmpl: __local_30; }); "core:cli/println"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_32, 98); - String::append_char(__local_32, 95); - String::append_char(__local_32, 50); - String::append_char(__local_32, 58); - String::append_char(__local_32, 32); + String::push(__local_32, 98); + String::push(__local_32, 95); + String::push(__local_32, 50); + String::push(__local_32, 58); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 2, indent: 0, buf: __local_32 }; f64::fmt_into(0.001234567, __local_33); break __tmpl: __local_32; }); "core:cli/println"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_34, 98); - String::append_char(__local_34, 95); - String::append_char(__local_34, 51); - String::append_char(__local_34, 58); - String::append_char(__local_34, 32); + String::push(__local_34, 98); + String::push(__local_34, 95); + String::push(__local_34, 51); + String::push(__local_34, 58); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 3, indent: 0, buf: __local_34 }; f64::fmt_into(0.001234567, __local_35); break __tmpl: __local_34; }); "core:cli/println"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_36, 98); - String::append_char(__local_36, 95); - String::append_char(__local_36, 52); - String::append_char(__local_36, 58); - String::append_char(__local_36, 32); + String::push(__local_36, 98); + String::push(__local_36, 95); + String::push(__local_36, 52); + String::push(__local_36, 58); + String::push(__local_36, 32); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 4, indent: 0, buf: __local_36 }; f64::fmt_into(0.001234567, __local_37); break __tmpl: __local_36; }); "core:cli/println"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_38, 98); - String::append_char(__local_38, 95); - String::append_char(__local_38, 53); - String::append_char(__local_38, 58); - String::append_char(__local_38, 32); + String::push(__local_38, 98); + String::push(__local_38, 95); + String::push(__local_38, 53); + String::push(__local_38, 58); + String::push(__local_38, 32); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 5, indent: 0, buf: __local_38 }; f64::fmt_into(0.001234567, __local_39); break __tmpl: __local_38; }); "core:cli/println"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_40, 98); - String::append_char(__local_40, 95); - String::append_char(__local_40, 54); - String::append_char(__local_40, 58); - String::append_char(__local_40, 32); + String::push(__local_40, 98); + String::push(__local_40, 95); + String::push(__local_40, 54); + String::push(__local_40, 58); + String::push(__local_40, 32); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 6, indent: 0, buf: __local_40 }; f64::fmt_into(0.001234567, __local_41); break __tmpl: __local_40; }); "core:cli/println"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_42, 98); - String::append_char(__local_42, 95); - String::append_char(__local_42, 55); - String::append_char(__local_42, 58); - String::append_char(__local_42, 32); + String::push(__local_42, 98); + String::push(__local_42, 95); + String::push(__local_42, 55); + String::push(__local_42, 58); + String::push(__local_42, 32); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 7, indent: 0, buf: __local_42 }; f64::fmt_into(0.001234567, __local_43); break __tmpl: __local_42; }); "core:cli/println"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_44, 98); - String::append_char(__local_44, 95); - String::append_char(__local_44, 56); - String::append_char(__local_44, 58); - String::append_char(__local_44, 32); + String::push(__local_44, 98); + String::push(__local_44, 95); + String::push(__local_44, 56); + String::push(__local_44, 58); + String::push(__local_44, 32); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 8, indent: 0, buf: __local_44 }; f64::fmt_into(0.001234567, __local_45); break __tmpl: __local_44; }); "core:cli/println"(__tmpl: block -> ref String { __local_46 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_46, 98); - String::append_char(__local_46, 95); - String::append_char(__local_46, 57); - String::append_char(__local_46, 58); - String::append_char(__local_46, 32); + String::push(__local_46, 98); + String::push(__local_46, 95); + String::push(__local_46, 57); + String::push(__local_46, 58); + String::push(__local_46, 32); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 9, indent: 0, buf: __local_46 }; f64::fmt_into(0.001234567, __local_47); break __tmpl: __local_46; }); "core:cli/println"(__tmpl: block -> ref String { __local_48 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_48, 98); - String::append_char(__local_48, 95); - String::append_char(__local_48, 49); - String::append_char(__local_48, 48); - String::append_char(__local_48, 58); - String::append_char(__local_48, 32); + String::push(__local_48, 98); + String::push(__local_48, 95); + String::push(__local_48, 49); + String::push(__local_48, 48); + String::push(__local_48, 58); + String::push(__local_48, 32); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 10, indent: 0, buf: __local_48 }; f64::fmt_into(0.001234567, __local_49); break __tmpl: __local_48; }); "core:cli/println"(__tmpl: block -> ref String { __local_50 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_50, 99); - String::append_char(__local_50, 95); - String::append_char(__local_50, 49); - String::append_char(__local_50, 58); - String::append_char(__local_50, 32); + String::push(__local_50, 99); + String::push(__local_50, 95); + String::push(__local_50, 49); + String::push(__local_50, 58); + String::push(__local_50, 32); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_50 }; f64::fmt_into(3.14159265358979, __local_51); break __tmpl: __local_50; }); "core:cli/println"(__tmpl: block -> ref String { __local_52 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_52, 99); - String::append_char(__local_52, 95); - String::append_char(__local_52, 50); - String::append_char(__local_52, 58); - String::append_char(__local_52, 32); + String::push(__local_52, 99); + String::push(__local_52, 95); + String::push(__local_52, 50); + String::push(__local_52, 58); + String::push(__local_52, 32); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 2, indent: 0, buf: __local_52 }; f64::fmt_into(3.14159265358979, __local_53); break __tmpl: __local_52; }); "core:cli/println"(__tmpl: block -> ref String { __local_54 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_54, 99); - String::append_char(__local_54, 95); - String::append_char(__local_54, 51); - String::append_char(__local_54, 58); - String::append_char(__local_54, 32); + String::push(__local_54, 99); + String::push(__local_54, 95); + String::push(__local_54, 51); + String::push(__local_54, 58); + String::push(__local_54, 32); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 3, indent: 0, buf: __local_54 }; f64::fmt_into(3.14159265358979, __local_55); break __tmpl: __local_54; }); "core:cli/println"(__tmpl: block -> ref String { __local_56 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_56, 99); - String::append_char(__local_56, 95); - String::append_char(__local_56, 52); - String::append_char(__local_56, 58); - String::append_char(__local_56, 32); + String::push(__local_56, 99); + String::push(__local_56, 95); + String::push(__local_56, 52); + String::push(__local_56, 58); + String::push(__local_56, 32); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 4, indent: 0, buf: __local_56 }; f64::fmt_into(3.14159265358979, __local_57); break __tmpl: __local_56; }); "core:cli/println"(__tmpl: block -> ref String { __local_58 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_58, 99); - String::append_char(__local_58, 95); - String::append_char(__local_58, 53); - String::append_char(__local_58, 58); - String::append_char(__local_58, 32); + String::push(__local_58, 99); + String::push(__local_58, 95); + String::push(__local_58, 53); + String::push(__local_58, 58); + String::push(__local_58, 32); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 5, indent: 0, buf: __local_58 }; f64::fmt_into(3.14159265358979, __local_59); break __tmpl: __local_58; }); "core:cli/println"(__tmpl: block -> ref String { __local_60 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_60, 99); - String::append_char(__local_60, 95); - String::append_char(__local_60, 54); - String::append_char(__local_60, 58); - String::append_char(__local_60, 32); + String::push(__local_60, 99); + String::push(__local_60, 95); + String::push(__local_60, 54); + String::push(__local_60, 58); + String::push(__local_60, 32); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 6, indent: 0, buf: __local_60 }; f64::fmt_into(3.14159265358979, __local_61); break __tmpl: __local_60; }); "core:cli/println"(__tmpl: block -> ref String { __local_62 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_62, 99); - String::append_char(__local_62, 95); - String::append_char(__local_62, 55); - String::append_char(__local_62, 58); - String::append_char(__local_62, 32); + String::push(__local_62, 99); + String::push(__local_62, 95); + String::push(__local_62, 55); + String::push(__local_62, 58); + String::push(__local_62, 32); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 7, indent: 0, buf: __local_62 }; f64::fmt_into(3.14159265358979, __local_63); break __tmpl: __local_62; }); "core:cli/println"(__tmpl: block -> ref String { __local_64 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_64, 99); - String::append_char(__local_64, 95); - String::append_char(__local_64, 56); - String::append_char(__local_64, 58); - String::append_char(__local_64, 32); + String::push(__local_64, 99); + String::push(__local_64, 95); + String::push(__local_64, 56); + String::push(__local_64, 58); + String::push(__local_64, 32); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 8, indent: 0, buf: __local_64 }; f64::fmt_into(3.14159265358979, __local_65); break __tmpl: __local_64; }); "core:cli/println"(__tmpl: block -> ref String { __local_66 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_66, 99); - String::append_char(__local_66, 95); - String::append_char(__local_66, 57); - String::append_char(__local_66, 58); - String::append_char(__local_66, 32); + String::push(__local_66, 99); + String::push(__local_66, 95); + String::push(__local_66, 57); + String::push(__local_66, 58); + String::push(__local_66, 32); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 9, indent: 0, buf: __local_66 }; f64::fmt_into(3.14159265358979, __local_67); break __tmpl: __local_66; }); "core:cli/println"(__tmpl: block -> ref String { __local_68 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_68, 99); - String::append_char(__local_68, 95); - String::append_char(__local_68, 49); - String::append_char(__local_68, 48); - String::append_char(__local_68, 58); - String::append_char(__local_68, 32); + String::push(__local_68, 99); + String::push(__local_68, 95); + String::push(__local_68, 49); + String::push(__local_68, 48); + String::push(__local_68, 58); + String::push(__local_68, 32); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 10, indent: 0, buf: __local_68 }; f64::fmt_into(3.14159265358979, __local_69); break __tmpl: __local_68; }); "core:cli/println"(__tmpl: block -> ref String { __local_70 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_70, 100); - String::append_char(__local_70, 95); - String::append_char(__local_70, 49); - String::append_char(__local_70, 58); - String::append_char(__local_70, 32); + String::push(__local_70, 100); + String::push(__local_70, 95); + String::push(__local_70, 49); + String::push(__local_70, 58); + String::push(__local_70, 32); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_70 }; f64::fmt_into(99.999999, __local_71); break __tmpl: __local_70; }); "core:cli/println"(__tmpl: block -> ref String { __local_72 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_72, 100); - String::append_char(__local_72, 95); - String::append_char(__local_72, 50); - String::append_char(__local_72, 58); - String::append_char(__local_72, 32); + String::push(__local_72, 100); + String::push(__local_72, 95); + String::push(__local_72, 50); + String::push(__local_72, 58); + String::push(__local_72, 32); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 2, indent: 0, buf: __local_72 }; f64::fmt_into(99.999999, __local_73); break __tmpl: __local_72; }); "core:cli/println"(__tmpl: block -> ref String { __local_74 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_74, 100); - String::append_char(__local_74, 95); - String::append_char(__local_74, 51); - String::append_char(__local_74, 58); - String::append_char(__local_74, 32); + String::push(__local_74, 100); + String::push(__local_74, 95); + String::push(__local_74, 51); + String::push(__local_74, 58); + String::push(__local_74, 32); __local_75 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 3, indent: 0, buf: __local_74 }; f64::fmt_into(99.999999, __local_75); break __tmpl: __local_74; }); "core:cli/println"(__tmpl: block -> ref String { __local_76 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_76, 100); - String::append_char(__local_76, 95); - String::append_char(__local_76, 52); - String::append_char(__local_76, 58); - String::append_char(__local_76, 32); + String::push(__local_76, 100); + String::push(__local_76, 95); + String::push(__local_76, 52); + String::push(__local_76, 58); + String::push(__local_76, 32); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 4, indent: 0, buf: __local_76 }; f64::fmt_into(99.999999, __local_77); break __tmpl: __local_76; }); "core:cli/println"(__tmpl: block -> ref String { __local_78 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_78, 100); - String::append_char(__local_78, 95); - String::append_char(__local_78, 53); - String::append_char(__local_78, 58); - String::append_char(__local_78, 32); + String::push(__local_78, 100); + String::push(__local_78, 95); + String::push(__local_78, 53); + String::push(__local_78, 58); + String::push(__local_78, 32); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 5, indent: 0, buf: __local_78 }; f64::fmt_into(99.999999, __local_79); break __tmpl: __local_78; }); "core:cli/println"(__tmpl: block -> ref String { __local_80 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_80, 100); - String::append_char(__local_80, 95); - String::append_char(__local_80, 54); - String::append_char(__local_80, 58); - String::append_char(__local_80, 32); + String::push(__local_80, 100); + String::push(__local_80, 95); + String::push(__local_80, 54); + String::push(__local_80, 58); + String::push(__local_80, 32); __local_81 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 6, indent: 0, buf: __local_80 }; f64::fmt_into(99.999999, __local_81); break __tmpl: __local_80; }); "core:cli/println"(__tmpl: block -> ref String { __local_82 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_82, 100); - String::append_char(__local_82, 95); - String::append_char(__local_82, 55); - String::append_char(__local_82, 58); - String::append_char(__local_82, 32); + String::push(__local_82, 100); + String::push(__local_82, 95); + String::push(__local_82, 55); + String::push(__local_82, 58); + String::push(__local_82, 32); __local_83 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 7, indent: 0, buf: __local_82 }; f64::fmt_into(99.999999, __local_83); break __tmpl: __local_82; }); "core:cli/println"(__tmpl: block -> ref String { __local_84 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_84, 100); - String::append_char(__local_84, 95); - String::append_char(__local_84, 56); - String::append_char(__local_84, 58); - String::append_char(__local_84, 32); + String::push(__local_84, 100); + String::push(__local_84, 95); + String::push(__local_84, 56); + String::push(__local_84, 58); + String::push(__local_84, 32); __local_85 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 8, indent: 0, buf: __local_84 }; f64::fmt_into(99.999999, __local_85); break __tmpl: __local_84; }); "core:cli/println"(__tmpl: block -> ref String { __local_86 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_86, 100); - String::append_char(__local_86, 95); - String::append_char(__local_86, 57); - String::append_char(__local_86, 58); - String::append_char(__local_86, 32); + String::push(__local_86, 100); + String::push(__local_86, 95); + String::push(__local_86, 57); + String::push(__local_86, 58); + String::push(__local_86, 32); __local_87 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 9, indent: 0, buf: __local_86 }; f64::fmt_into(99.999999, __local_87); break __tmpl: __local_86; }); "core:cli/println"(__tmpl: block -> ref String { __local_88 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_88, 100); - String::append_char(__local_88, 95); - String::append_char(__local_88, 49); - String::append_char(__local_88, 48); - String::append_char(__local_88, 58); - String::append_char(__local_88, 32); + String::push(__local_88, 100); + String::push(__local_88, 95); + String::push(__local_88, 49); + String::push(__local_88, 48); + String::push(__local_88, 58); + String::push(__local_88, 32); __local_89 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 10, indent: 0, buf: __local_88 }; f64::fmt_into(99.999999, __local_89); break __tmpl: __local_88; }); "core:cli/println"(__tmpl: block -> ref String { __local_90 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_90, 101); - String::append_char(__local_90, 95); - String::append_char(__local_90, 49); - String::append_char(__local_90, 58); - String::append_char(__local_90, 32); + String::push(__local_90, 101); + String::push(__local_90, 95); + String::push(__local_90, 49); + String::push(__local_90, 58); + String::push(__local_90, 32); __local_91 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_90 }; f64::fmt_into(0.9999995, __local_91); break __tmpl: __local_90; }); "core:cli/println"(__tmpl: block -> ref String { __local_92 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_92, 101); - String::append_char(__local_92, 95); - String::append_char(__local_92, 50); - String::append_char(__local_92, 58); - String::append_char(__local_92, 32); + String::push(__local_92, 101); + String::push(__local_92, 95); + String::push(__local_92, 50); + String::push(__local_92, 58); + String::push(__local_92, 32); __local_93 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 2, indent: 0, buf: __local_92 }; f64::fmt_into(0.9999995, __local_93); break __tmpl: __local_92; }); "core:cli/println"(__tmpl: block -> ref String { __local_94 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_94, 101); - String::append_char(__local_94, 95); - String::append_char(__local_94, 51); - String::append_char(__local_94, 58); - String::append_char(__local_94, 32); + String::push(__local_94, 101); + String::push(__local_94, 95); + String::push(__local_94, 51); + String::push(__local_94, 58); + String::push(__local_94, 32); __local_95 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 3, indent: 0, buf: __local_94 }; f64::fmt_into(0.9999995, __local_95); break __tmpl: __local_94; }); "core:cli/println"(__tmpl: block -> ref String { __local_96 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_96, 101); - String::append_char(__local_96, 95); - String::append_char(__local_96, 52); - String::append_char(__local_96, 58); - String::append_char(__local_96, 32); + String::push(__local_96, 101); + String::push(__local_96, 95); + String::push(__local_96, 52); + String::push(__local_96, 58); + String::push(__local_96, 32); __local_97 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 4, indent: 0, buf: __local_96 }; f64::fmt_into(0.9999995, __local_97); break __tmpl: __local_96; }); "core:cli/println"(__tmpl: block -> ref String { __local_98 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_98, 101); - String::append_char(__local_98, 95); - String::append_char(__local_98, 53); - String::append_char(__local_98, 58); - String::append_char(__local_98, 32); + String::push(__local_98, 101); + String::push(__local_98, 95); + String::push(__local_98, 53); + String::push(__local_98, 58); + String::push(__local_98, 32); __local_99 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 5, indent: 0, buf: __local_98 }; f64::fmt_into(0.9999995, __local_99); break __tmpl: __local_98; }); "core:cli/println"(__tmpl: block -> ref String { __local_100 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_100, 101); - String::append_char(__local_100, 95); - String::append_char(__local_100, 54); - String::append_char(__local_100, 58); - String::append_char(__local_100, 32); + String::push(__local_100, 101); + String::push(__local_100, 95); + String::push(__local_100, 54); + String::push(__local_100, 58); + String::push(__local_100, 32); __local_101 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 6, indent: 0, buf: __local_100 }; f64::fmt_into(0.9999995, __local_101); break __tmpl: __local_100; }); "core:cli/println"(__tmpl: block -> ref String { __local_102 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_102, 101); - String::append_char(__local_102, 95); - String::append_char(__local_102, 55); - String::append_char(__local_102, 58); - String::append_char(__local_102, 32); + String::push(__local_102, 101); + String::push(__local_102, 95); + String::push(__local_102, 55); + String::push(__local_102, 58); + String::push(__local_102, 32); __local_103 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 7, indent: 0, buf: __local_102 }; f64::fmt_into(0.9999995, __local_103); break __tmpl: __local_102; }); "core:cli/println"(__tmpl: block -> ref String { __local_104 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_104, 101); - String::append_char(__local_104, 95); - String::append_char(__local_104, 56); - String::append_char(__local_104, 58); - String::append_char(__local_104, 32); + String::push(__local_104, 101); + String::push(__local_104, 95); + String::push(__local_104, 56); + String::push(__local_104, 58); + String::push(__local_104, 32); __local_105 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 8, indent: 0, buf: __local_104 }; f64::fmt_into(0.9999995, __local_105); break __tmpl: __local_104; }); "core:cli/println"(__tmpl: block -> ref String { __local_106 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_106, 101); - String::append_char(__local_106, 95); - String::append_char(__local_106, 57); - String::append_char(__local_106, 58); - String::append_char(__local_106, 32); + String::push(__local_106, 101); + String::push(__local_106, 95); + String::push(__local_106, 57); + String::push(__local_106, 58); + String::push(__local_106, 32); __local_107 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 9, indent: 0, buf: __local_106 }; f64::fmt_into(0.9999995, __local_107); break __tmpl: __local_106; }); "core:cli/println"(__tmpl: block -> ref String { __local_108 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_108, 101); - String::append_char(__local_108, 95); - String::append_char(__local_108, 49); - String::append_char(__local_108, 48); - String::append_char(__local_108, 58); - String::append_char(__local_108, 32); + String::push(__local_108, 101); + String::push(__local_108, 95); + String::push(__local_108, 49); + String::push(__local_108, 48); + String::push(__local_108, 58); + String::push(__local_108, 32); __local_109 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 10, indent: 0, buf: __local_108 }; f64::fmt_into(0.9999995, __local_109); break __tmpl: __local_108; }); "core:cli/println"(__tmpl: block -> ref String { __local_110 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_110, 102); - String::append_char(__local_110, 95); - String::append_char(__local_110, 49); - String::append_char(__local_110, 58); - String::append_char(__local_110, 32); + String::push(__local_110, 102); + String::push(__local_110, 95); + String::push(__local_110, 49); + String::push(__local_110, 58); + String::push(__local_110, 32); __local_111 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_110 }; f64::fmt_into(0.5, __local_111); break __tmpl: __local_110; }); "core:cli/println"(__tmpl: block -> ref String { __local_112 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_112, 102); - String::append_char(__local_112, 95); - String::append_char(__local_112, 50); - String::append_char(__local_112, 58); - String::append_char(__local_112, 32); + String::push(__local_112, 102); + String::push(__local_112, 95); + String::push(__local_112, 50); + String::push(__local_112, 58); + String::push(__local_112, 32); __local_113 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 2, indent: 0, buf: __local_112 }; f64::fmt_into(0.5, __local_113); break __tmpl: __local_112; }); "core:cli/println"(__tmpl: block -> ref String { __local_114 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_114, 102); - String::append_char(__local_114, 95); - String::append_char(__local_114, 51); - String::append_char(__local_114, 58); - String::append_char(__local_114, 32); + String::push(__local_114, 102); + String::push(__local_114, 95); + String::push(__local_114, 51); + String::push(__local_114, 58); + String::push(__local_114, 32); __local_115 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 3, indent: 0, buf: __local_114 }; f64::fmt_into(0.5, __local_115); break __tmpl: __local_114; }); "core:cli/println"(__tmpl: block -> ref String { __local_116 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_116, 102); - String::append_char(__local_116, 95); - String::append_char(__local_116, 52); - String::append_char(__local_116, 58); - String::append_char(__local_116, 32); + String::push(__local_116, 102); + String::push(__local_116, 95); + String::push(__local_116, 52); + String::push(__local_116, 58); + String::push(__local_116, 32); __local_117 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 4, indent: 0, buf: __local_116 }; f64::fmt_into(0.5, __local_117); break __tmpl: __local_116; }); "core:cli/println"(__tmpl: block -> ref String { __local_118 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_118, 102); - String::append_char(__local_118, 95); - String::append_char(__local_118, 53); - String::append_char(__local_118, 58); - String::append_char(__local_118, 32); + String::push(__local_118, 102); + String::push(__local_118, 95); + String::push(__local_118, 53); + String::push(__local_118, 58); + String::push(__local_118, 32); __local_119 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 5, indent: 0, buf: __local_118 }; f64::fmt_into(0.5, __local_119); break __tmpl: __local_118; }); "core:cli/println"(__tmpl: block -> ref String { __local_120 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_120, 102); - String::append_char(__local_120, 95); - String::append_char(__local_120, 54); - String::append_char(__local_120, 58); - String::append_char(__local_120, 32); + String::push(__local_120, 102); + String::push(__local_120, 95); + String::push(__local_120, 54); + String::push(__local_120, 58); + String::push(__local_120, 32); __local_121 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 6, indent: 0, buf: __local_120 }; f64::fmt_into(0.5, __local_121); break __tmpl: __local_120; }); "core:cli/println"(__tmpl: block -> ref String { __local_122 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_122, 102); - String::append_char(__local_122, 95); - String::append_char(__local_122, 55); - String::append_char(__local_122, 58); - String::append_char(__local_122, 32); + String::push(__local_122, 102); + String::push(__local_122, 95); + String::push(__local_122, 55); + String::push(__local_122, 58); + String::push(__local_122, 32); __local_123 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 7, indent: 0, buf: __local_122 }; f64::fmt_into(0.5, __local_123); break __tmpl: __local_122; }); "core:cli/println"(__tmpl: block -> ref String { __local_124 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_124, 102); - String::append_char(__local_124, 95); - String::append_char(__local_124, 56); - String::append_char(__local_124, 58); - String::append_char(__local_124, 32); + String::push(__local_124, 102); + String::push(__local_124, 95); + String::push(__local_124, 56); + String::push(__local_124, 58); + String::push(__local_124, 32); __local_125 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 8, indent: 0, buf: __local_124 }; f64::fmt_into(0.5, __local_125); break __tmpl: __local_124; }); "core:cli/println"(__tmpl: block -> ref String { __local_126 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_126, 102); - String::append_char(__local_126, 95); - String::append_char(__local_126, 57); - String::append_char(__local_126, 58); - String::append_char(__local_126, 32); + String::push(__local_126, 102); + String::push(__local_126, 95); + String::push(__local_126, 57); + String::push(__local_126, 58); + String::push(__local_126, 32); __local_127 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 9, indent: 0, buf: __local_126 }; f64::fmt_into(0.5, __local_127); break __tmpl: __local_126; }); "core:cli/println"(__tmpl: block -> ref String { __local_128 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_128, 102); - String::append_char(__local_128, 95); - String::append_char(__local_128, 49); - String::append_char(__local_128, 48); - String::append_char(__local_128, 58); - String::append_char(__local_128, 32); + String::push(__local_128, 102); + String::push(__local_128, 95); + String::push(__local_128, 49); + String::push(__local_128, 48); + String::push(__local_128, 58); + String::push(__local_128, 32); __local_129 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 10, indent: 0, buf: __local_128 }; f64::fmt_into(0.5, __local_129); break __tmpl: __local_128; }); "core:cli/println"(__tmpl: block -> ref String { __local_130 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_130, 103); - String::append_char(__local_130, 95); - String::append_char(__local_130, 49); - String::append_char(__local_130, 58); - String::append_char(__local_130, 32); + String::push(__local_130, 103); + String::push(__local_130, 95); + String::push(__local_130, 49); + String::push(__local_130, 58); + String::push(__local_130, 32); __local_131 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_130 }; f64::fmt_into(0.000009876, __local_131); break __tmpl: __local_130; }); "core:cli/println"(__tmpl: block -> ref String { __local_132 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_132, 103); - String::append_char(__local_132, 95); - String::append_char(__local_132, 50); - String::append_char(__local_132, 58); - String::append_char(__local_132, 32); + String::push(__local_132, 103); + String::push(__local_132, 95); + String::push(__local_132, 50); + String::push(__local_132, 58); + String::push(__local_132, 32); __local_133 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 2, indent: 0, buf: __local_132 }; f64::fmt_into(0.000009876, __local_133); break __tmpl: __local_132; }); "core:cli/println"(__tmpl: block -> ref String { __local_134 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_134, 103); - String::append_char(__local_134, 95); - String::append_char(__local_134, 51); - String::append_char(__local_134, 58); - String::append_char(__local_134, 32); + String::push(__local_134, 103); + String::push(__local_134, 95); + String::push(__local_134, 51); + String::push(__local_134, 58); + String::push(__local_134, 32); __local_135 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 3, indent: 0, buf: __local_134 }; f64::fmt_into(0.000009876, __local_135); break __tmpl: __local_134; }); "core:cli/println"(__tmpl: block -> ref String { __local_136 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_136, 103); - String::append_char(__local_136, 95); - String::append_char(__local_136, 52); - String::append_char(__local_136, 58); - String::append_char(__local_136, 32); + String::push(__local_136, 103); + String::push(__local_136, 95); + String::push(__local_136, 52); + String::push(__local_136, 58); + String::push(__local_136, 32); __local_137 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 4, indent: 0, buf: __local_136 }; f64::fmt_into(0.000009876, __local_137); break __tmpl: __local_136; }); "core:cli/println"(__tmpl: block -> ref String { __local_138 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_138, 103); - String::append_char(__local_138, 95); - String::append_char(__local_138, 53); - String::append_char(__local_138, 58); - String::append_char(__local_138, 32); + String::push(__local_138, 103); + String::push(__local_138, 95); + String::push(__local_138, 53); + String::push(__local_138, 58); + String::push(__local_138, 32); __local_139 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 5, indent: 0, buf: __local_138 }; f64::fmt_into(0.000009876, __local_139); break __tmpl: __local_138; }); "core:cli/println"(__tmpl: block -> ref String { __local_140 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_140, 103); - String::append_char(__local_140, 95); - String::append_char(__local_140, 54); - String::append_char(__local_140, 58); - String::append_char(__local_140, 32); + String::push(__local_140, 103); + String::push(__local_140, 95); + String::push(__local_140, 54); + String::push(__local_140, 58); + String::push(__local_140, 32); __local_141 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 6, indent: 0, buf: __local_140 }; f64::fmt_into(0.000009876, __local_141); break __tmpl: __local_140; }); "core:cli/println"(__tmpl: block -> ref String { __local_142 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_142, 103); - String::append_char(__local_142, 95); - String::append_char(__local_142, 55); - String::append_char(__local_142, 58); - String::append_char(__local_142, 32); + String::push(__local_142, 103); + String::push(__local_142, 95); + String::push(__local_142, 55); + String::push(__local_142, 58); + String::push(__local_142, 32); __local_143 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 7, indent: 0, buf: __local_142 }; f64::fmt_into(0.000009876, __local_143); break __tmpl: __local_142; }); "core:cli/println"(__tmpl: block -> ref String { __local_144 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_144, 103); - String::append_char(__local_144, 95); - String::append_char(__local_144, 56); - String::append_char(__local_144, 58); - String::append_char(__local_144, 32); + String::push(__local_144, 103); + String::push(__local_144, 95); + String::push(__local_144, 56); + String::push(__local_144, 58); + String::push(__local_144, 32); __local_145 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 8, indent: 0, buf: __local_144 }; f64::fmt_into(0.000009876, __local_145); break __tmpl: __local_144; }); "core:cli/println"(__tmpl: block -> ref String { __local_146 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_146, 103); - String::append_char(__local_146, 95); - String::append_char(__local_146, 57); - String::append_char(__local_146, 58); - String::append_char(__local_146, 32); + String::push(__local_146, 103); + String::push(__local_146, 95); + String::push(__local_146, 57); + String::push(__local_146, 58); + String::push(__local_146, 32); __local_147 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 9, indent: 0, buf: __local_146 }; f64::fmt_into(0.000009876, __local_147); break __tmpl: __local_146; }); "core:cli/println"(__tmpl: block -> ref String { __local_148 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_148, 103); - String::append_char(__local_148, 95); - String::append_char(__local_148, 49); - String::append_char(__local_148, 48); - String::append_char(__local_148, 58); - String::append_char(__local_148, 32); + String::push(__local_148, 103); + String::push(__local_148, 95); + String::push(__local_148, 49); + String::push(__local_148, 48); + String::push(__local_148, 58); + String::push(__local_148, 32); __local_149 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 10, indent: 0, buf: __local_148 }; f64::fmt_into(0.000009876, __local_149); break __tmpl: __local_148; }); "core:cli/println"(__tmpl: block -> ref String { __local_150 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_150, 104); - String::append_char(__local_150, 95); - String::append_char(__local_150, 49); - String::append_char(__local_150, 58); - String::append_char(__local_150, 32); + String::push(__local_150, 104); + String::push(__local_150, 95); + String::push(__local_150, 49); + String::push(__local_150, 58); + String::push(__local_150, 32); __local_151 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_150 }; f64::fmt_into(-0.582307589706, __local_151); break __tmpl: __local_150; }); "core:cli/println"(__tmpl: block -> ref String { __local_152 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_152, 104); - String::append_char(__local_152, 95); - String::append_char(__local_152, 50); - String::append_char(__local_152, 58); - String::append_char(__local_152, 32); + String::push(__local_152, 104); + String::push(__local_152, 95); + String::push(__local_152, 50); + String::push(__local_152, 58); + String::push(__local_152, 32); __local_153 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 2, indent: 0, buf: __local_152 }; f64::fmt_into(-0.582307589706, __local_153); break __tmpl: __local_152; }); "core:cli/println"(__tmpl: block -> ref String { __local_154 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_154, 104); - String::append_char(__local_154, 95); - String::append_char(__local_154, 51); - String::append_char(__local_154, 58); - String::append_char(__local_154, 32); + String::push(__local_154, 104); + String::push(__local_154, 95); + String::push(__local_154, 51); + String::push(__local_154, 58); + String::push(__local_154, 32); __local_155 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 3, indent: 0, buf: __local_154 }; f64::fmt_into(-0.582307589706, __local_155); break __tmpl: __local_154; }); "core:cli/println"(__tmpl: block -> ref String { __local_156 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_156, 104); - String::append_char(__local_156, 95); - String::append_char(__local_156, 52); - String::append_char(__local_156, 58); - String::append_char(__local_156, 32); + String::push(__local_156, 104); + String::push(__local_156, 95); + String::push(__local_156, 52); + String::push(__local_156, 58); + String::push(__local_156, 32); __local_157 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 4, indent: 0, buf: __local_156 }; f64::fmt_into(-0.582307589706, __local_157); break __tmpl: __local_156; }); "core:cli/println"(__tmpl: block -> ref String { __local_158 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_158, 104); - String::append_char(__local_158, 95); - String::append_char(__local_158, 53); - String::append_char(__local_158, 58); - String::append_char(__local_158, 32); + String::push(__local_158, 104); + String::push(__local_158, 95); + String::push(__local_158, 53); + String::push(__local_158, 58); + String::push(__local_158, 32); __local_159 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 5, indent: 0, buf: __local_158 }; f64::fmt_into(-0.582307589706, __local_159); break __tmpl: __local_158; }); "core:cli/println"(__tmpl: block -> ref String { __local_160 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_160, 104); - String::append_char(__local_160, 95); - String::append_char(__local_160, 54); - String::append_char(__local_160, 58); - String::append_char(__local_160, 32); + String::push(__local_160, 104); + String::push(__local_160, 95); + String::push(__local_160, 54); + String::push(__local_160, 58); + String::push(__local_160, 32); __local_161 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 6, indent: 0, buf: __local_160 }; f64::fmt_into(-0.582307589706, __local_161); break __tmpl: __local_160; }); "core:cli/println"(__tmpl: block -> ref String { __local_162 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_162, 104); - String::append_char(__local_162, 95); - String::append_char(__local_162, 55); - String::append_char(__local_162, 58); - String::append_char(__local_162, 32); + String::push(__local_162, 104); + String::push(__local_162, 95); + String::push(__local_162, 55); + String::push(__local_162, 58); + String::push(__local_162, 32); __local_163 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 7, indent: 0, buf: __local_162 }; f64::fmt_into(-0.582307589706, __local_163); break __tmpl: __local_162; }); "core:cli/println"(__tmpl: block -> ref String { __local_164 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_164, 104); - String::append_char(__local_164, 95); - String::append_char(__local_164, 56); - String::append_char(__local_164, 58); - String::append_char(__local_164, 32); + String::push(__local_164, 104); + String::push(__local_164, 95); + String::push(__local_164, 56); + String::push(__local_164, 58); + String::push(__local_164, 32); __local_165 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 8, indent: 0, buf: __local_164 }; f64::fmt_into(-0.582307589706, __local_165); break __tmpl: __local_164; }); "core:cli/println"(__tmpl: block -> ref String { __local_166 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_166, 104); - String::append_char(__local_166, 95); - String::append_char(__local_166, 57); - String::append_char(__local_166, 58); - String::append_char(__local_166, 32); + String::push(__local_166, 104); + String::push(__local_166, 95); + String::push(__local_166, 57); + String::push(__local_166, 58); + String::push(__local_166, 32); __local_167 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 9, indent: 0, buf: __local_166 }; f64::fmt_into(-0.582307589706, __local_167); break __tmpl: __local_166; }); "core:cli/println"(__tmpl: block -> ref String { __local_168 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_168, 104); - String::append_char(__local_168, 95); - String::append_char(__local_168, 49); - String::append_char(__local_168, 48); - String::append_char(__local_168, 58); - String::append_char(__local_168, 32); + String::push(__local_168, 104); + String::push(__local_168, 95); + String::push(__local_168, 49); + String::push(__local_168, 48); + String::push(__local_168, 58); + String::push(__local_168, 32); __local_169 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 10, indent: 0, buf: __local_168 }; f64::fmt_into(-0.582307589706, __local_169); break __tmpl: __local_168; }); "core:cli/println"(__tmpl: block -> ref String { __local_170 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_170, 105); - String::append_char(__local_170, 95); - String::append_char(__local_170, 49); - String::append_char(__local_170, 58); - String::append_char(__local_170, 32); + String::push(__local_170, 105); + String::push(__local_170, 95); + String::push(__local_170, 49); + String::push(__local_170, 58); + String::push(__local_170, 32); __local_171 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_170 }; f64::fmt_into(-3.14159265358979, __local_171); break __tmpl: __local_170; }); "core:cli/println"(__tmpl: block -> ref String { __local_172 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_172, 105); - String::append_char(__local_172, 95); - String::append_char(__local_172, 50); - String::append_char(__local_172, 58); - String::append_char(__local_172, 32); + String::push(__local_172, 105); + String::push(__local_172, 95); + String::push(__local_172, 50); + String::push(__local_172, 58); + String::push(__local_172, 32); __local_173 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 2, indent: 0, buf: __local_172 }; f64::fmt_into(-3.14159265358979, __local_173); break __tmpl: __local_172; }); "core:cli/println"(__tmpl: block -> ref String { __local_174 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_174, 105); - String::append_char(__local_174, 95); - String::append_char(__local_174, 51); - String::append_char(__local_174, 58); - String::append_char(__local_174, 32); + String::push(__local_174, 105); + String::push(__local_174, 95); + String::push(__local_174, 51); + String::push(__local_174, 58); + String::push(__local_174, 32); __local_175 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 3, indent: 0, buf: __local_174 }; f64::fmt_into(-3.14159265358979, __local_175); break __tmpl: __local_174; }); "core:cli/println"(__tmpl: block -> ref String { __local_176 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_176, 105); - String::append_char(__local_176, 95); - String::append_char(__local_176, 52); - String::append_char(__local_176, 58); - String::append_char(__local_176, 32); + String::push(__local_176, 105); + String::push(__local_176, 95); + String::push(__local_176, 52); + String::push(__local_176, 58); + String::push(__local_176, 32); __local_177 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 4, indent: 0, buf: __local_176 }; f64::fmt_into(-3.14159265358979, __local_177); break __tmpl: __local_176; }); "core:cli/println"(__tmpl: block -> ref String { __local_178 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_178, 105); - String::append_char(__local_178, 95); - String::append_char(__local_178, 53); - String::append_char(__local_178, 58); - String::append_char(__local_178, 32); + String::push(__local_178, 105); + String::push(__local_178, 95); + String::push(__local_178, 53); + String::push(__local_178, 58); + String::push(__local_178, 32); __local_179 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 5, indent: 0, buf: __local_178 }; f64::fmt_into(-3.14159265358979, __local_179); break __tmpl: __local_178; }); "core:cli/println"(__tmpl: block -> ref String { __local_180 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_180, 105); - String::append_char(__local_180, 95); - String::append_char(__local_180, 54); - String::append_char(__local_180, 58); - String::append_char(__local_180, 32); + String::push(__local_180, 105); + String::push(__local_180, 95); + String::push(__local_180, 54); + String::push(__local_180, 58); + String::push(__local_180, 32); __local_181 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 6, indent: 0, buf: __local_180 }; f64::fmt_into(-3.14159265358979, __local_181); break __tmpl: __local_180; }); "core:cli/println"(__tmpl: block -> ref String { __local_182 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_182, 105); - String::append_char(__local_182, 95); - String::append_char(__local_182, 55); - String::append_char(__local_182, 58); - String::append_char(__local_182, 32); + String::push(__local_182, 105); + String::push(__local_182, 95); + String::push(__local_182, 55); + String::push(__local_182, 58); + String::push(__local_182, 32); __local_183 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 7, indent: 0, buf: __local_182 }; f64::fmt_into(-3.14159265358979, __local_183); break __tmpl: __local_182; }); "core:cli/println"(__tmpl: block -> ref String { __local_184 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_184, 105); - String::append_char(__local_184, 95); - String::append_char(__local_184, 56); - String::append_char(__local_184, 58); - String::append_char(__local_184, 32); + String::push(__local_184, 105); + String::push(__local_184, 95); + String::push(__local_184, 56); + String::push(__local_184, 58); + String::push(__local_184, 32); __local_185 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 8, indent: 0, buf: __local_184 }; f64::fmt_into(-3.14159265358979, __local_185); break __tmpl: __local_184; }); "core:cli/println"(__tmpl: block -> ref String { __local_186 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_186, 105); - String::append_char(__local_186, 95); - String::append_char(__local_186, 57); - String::append_char(__local_186, 58); - String::append_char(__local_186, 32); + String::push(__local_186, 105); + String::push(__local_186, 95); + String::push(__local_186, 57); + String::push(__local_186, 58); + String::push(__local_186, 32); __local_187 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 9, indent: 0, buf: __local_186 }; f64::fmt_into(-3.14159265358979, __local_187); break __tmpl: __local_186; }); "core:cli/println"(__tmpl: block -> ref String { __local_188 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_188, 105); - String::append_char(__local_188, 95); - String::append_char(__local_188, 49); - String::append_char(__local_188, 48); - String::append_char(__local_188, 58); - String::append_char(__local_188, 32); + String::push(__local_188, 105); + String::push(__local_188, 95); + String::push(__local_188, 49); + String::push(__local_188, 48); + String::push(__local_188, 58); + String::push(__local_188, 32); __local_189 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 10, indent: 0, buf: __local_188 }; f64::fmt_into(-3.14159265358979, __local_189); break __tmpl: __local_188; }); "core:cli/println"(__tmpl: block -> ref String { __local_190 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_190, 106); - String::append_char(__local_190, 95); - String::append_char(__local_190, 49); - String::append_char(__local_190, 58); - String::append_char(__local_190, 32); + String::push(__local_190, 106); + String::push(__local_190, 95); + String::push(__local_190, 49); + String::push(__local_190, 58); + String::push(__local_190, 32); __local_191 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 1, indent: 0, buf: __local_190 }; f64::fmt_into(-0.001234567, __local_191); break __tmpl: __local_190; }); "core:cli/println"(__tmpl: block -> ref String { __local_192 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_192, 106); - String::append_char(__local_192, 95); - String::append_char(__local_192, 50); - String::append_char(__local_192, 58); - String::append_char(__local_192, 32); + String::push(__local_192, 106); + String::push(__local_192, 95); + String::push(__local_192, 50); + String::push(__local_192, 58); + String::push(__local_192, 32); __local_193 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 2, indent: 0, buf: __local_192 }; f64::fmt_into(-0.001234567, __local_193); break __tmpl: __local_192; }); "core:cli/println"(__tmpl: block -> ref String { __local_194 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_194, 106); - String::append_char(__local_194, 95); - String::append_char(__local_194, 51); - String::append_char(__local_194, 58); - String::append_char(__local_194, 32); + String::push(__local_194, 106); + String::push(__local_194, 95); + String::push(__local_194, 51); + String::push(__local_194, 58); + String::push(__local_194, 32); __local_195 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 3, indent: 0, buf: __local_194 }; f64::fmt_into(-0.001234567, __local_195); break __tmpl: __local_194; }); "core:cli/println"(__tmpl: block -> ref String { __local_196 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_196, 106); - String::append_char(__local_196, 95); - String::append_char(__local_196, 52); - String::append_char(__local_196, 58); - String::append_char(__local_196, 32); + String::push(__local_196, 106); + String::push(__local_196, 95); + String::push(__local_196, 52); + String::push(__local_196, 58); + String::push(__local_196, 32); __local_197 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 4, indent: 0, buf: __local_196 }; f64::fmt_into(-0.001234567, __local_197); break __tmpl: __local_196; }); "core:cli/println"(__tmpl: block -> ref String { __local_198 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_198, 106); - String::append_char(__local_198, 95); - String::append_char(__local_198, 53); - String::append_char(__local_198, 58); - String::append_char(__local_198, 32); + String::push(__local_198, 106); + String::push(__local_198, 95); + String::push(__local_198, 53); + String::push(__local_198, 58); + String::push(__local_198, 32); __local_199 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 5, indent: 0, buf: __local_198 }; f64::fmt_into(-0.001234567, __local_199); break __tmpl: __local_198; }); "core:cli/println"(__tmpl: block -> ref String { __local_200 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_200, 106); - String::append_char(__local_200, 95); - String::append_char(__local_200, 54); - String::append_char(__local_200, 58); - String::append_char(__local_200, 32); + String::push(__local_200, 106); + String::push(__local_200, 95); + String::push(__local_200, 54); + String::push(__local_200, 58); + String::push(__local_200, 32); __local_201 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 6, indent: 0, buf: __local_200 }; f64::fmt_into(-0.001234567, __local_201); break __tmpl: __local_200; }); "core:cli/println"(__tmpl: block -> ref String { __local_202 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_202, 106); - String::append_char(__local_202, 95); - String::append_char(__local_202, 55); - String::append_char(__local_202, 58); - String::append_char(__local_202, 32); + String::push(__local_202, 106); + String::push(__local_202, 95); + String::push(__local_202, 55); + String::push(__local_202, 58); + String::push(__local_202, 32); __local_203 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 7, indent: 0, buf: __local_202 }; f64::fmt_into(-0.001234567, __local_203); break __tmpl: __local_202; }); "core:cli/println"(__tmpl: block -> ref String { __local_204 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_204, 106); - String::append_char(__local_204, 95); - String::append_char(__local_204, 56); - String::append_char(__local_204, 58); - String::append_char(__local_204, 32); + String::push(__local_204, 106); + String::push(__local_204, 95); + String::push(__local_204, 56); + String::push(__local_204, 58); + String::push(__local_204, 32); __local_205 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 8, indent: 0, buf: __local_204 }; f64::fmt_into(-0.001234567, __local_205); break __tmpl: __local_204; }); "core:cli/println"(__tmpl: block -> ref String { __local_206 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_206, 106); - String::append_char(__local_206, 95); - String::append_char(__local_206, 57); - String::append_char(__local_206, 58); - String::append_char(__local_206, 32); + String::push(__local_206, 106); + String::push(__local_206, 95); + String::push(__local_206, 57); + String::push(__local_206, 58); + String::push(__local_206, 32); __local_207 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 9, indent: 0, buf: __local_206 }; f64::fmt_into(-0.001234567, __local_207); break __tmpl: __local_206; }); "core:cli/println"(__tmpl: block -> ref String { __local_208 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_208, 106); - String::append_char(__local_208, 95); - String::append_char(__local_208, 49); - String::append_char(__local_208, 48); - String::append_char(__local_208, 58); - String::append_char(__local_208, 32); + String::push(__local_208, 106); + String::push(__local_208, 95); + String::push(__local_208, 49); + String::push(__local_208, 48); + String::push(__local_208, 58); + String::push(__local_208, 32); __local_209 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: 0, precision: 10, indent: 0, buf: __local_208 }; f64::fmt_into(-0.001234567, __local_209); break __tmpl: __local_208; @@ -6762,30 +6762,30 @@ fn fixed_width(f, n) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("fixed_width"), used: 11 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("core:prelude/fpfmt.wado"), used: 23 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("fixed_width"), used: 11 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("core:prelude/fpfmt.wado"), used: 23 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_18 = __local_14; i32::fmt_decimal(289, __local_18); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("digits must be <= 18"), used: 20 }); - String::append(__local_13, String { repr: array.new_data(" + String::push(__local_13, 58); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("digits must be <= 18"), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data(" condition: n <= 18 "), used: 20 }); - String::append_char(__local_13, 110); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 110); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_23 = __local_14; i32::fmt_decimal(n, __local_23); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -7228,8 +7228,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -7284,13 +7284,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -7298,25 +7298,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -7324,7 +7324,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -7366,8 +7366,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -7399,7 +7399,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -7513,13 +7513,13 @@ fn write_exp_prec(buf, d, p, nd, precision, upper) { write_digits_at(buf, start_14, first_d, 1); }; exp = (p + nd) - 1; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -7527,25 +7527,25 @@ fn write_exp_prec(buf, d, p, nd, precision, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_7: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_7: block -> char { __local_31 = 48 + abs_exp; break __inline_char__from_u32_unchecked_7: __local_31; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_37 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_37; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_38 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_38; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_10: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_10: block -> char { __local_34 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_10: __local_34; }); - String::append_char(buf, __inline_i2a_first_11: block -> char { + String::push(buf, __inline_i2a_first_11: block -> char { __local_35 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_39 = 48 + (__local_35 / 10); @@ -7553,7 +7553,7 @@ fn write_exp_prec(buf, d, p, nd, precision, upper) { }; break __inline_i2a_first_11; }); - String::append_char(buf, __inline_i2a_second_12: block -> char { + String::push(buf, __inline_i2a_second_12: block -> char { __local_36 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_40 = 48 + (__local_36 % 10); @@ -7792,27 +7792,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -8257,9 +8257,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -8324,9 +8324,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -8380,13 +8380,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -8421,9 +8421,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -8487,21 +8487,21 @@ fn f64::fmt_exp(self, precision, upper, f) { break __inline_String__len_1: __local_24.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; - String::append(f.buf, if upper_bool -> ref String { + String::push_str(f.buf, if upper_bool -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); - String::append_char(f.buf, 48); + String::push(f.buf, 48); Formatter::apply_padding(f, mark_9); return; }; @@ -8515,9 +8515,9 @@ fn f64::fmt_exp(self, precision, upper, f) { break __inline_String__len_4: __local_28.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if precision >= 0 { total_digits = precision + 1; @@ -8772,7 +8772,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -8860,7 +8860,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -8898,7 +8898,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l441; }; @@ -8918,7 +8918,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -8926,17 +8926,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -9090,20 +9090,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -9113,10 +9113,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -9126,10 +9126,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -9137,10 +9137,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -9152,7 +9152,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -9169,22 +9169,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b480; @@ -9192,7 +9192,7 @@ fn String^Inspect::inspect(self, f) { continue l481; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/effect_1.wir.wado b/wado-compiler/tests/fixtures.golden/effect_1.wir.wado index b59245320..e421141f7 100644 --- a/wado-compiler/tests/fixtures.golden/effect_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/effect_1.wir.wado @@ -90,9 +90,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/__Closure_0::__call" = fn(ref __Closure_0); @@ -137,14 +137,14 @@ fn effect_poly_basic() with Stdout { "core:cli/println"(String { repr: array.new_data("hello from wrapper"), used: 18 }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_2, 114); - String::append_char(__local_2, 101); - String::append_char(__local_2, 115); - String::append_char(__local_2, 117); - String::append_char(__local_2, 108); - String::append_char(__local_2, 116); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 114); + String::push(__local_2, 101); + String::push(__local_2, 115); + String::push(__local_2, 117); + String::push(__local_2, 108); + String::push(__local_2, 116); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(42, __local_3); break __tmpl: __local_2; @@ -155,7 +155,7 @@ fn effect_poly_basic() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_6, String { repr: array.new_data("result2: "), used: 9 }); + String::push_str(__local_6, String { repr: array.new_data("result2: "), used: 9 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(result2, __local_7); break __tmpl: __local_6; @@ -184,14 +184,14 @@ fn effect_poly_chain() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_3, 114); - String::append_char(__local_3, 101); - String::append_char(__local_3, 115); - String::append_char(__local_3, 117); - String::append_char(__local_3, 108); - String::append_char(__local_3, 116); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 114); + String::push(__local_3, 101); + String::push(__local_3, 115); + String::push(__local_3, 117); + String::push(__local_3, 108); + String::push(__local_3, 116); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(result, __local_4); break __tmpl: __local_3; @@ -441,7 +441,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -456,7 +456,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -492,7 +492,7 @@ fn __Closure_3::__call(self, x) { let __local_6: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_5, String { repr: array.new_data("applying to "), used: 12 }); + String::push_str(__local_5, String { repr: array.new_data("applying to "), used: 12 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(x, __local_6); break __tmpl: __local_5; @@ -505,10 +505,10 @@ fn __Closure_4::__call(self, x) { let __local_3: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_2, 103); - String::append_char(__local_2, 111); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); + String::push(__local_2, 103); + String::push(__local_2, 111); + String::push(__local_2, 116); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(x, __local_3); break __tmpl: __local_2; @@ -531,7 +531,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -565,20 +565,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -588,10 +588,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -601,10 +601,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -612,10 +612,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/effect_2.wir.wado b/wado-compiler/tests/fixtures.golden/effect_2.wir.wado index c79b6e07f..64c59a9e8 100644 --- a/wado-compiler/tests/fixtures.golden/effect_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/effect_2.wir.wado @@ -76,9 +76,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/__Closure_9::__call" = fn(ref __Closure_9, i32) -> i32; @@ -130,14 +130,14 @@ fn effect_poly_multi_param() with Stdout, Stderr { }; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_5, 114); - String::append_char(__local_5, 101); - String::append_char(__local_5, 115); - String::append_char(__local_5, 117); - String::append_char(__local_5, 108); - String::append_char(__local_5, 116); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 114); + String::push(__local_5, 101); + String::push(__local_5, 115); + String::push(__local_5, 117); + String::push(__local_5, 108); + String::push(__local_5, 116); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(result, __local_6); break __tmpl: __local_5; @@ -372,7 +372,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -387,7 +387,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -419,13 +419,13 @@ fn __Closure_9::__call(self, x) { let __local_3: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 115); - String::append_char(__local_2, 116); - String::append_char(__local_2, 101); - String::append_char(__local_2, 112); - String::append_char(__local_2, 49); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 115); + String::push(__local_2, 116); + String::push(__local_2, 101); + String::push(__local_2, 112); + String::push(__local_2, 49); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(x, __local_3); break __tmpl: __local_2; @@ -438,13 +438,13 @@ fn __Closure_10::__call(self, x) { let __local_5: ref Formatter; "core:cli/eprintln"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_4, 115); - String::append_char(__local_4, 116); - String::append_char(__local_4, 101); - String::append_char(__local_4, 112); - String::append_char(__local_4, 50); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 115); + String::push(__local_4, 116); + String::push(__local_4, 101); + String::push(__local_4, 112); + String::push(__local_4, 50); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(x, __local_5); break __tmpl: __local_4; @@ -463,7 +463,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -497,20 +497,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -520,10 +520,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -533,10 +533,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -544,10 +544,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/enum-display-basic.wir.wado b/wado-compiler/tests/fixtures.golden/enum-display-basic.wir.wado index 894baf171..a47c47935 100644 --- a/wado-compiler/tests/fixtures.golden/enum-display-basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/enum-display-basic.wir.wado @@ -58,7 +58,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Color^Inspect::inspect" = fn(enum:Color, ref Formatter); @@ -230,7 +230,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -251,13 +251,13 @@ fn Color^Inspect::inspect(self, f) { let __local_7: ref String; if self == 0 { __local_3 = String { repr: array.new_data("Color::Red"), used: 10 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); } else if self == 1 { __local_5 = String { repr: array.new_data("Color::Green"), used: 12 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if self == 2 { __local_7 = String { repr: array.new_data("Color::Blue"), used: 11 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } diff --git a/wado-compiler/tests/fixtures.golden/enum-display-template.wir.wado b/wado-compiler/tests/fixtures.golden/enum-display-template.wir.wado index 68779e004..17fa939c3 100644 --- a/wado-compiler/tests/fixtures.golden/enum-display-template.wir.wado +++ b/wado-compiler/tests/fixtures.golden/enum-display-template.wir.wado @@ -60,7 +60,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Fruit^Inspect::inspect" = fn(enum:Fruit, ref Formatter); @@ -93,7 +93,7 @@ fn describe(f) { return let __match_scrut_0: enum:Fruit; __match_scrut_0 = f; if __match_scrut_0 == 0 -> ref String { __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append(__local_1, String { repr: array.new_data("I like "), used: 7 }); + String::push_str(__local_1, String { repr: array.new_data("I like "), used: 7 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; Fruit^Inspect::inspect(f, __local_2); break __tmpl: __local_1; @@ -103,7 +103,7 @@ fn describe(f) { __local_3 = String { repr: builtin::array_new(26), used: 0 }; __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; Fruit^Inspect::inspect(f, __local_4); - String::append(__local_3, String { repr: array.new_data(" is yellow"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data(" is yellow"), used: 10 }); break __tmpl: __local_3; }; } else if __match_scrut_0 == 2 -> ref String { @@ -111,7 +111,7 @@ fn describe(f) { __local_5 = String { repr: builtin::array_new(25), used: 0 }; __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; Fruit^Inspect::inspect(f, __local_6); - String::append(__local_5, String { repr: array.new_data(" is small"), used: 9 }); + String::push_str(__local_5, String { repr: array.new_data(" is small"), used: 9 }); break __tmpl: __local_5; }; } else { @@ -126,7 +126,7 @@ fn run() with Stdout { f = 0; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append(__local_1, String { repr: array.new_data("fruit: "), used: 7 }); + String::push_str(__local_1, String { repr: array.new_data("fruit: "), used: 7 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; Fruit^Inspect::inspect(f, __local_2); break __tmpl: __local_1; @@ -252,7 +252,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -273,13 +273,13 @@ fn Fruit^Inspect::inspect(self, f) { let __local_7: ref String; if self == 0 { __local_3 = String { repr: array.new_data("Fruit::Apple"), used: 12 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); } else if self == 1 { __local_5 = String { repr: array.new_data("Fruit::Banana"), used: 13 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if self == 2 { __local_7 = String { repr: array.new_data("Fruit::Cherry"), used: 13 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } diff --git a/wado-compiler/tests/fixtures.golden/escape_brace.wir.wado b/wado-compiler/tests/fixtures.golden/escape_brace.wir.wado index 2df030c63..860301c52 100644 --- a/wado-compiler/tests/fixtures.golden/escape_brace.wir.wado +++ b/wado-compiler/tests/fixtures.golden/escape_brace.wir.wado @@ -45,7 +45,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/wasi/stream-drop-writable" = fn(i32); @@ -72,9 +72,9 @@ fn run() with Stdout { name = String { repr: array.new_data("world"), used: 5 }; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(20), used: 0 }; - String::append(__local_1, String { repr: array.new_data("{\""), used: 2 }); - String::append(__local_1, name); - String::append(__local_1, String { repr: array.new_data("\"}"), used: 2 }); + String::push_str(__local_1, String { repr: array.new_data("{\""), used: 2 }); + String::push_str(__local_1, name); + String::push_str(__local_1, String { repr: array.new_data("\"}"), used: 2 }); break __tmpl: __local_1; }); "core:cli/println"(String { repr: array.new_data("{\"key\": \"value\"}"), used: 16 }); @@ -197,7 +197,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/flags_impl.wir.wado b/wado-compiler/tests/fixtures.golden/flags_impl.wir.wado index 02a9bf201..5de7bbf1e 100644 --- a/wado-compiler/tests/fixtures.golden/flags_impl.wir.wado +++ b/wado-compiler/tests/fixtures.golden/flags_impl.wir.wado @@ -72,9 +72,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -150,23 +150,23 @@ fn run() with Stdout { if __v0_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_31 = __local_15; i32::fmt_decimal(31, __local_31); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: rw.has_read() "), used: 26 }); - String::append(__local_14, String { repr: array.new_data("rw.has_read(): "), used: 15 }); + String::push_str(__local_14, String { repr: array.new_data("rw.has_read(): "), used: 15 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_36 = __local_15; Formatter::pad(__local_36, if __v0_1 -> ref String { @@ -174,7 +174,7 @@ condition: rw.has_read() } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -186,23 +186,23 @@ condition: rw.has_read() if __v0_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_43 = __local_17; i32::fmt_decimal(32, __local_43); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: rw.has_write() "), used: 27 }); - String::append(__local_16, String { repr: array.new_data("rw.has_write(): "), used: 16 }); + String::push_str(__local_16, String { repr: array.new_data("rw.has_write(): "), used: 16 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_48 = __local_17; Formatter::pad(__local_48, if __v0_3 -> ref String { @@ -210,7 +210,7 @@ condition: rw.has_write() } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -222,23 +222,23 @@ condition: rw.has_write() if __v0_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_56 = __local_19; i32::fmt_decimal(33, __local_56); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: rw.check_read() "), used: 28 }); - String::append(__local_18, String { repr: array.new_data("rw.check_read(): "), used: 17 }); + String::push_str(__local_18, String { repr: array.new_data("rw.check_read(): "), used: 17 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_61 = __local_19; Formatter::pad(__local_61, if __v0_5 -> ref String { @@ -246,7 +246,7 @@ condition: rw.check_read() } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -259,23 +259,23 @@ condition: rw.check_read() if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_68 = __local_21; i32::fmt_decimal(36, __local_68); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: !w.has_read() "), used: 26 }); - String::append(__local_20, String { repr: array.new_data("w.has_read(): "), used: 14 }); + String::push_str(__local_20, String { repr: array.new_data("w.has_read(): "), used: 14 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_73 = __local_21; Formatter::pad(__local_73, if __v0_8 -> ref String { @@ -283,7 +283,7 @@ condition: !w.has_read() } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -295,23 +295,23 @@ condition: !w.has_read() if __v0_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_80 = __local_23; i32::fmt_decimal(37, __local_80); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: w.has_write() "), used: 26 }); - String::append(__local_22, String { repr: array.new_data("w.has_write(): "), used: 15 }); + String::push_str(__local_22, String { repr: array.new_data("w.has_write(): "), used: 15 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_85 = __local_23; Formatter::pad(__local_85, if __v0_10 -> ref String { @@ -319,7 +319,7 @@ condition: w.has_write() } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -332,23 +332,23 @@ condition: w.has_write() if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/flags_impl.wado"), used: 44 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_93 = __local_25; i32::fmt_decimal(38, __local_93); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: !w.check_read() "), used: 28 }); - String::append(__local_24, String { repr: array.new_data("w.check_read(): "), used: 16 }); + String::push_str(__local_24, String { repr: array.new_data("w.check_read(): "), used: 16 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_98 = __local_25; Formatter::pad(__local_98, if __v0_12 -> ref String { @@ -356,7 +356,7 @@ condition: !w.check_read() } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -596,7 +596,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -611,7 +611,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -649,7 +649,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l36; }; @@ -669,7 +669,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -677,17 +677,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -717,20 +717,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -740,10 +740,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -753,10 +753,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -764,10 +764,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/float_to_string.wir.wado b/wado-compiler/tests/fixtures.golden/float_to_string.wir.wado index 68666b552..86ca770be 100644 --- a/wado-compiler/tests/fixtures.golden/float_to_string.wir.wado +++ b/wado-compiler/tests/fixtures.golden/float_to_string.wir.wado @@ -91,7 +91,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -99,7 +99,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -160,21 +160,21 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(21), used: 0 }; - String::append(__local_3, String { repr: array.new_data("f is "), used: 5 }); + String::push_str(__local_3, String { repr: array.new_data("f is "), used: 5 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; f64::fmt_into(1.23, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_5, String { repr: array.new_data("pi is approximately "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("pi is approximately "), used: 20 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; f64::fmt_into(3.14159, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_7, String { repr: array.new_data("10.5 + 2.5 = "), used: 13 }); + String::push_str(__local_7, String { repr: array.new_data("10.5 + 2.5 = "), used: 13 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; f64::fmt_into(13, __local_8); break __tmpl: __local_7; @@ -942,7 +942,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -997,7 +997,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1029,7 +1029,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1111,25 +1111,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1230,9 +1230,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1286,13 +1286,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1327,9 +1327,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1370,7 +1370,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/for_merged.wir.wado b/wado-compiler/tests/fixtures.golden/for_merged.wir.wado index 19d0bc6e9..30c37b6e3 100644 --- a/wado-compiler/tests/fixtures.golden/for_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/for_merged.wir.wado @@ -89,11 +89,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -152,31 +152,31 @@ fn __test_0_c_style_loop() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_0_c_style_loop"), used: 21 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/for_merged.wado"), used: 44 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_0_c_style_loop"), used: 21 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/for_merged.wado"), used: 44 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(6, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: count == 3 "), used: 23 }); - String::append_char(__local_4, 99); - String::append_char(__local_4, 111); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 116); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 99); + String::push(__local_4, 111); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 116); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(__v0, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -214,31 +214,31 @@ fn __test_1_break() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_1_break"), used: 14 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/for_merged.wado"), used: 44 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_1_break"), used: 14 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/for_merged.wado"), used: 44 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(17, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: count == 3 "), used: 23 }); - String::append_char(__local_4, 99); - String::append_char(__local_4, 111); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 116); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 99); + String::push(__local_4, 111); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 116); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(__v0, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -281,50 +281,50 @@ fn __test_2_continue() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(212), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_2_continue"), used: 17 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/for_merged.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_2_continue"), used: 17 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/for_merged.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_13 = __local_8; i32::fmt_decimal(28, __local_13); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: sum == 0 + 1 + 3 + 4 "), used: 33 }); - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_18 = __local_8; i32::fmt_decimal(__v0, __local_18); - String::append_char(__local_7, 10); - String::append_char(__local_7, 48); - String::append_char(__local_7, 32); - String::append_char(__local_7, 43); - String::append_char(__local_7, 32); - String::append_char(__local_7, 49); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 10); + String::push(__local_7, 48); + String::push(__local_7, 32); + String::push(__local_7, 43); + String::push(__local_7, 32); + String::push(__local_7, 49); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_23 = __local_8; i32::fmt_decimal(1, __local_23); - String::append_char(__local_7, 10); - String::append(__local_7, String { repr: array.new_data("0 + 1 + 3: "), used: 11 }); + String::push(__local_7, 10); + String::push_str(__local_7, String { repr: array.new_data("0 + 1 + 3: "), used: 11 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_28 = __local_8; i32::fmt_decimal(4, __local_28); - String::append_char(__local_7, 10); - String::append(__local_7, String { repr: array.new_data("0 + 1 + 3 + 4: "), used: 15 }); + String::push(__local_7, 10); + String::push_str(__local_7, String { repr: array.new_data("0 + 1 + 3 + 4: "), used: 15 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_33 = __local_8; i32::fmt_decimal(8, __local_33); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -379,31 +379,31 @@ fn __test_3_for_let_pattern() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_3_for_let_pattern"), used: 24 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/for_merged.wado"), used: 44 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_3_for_let_pattern"), used: 24 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/for_merged.wado"), used: 44 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_29 = __local_11; i32::fmt_decimal(39, __local_29); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: count == 3 "), used: 23 }); - String::append_char(__local_10, 99); - String::append_char(__local_10, 111); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 116); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 99); + String::push(__local_10, 111); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 116); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_34 = __local_11; i32::fmt_decimal(__v0_6, __local_34); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -413,29 +413,29 @@ condition: count == 3 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_3_for_let_pattern"), used: 24 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/for_merged.wado"), used: 44 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_3_for_let_pattern"), used: 24 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/for_merged.wado"), used: 44 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_40 = __local_13; i32::fmt_decimal(40, __local_40); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: sum == 60 "), used: 22 }); - String::append_char(__local_12, 115); - String::append_char(__local_12, 117); - String::append_char(__local_12, 109); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 115); + String::push(__local_12, 117); + String::push(__local_12, 109); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_45 = __local_13; i32::fmt_decimal(__v0_8, __local_45); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -653,7 +653,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -668,7 +668,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -705,7 +705,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -758,7 +758,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l47; }; @@ -792,20 +792,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -815,10 +815,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -828,10 +828,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -839,10 +839,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/for_of_1.wir.wado b/wado-compiler/tests/fixtures.golden/for_of_1.wir.wado index b4e417903..f64e59dbb 100644 --- a/wado-compiler/tests/fixtures.golden/for_of_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/for_of_1.wir.wado @@ -87,11 +87,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -152,12 +152,12 @@ fn for_of_basic() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_5, 115); - String::append_char(__local_5, 117); - String::append_char(__local_5, 109); - String::append_char(__local_5, 32); - String::append_char(__local_5, 61); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 117); + String::push(__local_5, 109); + String::push(__local_5, 32); + String::push(__local_5, 61); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(sum, __local_6); break __tmpl: __local_5; @@ -258,7 +258,7 @@ fn for_of_empty() with Stdout { item = __sroa___pattern_temp_0_payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_4, String { repr: array.new_data("should not print: "), used: 18 }); + String::push_str(__local_4, String { repr: array.new_data("should not print: "), used: 18 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(item, __local_5); break __tmpl: __local_4; @@ -503,7 +503,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -518,7 +518,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -555,7 +555,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -608,7 +608,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l45; }; @@ -642,20 +642,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -665,10 +665,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -678,10 +678,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -689,10 +689,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/for_of_2.wir.wado b/wado-compiler/tests/fixtures.golden/for_of_2.wir.wado index cb3c9f93d..047fb087f 100644 --- a/wado-compiler/tests/fixtures.golden/for_of_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/for_of_2.wir.wado @@ -162,17 +162,17 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); type "functype/ArrayIter>^Iterator::next" = fn(ref "core:allocator/ArrayIter>") -> ref null "tuple/[i32, i32]"; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[i32, i32]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[i32, i32]"); type "functype/Array>::grow" = fn(ref Array>); @@ -180,17 +180,17 @@ type "functype/ArrayIter>^Iterator::next" = fn(ref "core:alloc type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref null Point; -type "functype/Array::append" = fn(ref Array, ref Point); +type "functype/Array::push" = fn(ref Array, ref Point); type "functype/Array::grow" = fn(ref Array); type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref null String; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, i32]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, i32]"); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -333,7 +333,7 @@ fn for_of_nested() with Stdout { __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_33 = __local_9; i32::fmt_decimal(i, __local_33); - String::append_char(__local_8, 44); + String::push(__local_8, 44); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_38 = __local_9; i32::fmt_decimal(j, __local_38); @@ -404,15 +404,15 @@ fn for_of_strings() with Stdout { name = value_copy String(ref.as_non_null(__pattern_temp_0)); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 72); - String::append_char(__local_4, 101); - String::append_char(__local_4, 108); - String::append_char(__local_4, 108); - String::append_char(__local_4, 111); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); - String::append(__local_4, name); - String::append_char(__local_4, 33); + String::push(__local_4, 72); + String::push(__local_4, 101); + String::push(__local_4, 108); + String::push(__local_4, 108); + String::push(__local_4, 111); + String::push(__local_4, 44); + String::push(__local_4, 32); + String::push_str(__local_4, name); + String::push(__local_4, 33); break __tmpl: __local_4; }); } else { @@ -452,7 +452,7 @@ fn for_of_structs() with Stdout { __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_20 = __local_7; i32::fmt_decimal(p.x, __local_20); - String::append_char(__local_6, 44); + String::push(__local_6, 44); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_25 = __local_7; i32::fmt_decimal(p.y, __local_25); @@ -521,7 +521,7 @@ fn for_of_tuples() with Stdout { __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_20 = __local_7; i32::fmt_decimal(p.0, __local_20); - String::append_char(__local_6, 44); + String::push(__local_6, 44); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_25 = __local_7; i32::fmt_decimal(p.1, __local_25); @@ -748,7 +748,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -763,7 +763,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -790,7 +790,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -842,7 +842,7 @@ fn ArrayIter>^Iterator::next(self) { return item; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -904,7 +904,7 @@ fn ArrayIter^Iterator::next(self) { return item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -966,7 +966,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1008,7 +1008,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1061,7 +1061,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l75; }; @@ -1095,20 +1095,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1118,10 +1118,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1131,10 +1131,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1142,10 +1142,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/for_of_ref.wir.wado b/wado-compiler/tests/fixtures.golden/for_of_ref.wir.wado index e7b2b0cf6..7b06883e5 100644 --- a/wado-compiler/tests/fixtures.golden/for_of_ref.wir.wado +++ b/wado-compiler/tests/fixtures.golden/for_of_ref.wir.wado @@ -121,19 +121,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayRefIter^Iterator::next" = fn(ref "core:allocator/ArrayRefIter") -> ref null Point; -type "functype/Array::append" = fn(ref Array, ref Point); +type "functype/Array::push" = fn(ref Array, ref Point); type "functype/Array::grow" = fn(ref Array); type "functype/ArrayRefIter^Iterator::next" = fn(ref "core:allocator/ArrayRefIter") -> ref null "core:internal/Box"; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -207,29 +207,29 @@ fn test_for_of_ref_array() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("test_for_of_ref_array"), used: 21 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/for_of_ref.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("test_for_of_ref_array"), used: 21 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/for_of_ref.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_24 = __local_8; i32::fmt_decimal(15, __local_24); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: sum == 60 "), used: 22 }); - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_29 = __local_8; i32::fmt_decimal(__v0, __local_29); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -279,29 +279,29 @@ fn test_for_of_ref_struct() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("test_for_of_ref_struct"), used: 22 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/for_of_ref.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("test_for_of_ref_struct"), used: 22 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/for_of_ref.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_22 = __local_8; i32::fmt_decimal(29, __local_22); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: sum == 10 "), used: 22 }); - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_27 = __local_8; i32::fmt_decimal(__v0, __local_27); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -351,29 +351,29 @@ fn test_for_of_ref_var() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("test_for_of_ref_var"), used: 19 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/for_of_ref.wado"), used: 44 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("test_for_of_ref_var"), used: 19 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/for_of_ref.wado"), used: 44 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_25 = __local_9; i32::fmt_decimal(42, __local_25); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: sum == 6 "), used: 21 }); - String::append_char(__local_8, 115); - String::append_char(__local_8, 117); - String::append_char(__local_8, 109); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 115); + String::push(__local_8, 117); + String::push(__local_8, 109); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_30 = __local_9; i32::fmt_decimal(__v0, __local_30); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -418,29 +418,29 @@ fn test_for_of_value_unchanged() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("test_for_of_value_unchanged"), used: 27 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/for_of_ref.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("test_for_of_value_unchanged"), used: 27 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/for_of_ref.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_23 = __local_8; i32::fmt_decimal(53, __local_23); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: sum == 6 "), used: 21 }); - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_28 = __local_8; i32::fmt_decimal(__v0, __local_28); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -690,7 +690,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -705,7 +705,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -752,7 +752,7 @@ fn ArrayRefIter^Iterator::next(self) { return val; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -804,7 +804,7 @@ fn ArrayRefIter^Iterator::next(self) { return val; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -857,7 +857,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l51; }; @@ -891,20 +891,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -914,10 +914,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -927,10 +927,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -938,10 +938,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/forof-generic-array.wir.wado b/wado-compiler/tests/fixtures.golden/forof-generic-array.wir.wado index d8b8f17c3..d00991b93 100644 --- a/wado-compiler/tests/fixtures.golden/forof-generic-array.wir.wado +++ b/wado-compiler/tests/fixtures.golden/forof-generic-array.wir.wado @@ -56,7 +56,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -209,7 +209,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/from-literal-cast.wir.wado b/wado-compiler/tests/fixtures.golden/from-literal-cast.wir.wado index 3ed0277e7..cb9f3cf01 100644 --- a/wado-compiler/tests/fixtures.golden/from-literal-cast.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from-literal-cast.wir.wado @@ -90,15 +90,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -182,12 +182,12 @@ fn run() with Stdout { }) }; __local_27 = String { repr: array.new_data("name"), used: 4 }; __local_28 = String { repr: array.new_data("Alice"), used: 5 }; - Array::append(__local_0.keys, __local_27); - Array::append(__local_0.values, __local_28); + Array::push(__local_0.keys, __local_27); + Array::push(__local_0.values, __local_28); __local_30 = String { repr: array.new_data("city"), used: 4 }; __local_31 = String { repr: array.new_data("Tokyo"), used: 5 }; - Array::append(__local_0.keys, __local_30); - Array::append(__local_0.values, __local_31); + Array::push(__local_0.keys, __local_30); + Array::push(__local_0.values, __local_31); break __kv_lit: __local_0; }; __v0_2 = __inline_Array_String___len_8: block -> i32 { @@ -198,27 +198,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-cast.wado"), used: 51 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-cast.wado"), used: 51 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_38 = __local_13; i32::fmt_decimal(41, __local_38); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: m.len() == 2 "), used: 25 }); - String::append(__local_12, String { repr: array.new_data("m.len(): "), used: 9 }); + String::push_str(__local_12, String { repr: array.new_data("m.len(): "), used: 9 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_43 = __local_13; i32::fmt_decimal(__v0_2, __local_43); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -235,26 +235,26 @@ condition: m.len() == 2 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-cast.wado"), used: 51 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-cast.wado"), used: 51 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_51 = __local_15; i32::fmt_decimal(42, __local_51); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: m.keys[0] == \"name\" "), used: 32 }); - String::append(__local_14, String { repr: array.new_data("m.keys[0]: "), used: 11 }); + String::push_str(__local_14, String { repr: array.new_data("m.keys[0]: "), used: 11 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; String^Inspect::inspect(__v0_4, __local_15); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -271,26 +271,26 @@ condition: m.keys[0] == \"name\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-cast.wado"), used: 51 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-cast.wado"), used: 51 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_60 = __local_17; i32::fmt_decimal(43, __local_60); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: m.keys[1] == \"city\" "), used: 32 }); - String::append(__local_16, String { repr: array.new_data("m.keys[1]: "), used: 11 }); + String::push_str(__local_16, String { repr: array.new_data("m.keys[1]: "), used: 11 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_6, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -307,26 +307,26 @@ condition: m.keys[1] == \"city\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-cast.wado"), used: 51 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-cast.wado"), used: 51 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_69 = __local_19; i32::fmt_decimal(44, __local_69); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: m.values[0] == \"Alice\" "), used: 35 }); - String::append(__local_18, String { repr: array.new_data("m.values[0]: "), used: 13 }); + String::push_str(__local_18, String { repr: array.new_data("m.values[0]: "), used: 13 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; String^Inspect::inspect(__v0_8, __local_19); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -343,26 +343,26 @@ condition: m.values[0] == \"Alice\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-cast.wado"), used: 51 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-cast.wado"), used: 51 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_78 = __local_21; i32::fmt_decimal(45, __local_78); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: m.values[1] == \"Tokyo\" "), used: 35 }); - String::append(__local_20, String { repr: array.new_data("m.values[1]: "), used: 13 }); + String::push_str(__local_20, String { repr: array.new_data("m.values[1]: "), used: 13 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; String^Inspect::inspect(__v0_10, __local_21); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -602,7 +602,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -690,7 +690,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -717,7 +717,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -770,7 +770,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l46; }; @@ -804,20 +804,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -827,10 +827,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -840,10 +840,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -851,10 +851,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -866,7 +866,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -883,22 +883,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b65; @@ -906,7 +906,7 @@ fn String^Inspect::inspect(self, f) { continue l66; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/from-literal-custom.wir.wado b/wado-compiler/tests/fixtures.golden/from-literal-custom.wir.wado index d6569ddd8..7f90d103b 100644 --- a/wado-compiler/tests/fixtures.golden/from-literal-custom.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from-literal-custom.wir.wado @@ -97,19 +97,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -206,14 +206,14 @@ fn run() with Stdout { break __seq_lit: __local_33; }) }; __local_35 = String { repr: array.new_data("x"), used: 1 }; - Array::append(__local_0.keys, __local_35); - Array::append(__local_0.values, 10); + Array::push(__local_0.keys, __local_35); + Array::push(__local_0.values, 10); __local_38 = String { repr: array.new_data("y"), used: 1 }; - Array::append(__local_0.keys, __local_38); - Array::append(__local_0.values, 20); + Array::push(__local_0.keys, __local_38); + Array::push(__local_0.values, 20); __local_41 = String { repr: array.new_data("z"), used: 1 }; - Array::append(__local_0.keys, __local_41); - Array::append(__local_0.values, 30); + Array::push(__local_0.keys, __local_41); + Array::push(__local_0.values, 30); break __kv_lit: __local_0; }; __v0_2 = __inline_Array_String___len_9: block -> i32 { @@ -224,27 +224,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_49 = __local_17; i32::fmt_decimal(42, __local_49); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: m.len() == 3 "), used: 25 }); - String::append(__local_16, String { repr: array.new_data("m.len(): "), used: 9 }); + String::push_str(__local_16, String { repr: array.new_data("m.len(): "), used: 9 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_54 = __local_17; i32::fmt_decimal(__v0_2, __local_54); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -261,26 +261,26 @@ condition: m.len() == 3 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_62 = __local_19; i32::fmt_decimal(43, __local_62); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: m.keys[0] == \"x\" "), used: 29 }); - String::append(__local_18, String { repr: array.new_data("m.keys[0]: "), used: 11 }); + String::push_str(__local_18, String { repr: array.new_data("m.keys[0]: "), used: 11 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; String^Inspect::inspect(__v0_4, __local_19); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -297,26 +297,26 @@ condition: m.keys[0] == \"x\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_71 = __local_21; i32::fmt_decimal(44, __local_71); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: m.keys[1] == \"y\" "), used: 29 }); - String::append(__local_20, String { repr: array.new_data("m.keys[1]: "), used: 11 }); + String::push_str(__local_20, String { repr: array.new_data("m.keys[1]: "), used: 11 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; String^Inspect::inspect(__v0_6, __local_21); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -333,26 +333,26 @@ condition: m.keys[1] == \"y\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_80 = __local_23; i32::fmt_decimal(45, __local_80); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: m.keys[2] == \"z\" "), used: 29 }); - String::append(__local_22, String { repr: array.new_data("m.keys[2]: "), used: 11 }); + String::push_str(__local_22, String { repr: array.new_data("m.keys[2]: "), used: 11 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; String^Inspect::inspect(__v0_8, __local_23); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -369,27 +369,27 @@ condition: m.keys[2] == \"z\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_89 = __local_25; i32::fmt_decimal(46, __local_89); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: m.values[0] == 10 "), used: 30 }); - String::append(__local_24, String { repr: array.new_data("m.values[0]: "), used: 13 }); + String::push_str(__local_24, String { repr: array.new_data("m.values[0]: "), used: 13 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_94 = __local_25; i32::fmt_decimal(__v0_10, __local_94); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -406,27 +406,27 @@ condition: m.values[0] == 10 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_26, 114); - String::append_char(__local_26, 117); - String::append_char(__local_26, 110); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_26, 114); + String::push(__local_26, 117); + String::push(__local_26, 110); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_102 = __local_27; i32::fmt_decimal(47, __local_102); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: m.values[1] == 20 "), used: 30 }); - String::append(__local_26, String { repr: array.new_data("m.values[1]: "), used: 13 }); + String::push_str(__local_26, String { repr: array.new_data("m.values[1]: "), used: 13 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_107 = __local_27; i32::fmt_decimal(__v0_12, __local_107); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -443,27 +443,27 @@ condition: m.values[1] == 20 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_28, 114); - String::append_char(__local_28, 117); - String::append_char(__local_28, 110); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_28, 114); + String::push(__local_28, 117); + String::push(__local_28, 110); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-custom.wado"), used: 53 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_115 = __local_29; i32::fmt_decimal(48, __local_115); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: m.values[2] == 30 "), used: 30 }); - String::append(__local_28, String { repr: array.new_data("m.values[2]: "), used: 13 }); + String::push_str(__local_28, String { repr: array.new_data("m.values[2]: "), used: 13 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_120 = __local_29; i32::fmt_decimal(__v0_14, __local_120); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -703,7 +703,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -791,7 +791,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -818,7 +818,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -860,7 +860,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -913,7 +913,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l54; }; @@ -947,20 +947,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -970,10 +970,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -983,10 +983,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -994,10 +994,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1009,7 +1009,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1026,22 +1026,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b73; @@ -1049,7 +1049,7 @@ fn String^Inspect::inspect(self, f) { continue l74; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/from-literal-enum-concrete.wir.wado b/wado-compiler/tests/fixtures.golden/from-literal-enum-concrete.wir.wado index aa9fe828f..030bfad46 100644 --- a/wado-compiler/tests/fixtures.golden/from-literal-enum-concrete.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from-literal-enum-concrete.wir.wado @@ -91,15 +91,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -159,11 +159,11 @@ fn run() with Stdout { break __seq_lit: __local_13; }) }; __local_21 = String { repr: array.new_data("north"), used: 5 }; - Array::append(__local_0.keys, __local_21); - Array::append(__local_0.values, 1); + Array::push(__local_0.keys, __local_21); + Array::push(__local_0.values, 1); __local_24 = String { repr: array.new_data("south"), used: 5 }; - Array::append(__local_0.keys, __local_24); - Array::append(__local_0.values, 2); + Array::push(__local_0.keys, __local_24); + Array::push(__local_0.values, 2); break __kv_lit: __local_0; }; __v0_2 = __inline_Array_String___len_12: block -> i32 { @@ -174,27 +174,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-enum-concrete.wado"), used: 60 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-enum-concrete.wado"), used: 60 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_31 = __local_7; i32::fmt_decimal(35, __local_31); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: m.keys.len() == 2 "), used: 30 }); - String::append(__local_6, String { repr: array.new_data("m.keys.len(): "), used: 14 }); + String::push_str(__local_6, String { repr: array.new_data("m.keys.len(): "), used: 14 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_36 = __local_7; i32::fmt_decimal(__v0_2, __local_36); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -211,27 +211,27 @@ condition: m.keys.len() == 2 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-enum-concrete.wado"), used: 60 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-enum-concrete.wado"), used: 60 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_44 = __local_9; i32::fmt_decimal(36, __local_44); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: m.values[0] == 1 "), used: 29 }); - String::append(__local_8, String { repr: array.new_data("m.values[0]: "), used: 13 }); + String::push_str(__local_8, String { repr: array.new_data("m.values[0]: "), used: 13 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_49 = __local_9; i32::fmt_decimal(__v0_4, __local_49); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -471,7 +471,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -486,7 +486,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -513,7 +513,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -555,7 +555,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -608,7 +608,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -642,20 +642,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -665,10 +665,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -678,10 +678,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -689,10 +689,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/from-literal-flags-concrete.wir.wado b/wado-compiler/tests/fixtures.golden/from-literal-flags-concrete.wir.wado index a19b26403..13890eaa5 100644 --- a/wado-compiler/tests/fixtures.golden/from-literal-flags-concrete.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from-literal-flags-concrete.wir.wado @@ -91,15 +91,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -159,11 +159,11 @@ fn run() with Stdout { break __seq_lit: __local_13; }) }; __local_21 = String { repr: array.new_data("read"), used: 4 }; - Array::append(__local_0.keys, __local_21); - Array::append(__local_0.values, 1); + Array::push(__local_0.keys, __local_21); + Array::push(__local_0.values, 1); __local_24 = String { repr: array.new_data("write"), used: 5 }; - Array::append(__local_0.keys, __local_24); - Array::append(__local_0.values, 2); + Array::push(__local_0.keys, __local_24); + Array::push(__local_0.values, 2); break __kv_lit: __local_0; }; __v0_2 = __inline_Array_String___len_12: block -> i32 { @@ -174,27 +174,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-flags-concrete.wado"), used: 61 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-flags-concrete.wado"), used: 61 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_31 = __local_7; i32::fmt_decimal(33, __local_31); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: m.keys.len() == 2 "), used: 30 }); - String::append(__local_6, String { repr: array.new_data("m.keys.len(): "), used: 14 }); + String::push_str(__local_6, String { repr: array.new_data("m.keys.len(): "), used: 14 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_36 = __local_7; i32::fmt_decimal(__v0_2, __local_36); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -211,27 +211,27 @@ condition: m.keys.len() == 2 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-flags-concrete.wado"), used: 61 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-flags-concrete.wado"), used: 61 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_44 = __local_9; i32::fmt_decimal(34, __local_44); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: m.values[0] == 1 "), used: 29 }); - String::append(__local_8, String { repr: array.new_data("m.values[0]: "), used: 13 }); + String::push_str(__local_8, String { repr: array.new_data("m.values[0]: "), used: 13 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_49 = __local_9; i32::fmt_decimal(__v0_4, __local_49); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -471,7 +471,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -486,7 +486,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -513,7 +513,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -555,7 +555,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -608,7 +608,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -642,20 +642,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -665,10 +665,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -678,10 +678,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -689,10 +689,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/from-literal-fn-arg.wir.wado b/wado-compiler/tests/fixtures.golden/from-literal-fn-arg.wir.wado index 5ee1fb467..5d4314e46 100644 --- a/wado-compiler/tests/fixtures.golden/from-literal-fn-arg.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from-literal-fn-arg.wir.wado @@ -99,15 +99,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -202,14 +202,14 @@ fn run() with Stdout { break __seq_lit: __local_16; }) }; __local_18 = String { repr: array.new_data("a"), used: 1 }; - Array::append(__local_0.keys, __local_18); - Array::append(__local_0.values, 1); + Array::push(__local_0.keys, __local_18); + Array::push(__local_0.values, 1); __local_21 = String { repr: array.new_data("b"), used: 1 }; - Array::append(__local_0.keys, __local_21); - Array::append(__local_0.values, 2); + Array::push(__local_0.keys, __local_21); + Array::push(__local_0.values, 2); __local_24 = String { repr: array.new_data("c"), used: 1 }; - Array::append(__local_0.keys, __local_24); - Array::append(__local_0.values, 3); + Array::push(__local_0.keys, __local_24); + Array::push(__local_0.values, 3); break __kv_lit: __local_0; }; __inline_Array_String___len_4: block -> i32 { @@ -222,29 +222,29 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-fn-arg.wado"), used: 53 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-fn-arg.wado"), used: 53 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_31 = __local_9; i32::fmt_decimal(60, __local_31); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: n == 3 "), used: 19 }); - String::append_char(__local_8, 110); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 110); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_36 = __local_9; i32::fmt_decimal(n, __local_36); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -258,40 +258,40 @@ condition: n == 3 break __seq_lit: __local_41; }) }; __local_43 = String { repr: array.new_data("x"), used: 1 }; - Array::append(__local_4.keys, __local_43); - Array::append(__local_4.values, 10); + Array::push(__local_4.keys, __local_43); + Array::push(__local_4.values, 10); __local_46 = String { repr: array.new_data("y"), used: 1 }; - Array::append(__local_4.keys, __local_46); - Array::append(__local_4.values, 20); + Array::push(__local_4.keys, __local_46); + Array::push(__local_4.values, 20); break __kv_lit: __local_4; }); __cond_7 = s == 30; if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-fn-arg.wado"), used: 53 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-fn-arg.wado"), used: 53 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_52 = __local_11; i32::fmt_decimal(63, __local_52); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: s == 30 "), used: 20 }); - String::append_char(__local_10, 115); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 115); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_57 = __local_11; i32::fmt_decimal(s, __local_57); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -531,7 +531,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -546,7 +546,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -573,7 +573,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -615,7 +615,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -678,7 +678,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l38; }; @@ -712,20 +712,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -735,10 +735,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -748,10 +748,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -759,10 +759,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/from-literal-nested-generic.wir.wado b/wado-compiler/tests/fixtures.golden/from-literal-nested-generic.wir.wado index 037af10e3..391574a53 100644 --- a/wado-compiler/tests/fixtures.golden/from-literal-nested-generic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from-literal-nested-generic.wir.wado @@ -91,15 +91,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -152,11 +152,11 @@ fn run() with Stdout { break __seq_lit: __local_9; }) }; __local_11 = String { repr: array.new_data("a"), used: 1 }; - Array::append(__local_0.keys, __local_11); - Array::append(__local_0.values, 1); + Array::push(__local_0.keys, __local_11); + Array::push(__local_0.values, 1); __local_14 = String { repr: array.new_data("b"), used: 1 }; - Array::append(__local_0.keys, __local_14); - Array::append(__local_0.values, 2); + Array::push(__local_0.keys, __local_14); + Array::push(__local_0.values, 2); break __kv_lit: __local_0; }; __v0 = __inline_Array_String___len_7: block -> i32 { @@ -167,27 +167,27 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-nested-generic.wado"), used: 61 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-nested-generic.wado"), used: 61 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_21 = __local_5; i32::fmt_decimal(36, __local_21); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: m.keys.len() == 2 "), used: 30 }); - String::append(__local_4, String { repr: array.new_data("m.keys.len(): "), used: 14 }); + String::push_str(__local_4, String { repr: array.new_data("m.keys.len(): "), used: 14 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_26 = __local_5; i32::fmt_decimal(__v0, __local_26); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -427,7 +427,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -442,7 +442,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -469,7 +469,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -511,7 +511,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -564,7 +564,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l33; }; @@ -598,20 +598,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -621,10 +621,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -634,10 +634,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -645,10 +645,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/from-literal-newtype-concrete.wir.wado b/wado-compiler/tests/fixtures.golden/from-literal-newtype-concrete.wir.wado index 92599c8bb..34cc46210 100644 --- a/wado-compiler/tests/fixtures.golden/from-literal-newtype-concrete.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from-literal-newtype-concrete.wir.wado @@ -91,15 +91,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -159,11 +159,11 @@ fn run() with Stdout { break __seq_lit: __local_13; }) }; __local_21 = String { repr: array.new_data("a"), used: 1 }; - Array::append(__local_0.keys, __local_21); - Array::append(__local_0.values, 1); + Array::push(__local_0.keys, __local_21); + Array::push(__local_0.values, 1); __local_24 = String { repr: array.new_data("b"), used: 1 }; - Array::append(__local_0.keys, __local_24); - Array::append(__local_0.values, 2); + Array::push(__local_0.keys, __local_24); + Array::push(__local_0.values, 2); break __kv_lit: __local_0; }; __v0_2 = __inline_Array_String___len_12: block -> i32 { @@ -174,27 +174,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-newtype-concrete.wado"), used: 63 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-newtype-concrete.wado"), used: 63 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_31 = __local_7; i32::fmt_decimal(30, __local_31); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: m.keys.len() == 2 "), used: 30 }); - String::append(__local_6, String { repr: array.new_data("m.keys.len(): "), used: 14 }); + String::push_str(__local_6, String { repr: array.new_data("m.keys.len(): "), used: 14 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_36 = __local_7; i32::fmt_decimal(__v0_2, __local_36); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -211,27 +211,27 @@ condition: m.keys.len() == 2 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-newtype-concrete.wado"), used: 63 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-newtype-concrete.wado"), used: 63 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_44 = __local_9; i32::fmt_decimal(31, __local_44); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: m.values[0] == 1 "), used: 29 }); - String::append(__local_8, String { repr: array.new_data("m.values[0]: "), used: 13 }); + String::push_str(__local_8, String { repr: array.new_data("m.values[0]: "), used: 13 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_49 = __local_9; i32::fmt_decimal(__v0_4, __local_49); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -471,7 +471,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -486,7 +486,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -513,7 +513,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -555,7 +555,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -608,7 +608,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -642,20 +642,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -665,10 +665,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -678,10 +678,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -689,10 +689,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/from-literal-return.wir.wado b/wado-compiler/tests/fixtures.golden/from-literal-return.wir.wado index b166152a2..6223893bd 100644 --- a/wado-compiler/tests/fixtures.golden/from-literal-return.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from-literal-return.wir.wado @@ -122,7 +122,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -130,9 +130,9 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -148,7 +148,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -214,27 +214,27 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-return.wado"), used: 53 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-return.wado"), used: 53 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_11 = __local_5; i32::fmt_decimal(12, __local_11); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: keys.len() == 2 "), used: 28 }); - String::append(__local_4, String { repr: array.new_data("keys.len(): "), used: 12 }); + String::push_str(__local_4, String { repr: array.new_data("keys.len(): "), used: 12 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_16 = __local_5; i32::fmt_decimal(__v0, __local_16); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -474,7 +474,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -561,7 +561,7 @@ fn String^Ord::cmp(self, other) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -588,7 +588,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -651,7 +651,7 @@ fn TreeMap::keys(self) { if ref.is_null(__pattern_temp_0) == 0 { entry = value_copy "core:allocator/TreeMapEntry"(ref.as_non_null(__pattern_temp_0)); if entry.deleted == 0 { - Array::append(result, entry.key); + Array::push(result, entry.key); }; } else { break b40; @@ -695,7 +695,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_i32____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -769,7 +769,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -868,7 +868,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l69; }; @@ -902,20 +902,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -925,10 +925,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -938,10 +938,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -949,10 +949,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/from-literal-variant-concrete.wir.wado b/wado-compiler/tests/fixtures.golden/from-literal-variant-concrete.wir.wado index 8f9527c4e..89d61f3d1 100644 --- a/wado-compiler/tests/fixtures.golden/from-literal-variant-concrete.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from-literal-variant-concrete.wir.wado @@ -91,15 +91,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -159,11 +159,11 @@ fn run() with Stdout { break __seq_lit: __local_13; }) }; __local_21 = String { repr: array.new_data("active"), used: 6 }; - Array::append(__local_0.keys, __local_21); - Array::append(__local_0.values, 1); + Array::push(__local_0.keys, __local_21); + Array::push(__local_0.values, 1); __local_24 = String { repr: array.new_data("inactive"), used: 8 }; - Array::append(__local_0.keys, __local_24); - Array::append(__local_0.values, 2); + Array::push(__local_0.keys, __local_24); + Array::push(__local_0.values, 2); break __kv_lit: __local_0; }; __v0_2 = __inline_Array_String___len_12: block -> i32 { @@ -174,27 +174,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-variant-concrete.wado"), used: 63 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-variant-concrete.wado"), used: 63 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_31 = __local_7; i32::fmt_decimal(33, __local_31); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: m.keys.len() == 2 "), used: 30 }); - String::append(__local_6, String { repr: array.new_data("m.keys.len(): "), used: 14 }); + String::push_str(__local_6, String { repr: array.new_data("m.keys.len(): "), used: 14 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_36 = __local_7; i32::fmt_decimal(__v0_2, __local_36); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -211,27 +211,27 @@ condition: m.keys.len() == 2 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-variant-concrete.wado"), used: 63 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/from-literal-variant-concrete.wado"), used: 63 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_44 = __local_9; i32::fmt_decimal(34, __local_44); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: m.values[0] == 1 "), used: 29 }); - String::append(__local_8, String { repr: array.new_data("m.values[0]: "), used: 13 }); + String::push_str(__local_8, String { repr: array.new_data("m.values[0]: "), used: 13 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_49 = __local_9; i32::fmt_decimal(__v0_4, __local_49); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -471,7 +471,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -486,7 +486,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -513,7 +513,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -555,7 +555,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -608,7 +608,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -642,20 +642,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -665,10 +665,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -678,10 +678,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -689,10 +689,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/from_char_to_string.wir.wado b/wado-compiler/tests/fixtures.golden/from_char_to_string.wir.wado index 979b1974d..fe4ab80ac 100644 --- a/wado-compiler/tests/fixtures.golden/from_char_to_string.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from_char_to_string.wir.wado @@ -78,13 +78,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -141,7 +141,7 @@ fn run() with Stdout { let __local_51: ref Formatter; s = __inline_String_From_char___from_2: block -> ref String { __local_20 = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(__local_20, 65); + String::push(__local_20, 65); break __inline_String_From_char___from_2: __local_20; }; __v0_2 = s; @@ -149,35 +149,35 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/from_char_to_string.wado"), used: 53 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/from_char_to_string.wado"), used: 53 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_25 = __local_13; i32::fmt_decimal(7, __local_25); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: s == \"A\" "), used: 21 }); - String::append_char(__local_12, 115); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 115); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_2, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; }; s2 = __inline_String_From_char___from_9: block -> ref String { __local_30 = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(__local_30, 129408); + String::push(__local_30, 129408); break __inline_String_From_char___from_9: __local_30; }; __v0_6 = s2; @@ -185,36 +185,36 @@ condition: s == \"A\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/from_char_to_string.wado"), used: 53 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/from_char_to_string.wado"), used: 53 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_35 = __local_15; i32::fmt_decimal(11, __local_35); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: s2 == \"🦀\" "), used: 25 }); - String::append_char(__local_14, 115); - String::append_char(__local_14, 50); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 115); + String::push(__local_14, 50); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; String^Inspect::inspect(__v0_6, __local_15); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; }; s3 = __inline_String_From_char___from_16: block -> ref String { __local_40 = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(__local_40, 10); + String::push(__local_40, 10); break __inline_String_From_char___from_16: __local_40; }; __v0_10 = s3.used; @@ -222,27 +222,27 @@ condition: s2 == \"🦀\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/from_char_to_string.wado"), used: 53 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/from_char_to_string.wado"), used: 53 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_46 = __local_17; i32::fmt_decimal(15, __local_46); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: s3.len() == 1 "), used: 26 }); - String::append(__local_16, String { repr: array.new_data("s3.len(): "), used: 10 }); + String::push_str(__local_16, String { repr: array.new_data("s3.len(): "), used: 10 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_51 = __local_17; i32::fmt_decimal(__v0_10, __local_51); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -482,7 +482,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -570,7 +570,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -608,7 +608,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l36; }; @@ -642,20 +642,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -665,10 +665,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -678,10 +678,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -689,10 +689,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -704,7 +704,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -721,22 +721,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b55; @@ -744,7 +744,7 @@ fn String^Inspect::inspect(self, f) { continue l56; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/from_numeric_widening.wir.wado b/wado-compiler/tests/fixtures.golden/from_numeric_widening.wir.wado index b4f848a3b..3ceb5cd09 100644 --- a/wado-compiler/tests/fixtures.golden/from_numeric_widening.wir.wado +++ b/wado-compiler/tests/fixtures.golden/from_numeric_widening.wir.wado @@ -97,7 +97,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -107,9 +107,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -192,29 +192,29 @@ fn run() with Stdout { if __cond_45 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_88 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_88, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_88, 114); - String::append_char(__local_88, 117); - String::append_char(__local_88, 110); - String::append_char(__local_88, 32); - String::append_char(__local_88, 97); - String::append_char(__local_88, 116); - String::append_char(__local_88, 32); - String::append(__local_88, String { repr: array.new_data("wado-compiler/tests/fixtures/from_numeric_widening.wado"), used: 55 }); - String::append_char(__local_88, 58); + String::push_str(__local_88, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_88, 114); + String::push(__local_88, 117); + String::push(__local_88, 110); + String::push(__local_88, 32); + String::push(__local_88, 97); + String::push(__local_88, 116); + String::push(__local_88, 32); + String::push_str(__local_88, String { repr: array.new_data("wado-compiler/tests/fixtures/from_numeric_widening.wado"), used: 55 }); + String::push(__local_88, 58); __local_89 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_88 }; __local_316 = __local_89; i32::fmt_decimal(37, __local_316); - String::append(__local_88, String { repr: array.new_data(" + String::push_str(__local_88, String { repr: array.new_data(" condition: h > 3.13 "), used: 21 }); - String::append_char(__local_88, 104); - String::append_char(__local_88, 58); - String::append_char(__local_88, 32); + String::push(__local_88, 104); + String::push(__local_88, 58); + String::push(__local_88, 32); __local_89 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_88 }; __local_321 = __local_89; f64::inspect_into(h, __local_321); - String::append_char(__local_88, 10); + String::push(__local_88, 10); break __tmpl: __local_88; }); unreachable; @@ -223,29 +223,29 @@ condition: h > 3.13 if __cond_47 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_90 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_90, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_90, 114); - String::append_char(__local_90, 117); - String::append_char(__local_90, 110); - String::append_char(__local_90, 32); - String::append_char(__local_90, 97); - String::append_char(__local_90, 116); - String::append_char(__local_90, 32); - String::append(__local_90, String { repr: array.new_data("wado-compiler/tests/fixtures/from_numeric_widening.wado"), used: 55 }); - String::append_char(__local_90, 58); + String::push_str(__local_90, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_90, 114); + String::push(__local_90, 117); + String::push(__local_90, 110); + String::push(__local_90, 32); + String::push(__local_90, 97); + String::push(__local_90, 116); + String::push(__local_90, 32); + String::push_str(__local_90, String { repr: array.new_data("wado-compiler/tests/fixtures/from_numeric_widening.wado"), used: 55 }); + String::push(__local_90, 58); __local_91 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_90 }; __local_325 = __local_91; i32::fmt_decimal(38, __local_325); - String::append(__local_90, String { repr: array.new_data(" + String::push_str(__local_90, String { repr: array.new_data(" condition: h < 3.15 "), used: 21 }); - String::append_char(__local_90, 104); - String::append_char(__local_90, 58); - String::append_char(__local_90, 32); + String::push(__local_90, 104); + String::push(__local_90, 58); + String::push(__local_90, 32); __local_91 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_90 }; __local_330 = __local_91; f64::inspect_into(h, __local_330); - String::append_char(__local_90, 10); + String::push(__local_90, 10); break __tmpl: __local_90; }); unreachable; @@ -258,27 +258,27 @@ condition: h < 3.15 if __cond_49 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_92 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_92, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_92, 114); - String::append_char(__local_92, 117); - String::append_char(__local_92, 110); - String::append_char(__local_92, 32); - String::append_char(__local_92, 97); - String::append_char(__local_92, 116); - String::append_char(__local_92, 32); - String::append(__local_92, String { repr: array.new_data("wado-compiler/tests/fixtures/from_numeric_widening.wado"), used: 55 }); - String::append_char(__local_92, 58); + String::push_str(__local_92, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_92, 114); + String::push(__local_92, 117); + String::push(__local_92, 110); + String::push(__local_92, 32); + String::push(__local_92, 97); + String::push(__local_92, 116); + String::push(__local_92, 32); + String::push_str(__local_92, String { repr: array.new_data("wado-compiler/tests/fixtures/from_numeric_widening.wado"), used: 55 }); + String::push(__local_92, 58); __local_93 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_92 }; __local_335 = __local_93; i32::fmt_decimal(40, __local_335); - String::append(__local_92, String { repr: array.new_data(" + String::push_str(__local_92, String { repr: array.new_data(" condition: i32::from(true) == 1 "), used: 33 }); - String::append(__local_92, String { repr: array.new_data("i32::from(true): "), used: 17 }); + String::push_str(__local_92, String { repr: array.new_data("i32::from(true): "), used: 17 }); __local_93 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_92 }; __local_340 = __local_93; i32::fmt_decimal(__v0, __local_340); - String::append_char(__local_92, 10); + String::push(__local_92, 10); break __tmpl: __local_92; }); unreachable; @@ -1047,8 +1047,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1103,13 +1103,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1117,25 +1117,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1143,7 +1143,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1185,8 +1185,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1218,7 +1218,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1347,27 +1347,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1490,9 +1490,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1502,8 +1502,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1558,13 +1558,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1599,9 +1599,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1654,7 +1654,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1669,7 +1669,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1707,7 +1707,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l165; }; @@ -1865,20 +1865,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1888,10 +1888,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1901,10 +1901,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1912,10 +1912,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/generic_advanced.wir.wado b/wado-compiler/tests/fixtures.golden/generic_advanced.wir.wado index 5eb73bf79..0d78893e2 100644 --- a/wado-compiler/tests/fixtures.golden/generic_advanced.wir.wado +++ b/wado-compiler/tests/fixtures.golden/generic_advanced.wir.wado @@ -107,13 +107,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/BTPoint^Inspect::inspect" = fn(ref BTPoint, ref Formatter); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -189,29 +189,29 @@ fn __test_0_box_with_trait_method() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_0_box_with_trait_method"), used: 30 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_0_box_with_trait_method"), used: 30 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_40 = __local_22; i32::fmt_decimal(28, __local_40); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: p.x == 10 "), used: 22 }); - String::append_char(__local_21, 112); - String::append_char(__local_21, 46); - String::append_char(__local_21, 120); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 112); + String::push(__local_21, 46); + String::push(__local_21, 120); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_45 = __local_22; i32::fmt_decimal(__v0_2, __local_45); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -221,29 +221,29 @@ condition: p.x == 10 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("__test_0_box_with_trait_method"), used: 30 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("__test_0_box_with_trait_method"), used: 30 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_51 = __local_24; i32::fmt_decimal(29, __local_51); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: p.y == 20 "), used: 22 }); - String::append_char(__local_23, 112); - String::append_char(__local_23, 46); - String::append_char(__local_23, 121); - String::append_char(__local_23, 58); - String::append_char(__local_23, 32); + String::push(__local_23, 112); + String::push(__local_23, 46); + String::push(__local_23, 121); + String::push(__local_23, 58); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_56 = __local_24; i32::fmt_decimal(__v0_4, __local_56); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -255,29 +255,29 @@ condition: p.y == 20 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("__test_0_box_with_trait_method"), used: 30 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("__test_0_box_with_trait_method"), used: 30 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_64 = __local_26; i32::fmt_decimal(32, __local_64); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: p.x == 10 "), used: 22 }); - String::append_char(__local_25, 112); - String::append_char(__local_25, 46); - String::append_char(__local_25, 120); - String::append_char(__local_25, 58); - String::append_char(__local_25, 32); + String::push(__local_25, 112); + String::push(__local_25, 46); + String::push(__local_25, 120); + String::push(__local_25, 58); + String::push(__local_25, 32); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_69 = __local_26; i32::fmt_decimal(__v0_6, __local_69); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -287,25 +287,25 @@ condition: p.x == 10 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("__test_0_box_with_trait_method"), used: 30 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("__test_0_box_with_trait_method"), used: 30 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_75 = __local_28; i32::fmt_decimal(33, __local_75); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: b.value.x == 99 "), used: 28 }); - String::append(__local_27, String { repr: array.new_data("b.value.x: "), used: 11 }); + String::push_str(__local_27, String { repr: array.new_data("b.value.x: "), used: 11 }); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_80 = __local_28; i32::fmt_decimal(__v0_8, __local_80); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -322,28 +322,28 @@ condition: b.value.x == 99 if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(160), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_33, String { repr: array.new_data("__test_0_box_with_trait_method"), used: 30 }); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_33, String { repr: array.new_data("__test_0_box_with_trait_method"), used: 30 }); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_114 = __local_34; i32::fmt_decimal(42, __local_114); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: pa.get() == pb.get() "), used: 33 }); - String::append(__local_33, String { repr: array.new_data("pa.get(): "), used: 10 }); + String::push_str(__local_33, String { repr: array.new_data("pa.get(): "), used: 10 }); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; BTPoint^Inspect::inspect(__v0_18, __local_34); - String::append_char(__local_33, 10); - String::append(__local_33, String { repr: array.new_data("pb.get(): "), used: 10 }); + String::push(__local_33, 10); + String::push_str(__local_33, String { repr: array.new_data("pb.get(): "), used: 10 }); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; BTPoint^Inspect::inspect(__v1, __local_34); - String::append_char(__local_33, 10); + String::push(__local_33, 10); break __tmpl: __local_33; }); unreachable; @@ -381,33 +381,33 @@ fn __test_1_field_monomorphization() { __local_18 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_18; }; - Array::append(__sroa_container_items, 10); - Array::append(__sroa_container_items, 20); - Array::append(__sroa_container_items, 30); + Array::push(__sroa_container_items, 10); + Array::push(__sroa_container_items, 20); + Array::push(__sroa_container_items, 30); __v0_1 = __sroa_container_items.used; __cond_2 = __v0_1 == 3; if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_1_field_monomorphization"), used: 31 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_1_field_monomorphization"), used: 31 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_33 = __local_10; i32::fmt_decimal(69, __local_33); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: container.len() == 3 "), used: 33 }); - String::append(__local_9, String { repr: array.new_data("container.len(): "), used: 17 }); + String::push_str(__local_9, String { repr: array.new_data("container.len(): "), used: 17 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_38 = __local_10; i32::fmt_decimal(__v0_1, __local_38); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -423,25 +423,25 @@ condition: container.len() == 3 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_1_field_monomorphization"), used: 31 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_1_field_monomorphization"), used: 31 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_48 = __local_12; i32::fmt_decimal(70, __local_48); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: container.get(0) == 10 "), used: 35 }); - String::append(__local_11, String { repr: array.new_data("container.get(0): "), used: 18 }); + String::push_str(__local_11, String { repr: array.new_data("container.get(0): "), used: 18 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_53 = __local_12; i32::fmt_decimal(__v0_3, __local_53); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -457,25 +457,25 @@ condition: container.get(0) == 10 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_1_field_monomorphization"), used: 31 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_1_field_monomorphization"), used: 31 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_63 = __local_14; i32::fmt_decimal(71, __local_63); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: container.get(1) == 20 "), used: 35 }); - String::append(__local_13, String { repr: array.new_data("container.get(1): "), used: 18 }); + String::push_str(__local_13, String { repr: array.new_data("container.get(1): "), used: 18 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_68 = __local_14; i32::fmt_decimal(__v0_5, __local_68); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -491,25 +491,25 @@ condition: container.get(1) == 20 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_1_field_monomorphization"), used: 31 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_1_field_monomorphization"), used: 31 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_78 = __local_16; i32::fmt_decimal(72, __local_78); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: container.get(2) == 30 "), used: 35 }); - String::append(__local_15, String { repr: array.new_data("container.get(2): "), used: 18 }); + String::push_str(__local_15, String { repr: array.new_data("container.get(2): "), used: 18 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_83 = __local_16; i32::fmt_decimal(__v0_7, __local_83); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -684,32 +684,32 @@ fn __test_2_quicksort_with_closure_param() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_2_quicksort_with_closure_param"), used: 37 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_2_quicksort_with_closure_param"), used: 37 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_50 = __local_13; i32::fmt_decimal(103, __local_50); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: arr[0] == 1 "), used: 24 }); - String::append_char(__local_12, 97); - String::append_char(__local_12, 114); - String::append_char(__local_12, 114); - String::append_char(__local_12, 91); - String::append_char(__local_12, 48); - String::append_char(__local_12, 93); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 114); + String::push(__local_12, 114); + String::push(__local_12, 91); + String::push(__local_12, 48); + String::push(__local_12, 93); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_55 = __local_13; i32::fmt_decimal(__v0_2, __local_55); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -725,32 +725,32 @@ condition: arr[0] == 1 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_2_quicksort_with_closure_param"), used: 37 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_2_quicksort_with_closure_param"), used: 37 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_63 = __local_15; i32::fmt_decimal(104, __local_63); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: arr[4] == 5 "), used: 24 }); - String::append_char(__local_14, 97); - String::append_char(__local_14, 114); - String::append_char(__local_14, 114); - String::append_char(__local_14, 91); - String::append_char(__local_14, 52); - String::append_char(__local_14, 93); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 114); + String::push(__local_14, 114); + String::push(__local_14, 91); + String::push(__local_14, 52); + String::push(__local_14, 93); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_68 = __local_15; i32::fmt_decimal(__v0_4, __local_68); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -766,32 +766,32 @@ condition: arr[4] == 5 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_2_quicksort_with_closure_param"), used: 37 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_2_quicksort_with_closure_param"), used: 37 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_76 = __local_17; i32::fmt_decimal(105, __local_76); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: arr[8] == 9 "), used: 24 }); - String::append_char(__local_16, 97); - String::append_char(__local_16, 114); - String::append_char(__local_16, 114); - String::append_char(__local_16, 91); - String::append_char(__local_16, 56); - String::append_char(__local_16, 93); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 114); + String::push(__local_16, 114); + String::push(__local_16, 91); + String::push(__local_16, 56); + String::push(__local_16, 93); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_81 = __local_17; i32::fmt_decimal(__v0_6, __local_81); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -808,32 +808,32 @@ condition: arr[8] == 9 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_2_quicksort_with_closure_param"), used: 37 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_2_quicksort_with_closure_param"), used: 37 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_90 = __local_19; i32::fmt_decimal(108, __local_90); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: arr[0] == 9 "), used: 24 }); - String::append_char(__local_18, 97); - String::append_char(__local_18, 114); - String::append_char(__local_18, 114); - String::append_char(__local_18, 91); - String::append_char(__local_18, 48); - String::append_char(__local_18, 93); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 114); + String::push(__local_18, 114); + String::push(__local_18, 91); + String::push(__local_18, 48); + String::push(__local_18, 93); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_95 = __local_19; i32::fmt_decimal(__v0_8, __local_95); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -849,32 +849,32 @@ condition: arr[0] == 9 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_2_quicksort_with_closure_param"), used: 37 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_2_quicksort_with_closure_param"), used: 37 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_advanced.wado"), used: 50 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_103 = __local_21; i32::fmt_decimal(109, __local_103); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: arr[8] == 1 "), used: 24 }); - String::append_char(__local_20, 97); - String::append_char(__local_20, 114); - String::append_char(__local_20, 114); - String::append_char(__local_20, 91); - String::append_char(__local_20, 56); - String::append_char(__local_20, 93); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 114); + String::push(__local_20, 114); + String::push(__local_20, 91); + String::push(__local_20, 56); + String::push(__local_20, 93); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_108 = __local_21; i32::fmt_decimal(__v0_10, __local_108); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -1105,7 +1105,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1120,7 +1120,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1154,20 +1154,20 @@ fn BTPoint^Inspect::inspect(self, f) { let s_13: ref String; let s_19: ref String; s_3 = String { repr: array.new_data("BTPoint { "), used: 10 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("x: "), used: 3 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self.x, f); s_11 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); s_13 = String { repr: array.new_data("y: "), used: 3 }; - String::append(f.buf, s_13); + String::push_str(f.buf, s_13); i32::fmt_decimal(self.y, f); s_19 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1228,7 +1228,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l68; }; @@ -1262,20 +1262,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1285,10 +1285,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1298,10 +1298,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1309,10 +1309,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/generic_forward_variant.wir.wado b/wado-compiler/tests/fixtures.golden/generic_forward_variant.wir.wado index aa285805e..1f13b1a5e 100644 --- a/wado-compiler/tests/fixtures.golden/generic_forward_variant.wir.wado +++ b/wado-compiler/tests/fixtures.golden/generic_forward_variant.wir.wado @@ -92,9 +92,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -138,27 +138,27 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_forward_variant.wado"), used: 57 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_forward_variant.wado"), used: 57 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(40, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: counter.count == 10 "), used: 32 }); - String::append(__local_4, String { repr: array.new_data("counter.count: "), used: 15 }); + String::push_str(__local_4, String { repr: array.new_data("counter.count: "), used: 15 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(__v0, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -389,7 +389,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -404,7 +404,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -442,7 +442,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -476,20 +476,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -499,10 +499,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -512,10 +512,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -523,10 +523,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/generic_function_merged.wir.wado b/wado-compiler/tests/fixtures.golden/generic_function_merged.wir.wado index 977ac8abe..2881060bb 100644 --- a/wado-compiler/tests/fixtures.golden/generic_function_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/generic_function_merged.wir.wado @@ -127,7 +127,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -137,13 +137,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -233,26 +233,26 @@ fn __test_1_with_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_1_with_string"), used: 20 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_function_merged.wado"), used: 57 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_1_with_string"), used: 20 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_function_merged.wado"), used: 57 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(22, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: s == \"hello\" "), used: 25 }); - String::append_char(__local_3, 115); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 115); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -292,27 +292,27 @@ fn __test_3_multi_instantiations() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_3_multi_instantiations"), used: 29 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_function_merged.wado"), used: 57 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_3_multi_instantiations"), used: 29 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_function_merged.wado"), used: 57 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_55 = __local_20; i32::fmt_decimal(48, __local_55); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: c == 3.5 as f32 "), used: 28 }); - String::append_char(__local_19, 99); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 99); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_60 = __local_20; f32::inspect_into(c, __local_60); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -373,26 +373,26 @@ fn __test_7_two_params_swap() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_7_two_params_swap"), used: 24 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_function_merged.wado"), used: 57 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_7_two_params_swap"), used: 24 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_function_merged.wado"), used: 57 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_46 = __local_14; i32::fmt_decimal(107, __local_46); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: z == \"hello\" "), used: 25 }); - String::append_char(__local_13, 122); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 122); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; String^Inspect::inspect(__v0, __local_14); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -1236,8 +1236,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1292,13 +1292,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1306,25 +1306,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1332,7 +1332,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1374,8 +1374,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1407,7 +1407,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1536,27 +1536,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1681,9 +1681,9 @@ fn f32::inspect_into(self, f) { break __inline_String__len_6: __local_23.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1693,8 +1693,8 @@ fn f32::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1749,13 +1749,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1790,9 +1790,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1845,7 +1845,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1933,7 +1933,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1971,7 +1971,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l189; }; @@ -2129,20 +2129,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2152,10 +2152,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2165,10 +2165,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2176,10 +2176,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -2191,7 +2191,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -2208,22 +2208,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b224; @@ -2231,7 +2231,7 @@ fn String^Inspect::inspect(self, f) { continue l225; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_basic_turbofish as "__test_0_basic_turbofish" diff --git a/wado-compiler/tests/fixtures.golden/generic_method_merged.wir.wado b/wado-compiler/tests/fixtures.golden/generic_method_merged.wir.wado index a00bd9706..fafabd365 100644 --- a/wado-compiler/tests/fixtures.golden/generic_method_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/generic_method_merged.wir.wado @@ -120,7 +120,7 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -128,13 +128,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -237,32 +237,32 @@ fn __test_4_double_generics() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_4_double_generics"), used: 24 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_method_merged.wado"), used: 55 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_4_double_generics"), used: 24 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_method_merged.wado"), used: 55 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_43 = __local_18; i32::fmt_decimal(103, __local_43); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: result == 100 "), used: 26 }); - String::append_char(__local_17, 114); - String::append_char(__local_17, 101); - String::append_char(__local_17, 115); - String::append_char(__local_17, 117); - String::append_char(__local_17, 108); - String::append_char(__local_17, 116); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 114); + String::push(__local_17, 101); + String::push(__local_17, 115); + String::push(__local_17, 117); + String::push(__local_17, 108); + String::push(__local_17, 116); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_48 = __local_18; i32::fmt_decimal(result, __local_48); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -275,25 +275,25 @@ condition: result == 100 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("__test_4_double_generics"), used: 24 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_method_merged.wado"), used: 55 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("__test_4_double_generics"), used: 24 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_method_merged.wado"), used: 55 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_89 = __local_24; i32::fmt_decimal(109, __local_89); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: c2.transform(99) == 99 "), used: 35 }); - String::append(__local_23, String { repr: array.new_data("c2.transform(99): "), used: 18 }); + String::push_str(__local_23, String { repr: array.new_data("c2.transform(99): "), used: 18 }); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_94 = __local_24; i32::fmt_decimal(__v0, __local_94); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -327,26 +327,26 @@ fn __test_5_static_trait_method_through_type_param() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_5_static_trait_method_through_type_param"), used: 47 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_method_merged.wado"), used: 55 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_5_static_trait_method_through_type_param"), used: 47 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_method_merged.wado"), used: 55 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_30 = __local_9; i32::fmt_decimal(136, __local_30); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: b == \"99\" "), used: 22 }); - String::append_char(__local_8, 98); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 98); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -399,25 +399,25 @@ fn __test_7_closure_param() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_7_closure_param"), used: 22 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_method_merged.wado"), used: 55 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_7_closure_param"), used: 22 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_method_merged.wado"), used: 55 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_19 = __local_8; i32::fmt_decimal(186, __local_19); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: result1 == 10 "), used: 26 }); - String::append(__local_7, String { repr: array.new_data("result1: "), used: 9 }); + String::push_str(__local_7, String { repr: array.new_data("result1: "), used: 9 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_24 = __local_8; i32::fmt_decimal(result1, __local_24); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -449,25 +449,25 @@ condition: result1 == 10 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_7_closure_param"), used: 22 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_method_merged.wado"), used: 55 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_7_closure_param"), used: 22 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_method_merged.wado"), used: 55 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_39 = __local_10; i32::fmt_decimal(188, __local_39); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: result2 == 20 "), used: 26 }); - String::append(__local_9, String { repr: array.new_data("result2: "), used: 9 }); + String::push_str(__local_9, String { repr: array.new_data("result2: "), used: 9 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_44 = __local_10; i32::fmt_decimal(result2, __local_44); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -684,7 +684,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -780,7 +780,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -868,7 +868,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -910,7 +910,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l56; }; @@ -944,20 +944,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -967,10 +967,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -980,10 +980,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -991,10 +991,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1006,7 +1006,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1023,22 +1023,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b75; @@ -1046,7 +1046,7 @@ fn String^Inspect::inspect(self, f) { continue l76; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/generic_method_merged.wado/__closure_wrapper_0"(__env, __p0) { diff --git a/wado-compiler/tests/fixtures.golden/generic_struct_1.wir.wado b/wado-compiler/tests/fixtures.golden/generic_struct_1.wir.wado index 3d6f12cef..ed0301c33 100644 --- a/wado-compiler/tests/fixtures.golden/generic_struct_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/generic_struct_1.wir.wado @@ -213,7 +213,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -223,7 +223,7 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -231,7 +231,7 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/TreeMap^IndexValue::index_value" = fn(ref "core:allocator/TreeMap", ref String) -> i32; @@ -245,19 +245,19 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, ref Point); +type "functype/Array::push" = fn(ref Array, ref Point); type "functype/Array::grow" = fn(ref Array); -type "functype/Array>::append" = fn(ref Array>, ref Pair); +type "functype/Array>::push" = fn(ref Array>, ref Pair); type "functype/Array>::grow" = fn(ref Array>); @@ -351,24 +351,24 @@ fn __test_1_different_types() { if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_1_different_types"), used: 24 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_1_different_types"), used: 24 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_48 = __local_20; i32::fmt_decimal(28, __local_48); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: str_box.value == \"hello\" "), used: 37 }); - String::append(__local_19, String { repr: array.new_data("str_box.value: "), used: 15 }); + String::push_str(__local_19, String { repr: array.new_data("str_box.value: "), used: 15 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; String^Inspect::inspect(__v0, __local_20); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -377,24 +377,24 @@ condition: str_box.value == \"hello\" if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("__test_1_different_types"), used: 24 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("__test_1_different_types"), used: 24 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_66 = __local_24; i32::fmt_decimal(30, __local_66); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: char_box.value == 'A' "), used: 34 }); - String::append(__local_23, String { repr: array.new_data("char_box.value: "), used: 16 }); + String::push_str(__local_23, String { repr: array.new_data("char_box.value: "), used: 16 }); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; char^Inspect::inspect(65, __local_24); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -431,25 +431,25 @@ fn __test_2_explicit_type_annotations() { if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("__test_2_explicit_type_annotations"), used: 34 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("__test_2_explicit_type_annotations"), used: 34 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_60 = __local_26; i32::fmt_decimal(43, __local_60); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: f32_box.value == 2.5 as f32 "), used: 40 }); - String::append(__local_25, String { repr: array.new_data("f32_box.value: "), used: 15 }); + String::push_str(__local_25, String { repr: array.new_data("f32_box.value: "), used: 15 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_65 = __local_26; f32::inspect_into(__sroa_f32_box_value, __local_65); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -458,24 +458,24 @@ condition: f32_box.value == 2.5 as f32 if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_31, String { repr: array.new_data("__test_2_explicit_type_annotations"), used: 34 }); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_31, String { repr: array.new_data("__test_2_explicit_type_annotations"), used: 34 }); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_89 = __local_32; i32::fmt_decimal(46, __local_89); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: char_box.value == 'Z' "), used: 34 }); - String::append(__local_31, String { repr: array.new_data("char_box.value: "), used: 16 }); + String::push_str(__local_31, String { repr: array.new_data("char_box.value: "), used: 16 }); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; char^Inspect::inspect(90, __local_32); - String::append_char(__local_31, 10); + String::push(__local_31, 10); break __tmpl: __local_31; }); unreachable; @@ -485,24 +485,24 @@ condition: char_box.value == 'Z' if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_33, String { repr: array.new_data("__test_2_explicit_type_annotations"), used: 34 }); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_33, String { repr: array.new_data("__test_2_explicit_type_annotations"), used: 34 }); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_96 = __local_34; i32::fmt_decimal(47, __local_96); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: str_box.value == \"world\" "), used: 37 }); - String::append(__local_33, String { repr: array.new_data("str_box.value: "), used: 15 }); + String::push_str(__local_33, String { repr: array.new_data("str_box.value: "), used: 15 }); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; String^Inspect::inspect(__v0, __local_34); - String::append_char(__local_33, 10); + String::push(__local_33, 10); break __tmpl: __local_33; }); unreachable; @@ -529,24 +529,24 @@ fn __test_3_multi_params() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_3_multi_params"), used: 21 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_3_multi_params"), used: 21 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_23 = __local_8; i32::fmt_decimal(53, __local_23); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: p.second == \"hello\" "), used: 32 }); - String::append(__local_7, String { repr: array.new_data("p.second: "), used: 10 }); + String::push_str(__local_7, String { repr: array.new_data("p.second: "), used: 10 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -586,25 +586,25 @@ fn __test_5_nested() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_5_nested"), used: 15 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_5_nested"), used: 15 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_9 = __local_5; i32::fmt_decimal(66, __local_9); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: outer.value.value == 42 "), used: 36 }); - String::append(__local_4, String { repr: array.new_data("outer.value.value: "), used: 19 }); + String::push_str(__local_4, String { repr: array.new_data("outer.value.value: "), used: 19 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_14 = __local_5; i32::fmt_decimal(__v0, __local_14); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -651,24 +651,24 @@ fn __test_8_with_struct_type_params() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_8_with_struct_type_params"), used: 32 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_8_with_struct_type_params"), used: 32 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_54 = __local_17; i32::fmt_decimal(100, __local_54); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: pair_box.value.second == \"one\" "), used: 43 }); - String::append(__local_16, String { repr: array.new_data("pair_box.value.second: "), used: 23 }); + String::push_str(__local_16, String { repr: array.new_data("pair_box.value.second: "), used: 23 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -722,25 +722,25 @@ fn __test_9_array_of_generic_struct() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_9_array_of_generic_struct"), used: 32 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_9_array_of_generic_struct"), used: 32 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_30 = __local_11; i32::fmt_decimal(108, __local_30); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: pairs[0].first == 1 "), used: 32 }); - String::append(__local_10, String { repr: array.new_data("pairs[0].first: "), used: 16 }); + String::push_str(__local_10, String { repr: array.new_data("pairs[0].first: "), used: 16 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_35 = __local_11; i32::fmt_decimal(__v0_2, __local_35); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -756,24 +756,24 @@ condition: pairs[0].first == 1 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_9_array_of_generic_struct"), used: 32 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_9_array_of_generic_struct"), used: 32 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_43 = __local_13; i32::fmt_decimal(109, __local_43); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: pairs[0].second == \"one\" "), used: 37 }); - String::append(__local_12, String { repr: array.new_data("pairs[0].second: "), used: 17 }); + String::push_str(__local_12, String { repr: array.new_data("pairs[0].second: "), used: 17 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_4, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -789,25 +789,25 @@ condition: pairs[0].second == \"one\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_9_array_of_generic_struct"), used: 32 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_9_array_of_generic_struct"), used: 32 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_52 = __local_15; i32::fmt_decimal(110, __local_52); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: pairs[1].first == 2 "), used: 32 }); - String::append(__local_14, String { repr: array.new_data("pairs[1].first: "), used: 16 }); + String::push_str(__local_14, String { repr: array.new_data("pairs[1].first: "), used: 16 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_57 = __local_15; i32::fmt_decimal(__v0_6, __local_57); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -823,24 +823,24 @@ condition: pairs[1].first == 2 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_9_array_of_generic_struct"), used: 32 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_9_array_of_generic_struct"), used: 32 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_65 = __local_17; i32::fmt_decimal(111, __local_65); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: pairs[1].second == \"two\" "), used: 37 }); - String::append(__local_16, String { repr: array.new_data("pairs[1].second: "), used: 17 }); + String::push_str(__local_16, String { repr: array.new_data("pairs[1].second: "), used: 17 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_8, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -896,25 +896,25 @@ fn __test_10_array_of_non_generic_struct() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_10_array_of_non_generic_struct"), used: 37 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_10_array_of_non_generic_struct"), used: 37 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_30 = __local_11; i32::fmt_decimal(116, __local_30); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: points[0].x == 1 "), used: 29 }); - String::append(__local_10, String { repr: array.new_data("points[0].x: "), used: 13 }); + String::push_str(__local_10, String { repr: array.new_data("points[0].x: "), used: 13 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_35 = __local_11; i32::fmt_decimal(__v0_2, __local_35); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -930,25 +930,25 @@ condition: points[0].x == 1 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_10_array_of_non_generic_struct"), used: 37 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_10_array_of_non_generic_struct"), used: 37 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_43 = __local_13; i32::fmt_decimal(117, __local_43); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: points[0].y == 2 "), used: 29 }); - String::append(__local_12, String { repr: array.new_data("points[0].y: "), used: 13 }); + String::push_str(__local_12, String { repr: array.new_data("points[0].y: "), used: 13 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_48 = __local_13; i32::fmt_decimal(__v0_4, __local_48); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -964,25 +964,25 @@ condition: points[0].y == 2 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_10_array_of_non_generic_struct"), used: 37 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_10_array_of_non_generic_struct"), used: 37 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_56 = __local_15; i32::fmt_decimal(118, __local_56); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: points[1].x == 3 "), used: 29 }); - String::append(__local_14, String { repr: array.new_data("points[1].x: "), used: 13 }); + String::push_str(__local_14, String { repr: array.new_data("points[1].x: "), used: 13 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_61 = __local_15; i32::fmt_decimal(__v0_6, __local_61); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -998,25 +998,25 @@ condition: points[1].x == 3 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_10_array_of_non_generic_struct"), used: 37 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_10_array_of_non_generic_struct"), used: 37 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_69 = __local_17; i32::fmt_decimal(119, __local_69); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: points[1].y == 4 "), used: 29 }); - String::append(__local_16, String { repr: array.new_data("points[1].y: "), used: 13 }); + String::push_str(__local_16, String { repr: array.new_data("points[1].y: "), used: 13 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_74 = __local_17; i32::fmt_decimal(__v0_8, __local_74); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -1043,31 +1043,31 @@ fn __test_11_array_direct() { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 42); + Array::push(arr, 42); __v0 = arr.used; __cond = __v0 == 1; if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_11_array_direct"), used: 22 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_11_array_direct"), used: 22 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_13 = __local_5; i32::fmt_decimal(125, __local_13); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: arr.len() == 1 "), used: 27 }); - String::append(__local_4, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_18 = __local_5; i32::fmt_decimal(__v0, __local_18); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1102,25 +1102,25 @@ fn __test_12_struct_import_from_collections() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_12_struct_import_from_collections"), used: 40 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_12_struct_import_from_collections"), used: 40 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/generic_struct_1.wado"), used: 50 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_15 = __local_4; i32::fmt_decimal(133, __local_15); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: map[\"hello\"] == 42 "), used: 31 }); - String::append(__local_3, String { repr: array.new_data("map[\"hello\"]: "), used: 14 }); + String::push_str(__local_3, String { repr: array.new_data("map[\"hello\"]: "), used: 14 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_20 = __local_4; i32::fmt_decimal(__v0, __local_20); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -1962,8 +1962,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2018,13 +2018,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -2032,25 +2032,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -2058,7 +2058,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -2100,8 +2100,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2133,7 +2133,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -2262,27 +2262,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2407,9 +2407,9 @@ fn f32::inspect_into(self, f) { break __inline_String__len_6: __local_23.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2419,8 +2419,8 @@ fn f32::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2475,13 +2475,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2516,9 +2516,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2526,27 +2526,27 @@ fn f64::fmt_fixed(self, precision, f) { fn char^Inspect::inspect(self, f) { let c: char; - String::append_char(f.buf, 39); + String::push(f.buf, 39); c = self; if c == 39 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 39); + String::push(f.buf, 92); + String::push(f.buf, 39); } else if c == 92 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 92); + String::push(f.buf, 92); + String::push(f.buf, 92); } else if c == 10 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 110); + String::push(f.buf, 92); + String::push(f.buf, 110); } else if c == 13 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 114); + String::push(f.buf, 92); + String::push(f.buf, 114); } else if c == 9 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 116); + String::push(f.buf, 92); + String::push(f.buf, 116); } else { - String::append_char(f.buf, c); + String::push(f.buf, c); }; - String::append_char(f.buf, 39); + String::push(f.buf, 39); } fn String::grow(self, min_capacity) { @@ -2596,7 +2596,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2727,7 +2727,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2763,7 +2763,7 @@ fn TreeMap^IndexValue::index_value(self, key) { if index < 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -2849,7 +2849,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_i32____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -2923,7 +2923,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2965,7 +2965,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3007,7 +3007,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3049,7 +3049,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3102,7 +3102,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l263; }; @@ -3260,20 +3260,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3283,10 +3283,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3296,10 +3296,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3307,10 +3307,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3322,7 +3322,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3339,22 +3339,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b298; @@ -3362,7 +3362,7 @@ fn String^Inspect::inspect(self, f) { continue l299; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_basic_usage as "__test_0_basic_usage" diff --git a/wado-compiler/tests/fixtures.golden/geometry.wir.wado b/wado-compiler/tests/fixtures.golden/geometry.wir.wado index aacfee479..1075ecafb 100644 --- a/wado-compiler/tests/fixtures.golden/geometry.wir.wado +++ b/wado-compiler/tests/fixtures.golden/geometry.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,18 +100,18 @@ fn run() with Stdout { let __local_4: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_1, 115); - String::append_char(__local_1, 117); - String::append_char(__local_1, 109); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 115); + String::push(__local_1, 117); + String::push(__local_1, 109); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(7, __local_2); break __tmpl: __local_1; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_3, String { repr: array.new_data("product: "), used: 9 }); + String::push_str(__local_3, String { repr: array.new_data("product: "), used: 9 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(12, __local_4); break __tmpl: __local_3; @@ -313,7 +313,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -328,7 +328,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -366,7 +366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -400,20 +400,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/global_1.wir.wado b/wado-compiler/tests/fixtures.golden/global_1.wir.wado index 4c0b41225..9f8ef4a85 100644 --- a/wado-compiler/tests/fixtures.golden/global_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/global_1.wir.wado @@ -105,7 +105,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -115,9 +115,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -185,33 +185,33 @@ fn test_basic() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_0, 65); - String::append_char(__local_0, 78); - String::append_char(__local_0, 83); - String::append_char(__local_0, 87); - String::append_char(__local_0, 69); - String::append_char(__local_0, 82); - String::append_char(__local_0, 61); + String::push(__local_0, 65); + String::push(__local_0, 78); + String::push(__local_0, 83); + String::push(__local_0, 87); + String::push(__local_0, 69); + String::push(__local_0, 82); + String::push(__local_0, 61); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(42, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_2, 80); - String::append_char(__local_2, 73); - String::append_char(__local_2, 61); + String::push(__local_2, 80); + String::push(__local_2, 73); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(3.14159, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_4, 70); - String::append_char(__local_4, 76); - String::append_char(__local_4, 65); - String::append_char(__local_4, 71); - String::append_char(__local_4, 61); + String::push(__local_4, 70); + String::push(__local_4, 76); + String::push(__local_4, 65); + String::push(__local_4, 71); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; Formatter::pad(__local_5, block -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -231,34 +231,34 @@ fn test_char() with Stdout { let __local_7: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_0, 76); - String::append_char(__local_0, 69); - String::append_char(__local_0, 84); - String::append_char(__local_0, 84); - String::append_char(__local_0, 69); - String::append_char(__local_0, 82); - String::append_char(__local_0, 61); + String::push(__local_0, 76); + String::push(__local_0, 69); + String::push(__local_0, 84); + String::push(__local_0, 84); + String::push(__local_0, 69); + String::push(__local_0, 82); + String::push(__local_0, 61); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; char^Display::fmt(65, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_2, String { repr: array.new_data("NEWLINE code="), used: 13 }); + String::push_str(__local_2, String { repr: array.new_data("NEWLINE code="), used: 13 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(10, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 67); - String::append_char(__local_4, 85); - String::append_char(__local_4, 82); - String::append_char(__local_4, 82); - String::append_char(__local_4, 69); - String::append_char(__local_4, 78); - String::append_char(__local_4, 84); - String::append_char(__local_4, 61); + String::push(__local_4, 67); + String::push(__local_4, 85); + String::push(__local_4, 82); + String::push(__local_4, 82); + String::push(__local_4, 69); + String::push(__local_4, 78); + String::push(__local_4, 84); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; char^Display::fmt(CURRENT, __local_5); break __tmpl: __local_4; @@ -266,7 +266,7 @@ fn test_char() with Stdout { CURRENT = 90; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_6, String { repr: array.new_data("CURRENT after="), used: 14 }); + String::push_str(__local_6, String { repr: array.new_data("CURRENT after="), used: 14 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; char^Display::fmt(CURRENT, __local_7); break __tmpl: __local_6; @@ -284,41 +284,41 @@ fn test_const_expr() with Stdout { let __local_7: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_0, 68); - String::append_char(__local_0, 79); - String::append_char(__local_0, 85); - String::append_char(__local_0, 66); - String::append_char(__local_0, 76); - String::append_char(__local_0, 69); - String::append_char(__local_0, 68); - String::append_char(__local_0, 61); + String::push(__local_0, 68); + String::push(__local_0, 79); + String::push(__local_0, 85); + String::push(__local_0, 66); + String::push(__local_0, 76); + String::push(__local_0, 69); + String::push(__local_0, 68); + String::push(__local_0, 61); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(42, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 79); - String::append_char(__local_2, 70); - String::append_char(__local_2, 70); - String::append_char(__local_2, 83); - String::append_char(__local_2, 69); - String::append_char(__local_2, 84); - String::append_char(__local_2, 61); + String::push(__local_2, 79); + String::push(__local_2, 70); + String::push(__local_2, 70); + String::push(__local_2, 83); + String::push(__local_2, 69); + String::push(__local_2, 84); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(123, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_4, String { repr: array.new_data("NEGATIVE="), used: 9 }); + String::push_str(__local_4, String { repr: array.new_data("NEGATIVE="), used: 9 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(-42, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_6, String { repr: array.new_data("NEG_DOUBLED="), used: 12 }); + String::push_str(__local_6, String { repr: array.new_data("NEG_DOUBLED="), used: 12 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(-42, __local_7); break __tmpl: __local_6; @@ -334,14 +334,14 @@ fn test_mutable() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_0, 99); - String::append_char(__local_0, 111); - String::append_char(__local_0, 117); - String::append_char(__local_0, 110); - String::append_char(__local_0, 116); - String::append_char(__local_0, 101); - String::append_char(__local_0, 114); - String::append_char(__local_0, 61); + String::push(__local_0, 99); + String::push(__local_0, 111); + String::push(__local_0, 117); + String::push(__local_0, 110); + String::push(__local_0, 116); + String::push(__local_0, 101); + String::push(__local_0, 114); + String::push(__local_0, 61); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(counter, __local_1); break __tmpl: __local_0; @@ -349,14 +349,14 @@ fn test_mutable() with Stdout { counter = counter + 1; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_2, 99); - String::append_char(__local_2, 111); - String::append_char(__local_2, 117); - String::append_char(__local_2, 110); - String::append_char(__local_2, 116); - String::append_char(__local_2, 101); - String::append_char(__local_2, 114); - String::append_char(__local_2, 61); + String::push(__local_2, 99); + String::push(__local_2, 111); + String::push(__local_2, 117); + String::push(__local_2, 110); + String::push(__local_2, 116); + String::push(__local_2, 101); + String::push(__local_2, 114); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(counter, __local_3); break __tmpl: __local_2; @@ -364,14 +364,14 @@ fn test_mutable() with Stdout { counter = counter + 10; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 99); - String::append_char(__local_4, 111); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 116); - String::append_char(__local_4, 101); - String::append_char(__local_4, 114); - String::append_char(__local_4, 61); + String::push(__local_4, 99); + String::push(__local_4, 111); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 116); + String::push(__local_4, 101); + String::push(__local_4, 114); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(counter, __local_5); break __tmpl: __local_4; @@ -387,28 +387,28 @@ fn test_negative() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_0, String { repr: array.new_data("POW10_MIN="), used: 10 }); + String::push_str(__local_0, String { repr: array.new_data("POW10_MIN="), used: 10 }); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(-348, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_2, String { repr: array.new_data("NEGATIVE_ONE="), used: 13 }); + String::push_str(__local_2, String { repr: array.new_data("NEGATIVE_ONE="), used: 13 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i64::fmt_decimal(-1_i64, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 73); - String::append_char(__local_4, 54); - String::append_char(__local_4, 52); - String::append_char(__local_4, 95); - String::append_char(__local_4, 77); - String::append_char(__local_4, 73); - String::append_char(__local_4, 78); - String::append_char(__local_4, 61); + String::push(__local_4, 73); + String::push(__local_4, 54); + String::push(__local_4, 52); + String::push(__local_4, 95); + String::push(__local_4, 77); + String::push(__local_4, 73); + String::push(__local_4, 78); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i64::fmt_decimal(-9223372036854775808_i64, __local_5); break __tmpl: __local_4; @@ -1202,8 +1202,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1258,8 +1258,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1291,7 +1291,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1420,27 +1420,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1600,9 +1600,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1656,13 +1656,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1697,9 +1697,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1710,10 +1710,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1765,7 +1765,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1780,7 +1780,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1818,7 +1818,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l158; }; @@ -1838,7 +1838,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1846,17 +1846,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2010,20 +2010,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2033,10 +2033,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2046,10 +2046,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2057,10 +2057,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/global_2.wir.wado b/wado-compiler/tests/fixtures.golden/global_2.wir.wado index d1268c935..0f12938da 100644 --- a/wado-compiler/tests/fixtures.golden/global_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/global_2.wir.wado @@ -119,7 +119,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -129,11 +129,11 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -213,68 +213,68 @@ fn test_const_promotion() with Stdout { let __local_13: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_0, 66); - String::append_char(__local_0, 65); - String::append_char(__local_0, 83); - String::append_char(__local_0, 69); - String::append_char(__local_0, 61); + String::push(__local_0, 66); + String::push(__local_0, 65); + String::push(__local_0, 83); + String::push(__local_0, 69); + String::push(__local_0, 61); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(10, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_2, 83); - String::append_char(__local_2, 84); - String::append_char(__local_2, 69); - String::append_char(__local_2, 80); - String::append_char(__local_2, 61); + String::push(__local_2, 83); + String::push(__local_2, 84); + String::push(__local_2, 69); + String::push(__local_2, 80); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(15, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 68); - String::append_char(__local_4, 79); - String::append_char(__local_4, 85); - String::append_char(__local_4, 66); - String::append_char(__local_4, 76); - String::append_char(__local_4, 69); - String::append_char(__local_4, 68); - String::append_char(__local_4, 61); + String::push(__local_4, 68); + String::push(__local_4, 79); + String::push(__local_4, 85); + String::push(__local_4, 66); + String::push(__local_4, 76); + String::push(__local_4, 69); + String::push(__local_4, 68); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(30, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_6, String { repr: array.new_data("COMBINED="), used: 9 }); + String::push_str(__local_6, String { repr: array.new_data("COMBINED="), used: 9 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(40, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_8, 80); - String::append_char(__local_8, 82); - String::append_char(__local_8, 79); - String::append_char(__local_8, 68); - String::append_char(__local_8, 85); - String::append_char(__local_8, 67); - String::append_char(__local_8, 84); - String::append_char(__local_8, 61); + String::push(__local_8, 80); + String::push(__local_8, 82); + String::push(__local_8, 79); + String::push(__local_8, 68); + String::push(__local_8, 85); + String::push(__local_8, 67); + String::push(__local_8, 84); + String::push(__local_8, 61); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(42, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_10, 76); - String::append_char(__local_10, 79); - String::append_char(__local_10, 78); - String::append_char(__local_10, 71); - String::append_char(__local_10, 61); + String::push(__local_10, 76); + String::push(__local_10, 79); + String::push(__local_10, 78); + String::push(__local_10, 71); + String::push(__local_10, 61); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i64::fmt_decimal(1234_i64, __local_11); break __tmpl: __local_10; @@ -282,14 +282,14 @@ fn test_const_promotion() with Stdout { PROMO_COUNTER = PROMO_COUNTER + 1; "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_12, 67); - String::append_char(__local_12, 79); - String::append_char(__local_12, 85); - String::append_char(__local_12, 78); - String::append_char(__local_12, 84); - String::append_char(__local_12, 69); - String::append_char(__local_12, 82); - String::append_char(__local_12, 61); + String::push(__local_12, 67); + String::push(__local_12, 79); + String::push(__local_12, 85); + String::push(__local_12, 78); + String::push(__local_12, 84); + String::push(__local_12, 69); + String::push(__local_12, 82); + String::push(__local_12, 61); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(PROMO_COUNTER, __local_13); break __tmpl: __local_12; @@ -312,27 +312,27 @@ fn test_expressions() with Stdout { let n: i32; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_2, String { repr: array.new_data("MAX_SIZE="), used: 9 }); + String::push_str(__local_2, String { repr: array.new_data("MAX_SIZE="), used: 9 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(100, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_4, String { repr: array.new_data("HALF_SIZE="), used: 10 }); + String::push_str(__local_4, String { repr: array.new_data("HALF_SIZE="), used: 10 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(50, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_6, String { repr: array.new_data("GREETING="), used: 9 }); - String::append(__local_6, GREETING); + String::push_str(__local_6, String { repr: array.new_data("GREETING="), used: 9 }); + String::push_str(__local_6, GREETING); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_7, String { repr: array.new_data("PI_APPROX="), used: 10 }); + String::push_str(__local_7, String { repr: array.new_data("PI_APPROX="), used: 10 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; f64::fmt_into(3.1415929203539825, __local_8); break __tmpl: __local_7; @@ -354,24 +354,24 @@ fn test_expressions() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 116); - String::append_char(__local_9, 111); - String::append_char(__local_9, 116); - String::append_char(__local_9, 97); - String::append_char(__local_9, 108); - String::append_char(__local_9, 61); + String::push(__local_9, 116); + String::push(__local_9, 111); + String::push(__local_9, 116); + String::push(__local_9, 97); + String::push(__local_9, 108); + String::push(__local_9, 61); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(total, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 99); - String::append_char(__local_11, 97); - String::append_char(__local_11, 108); - String::append_char(__local_11, 108); - String::append_char(__local_11, 115); - String::append_char(__local_11, 61); + String::push(__local_11, 99); + String::push(__local_11, 97); + String::push(__local_11, 108); + String::push(__local_11, 108); + String::push(__local_11, 115); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(call_count, __local_12); break __tmpl: __local_11; @@ -390,14 +390,14 @@ fn test_functions() with Stdout { let __local_7: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_0, 105); - String::append_char(__local_0, 110); - String::append_char(__local_0, 105); - String::append_char(__local_0, 116); - String::append_char(__local_0, 105); - String::append_char(__local_0, 97); - String::append_char(__local_0, 108); - String::append_char(__local_0, 61); + String::push(__local_0, 105); + String::push(__local_0, 110); + String::push(__local_0, 105); + String::push(__local_0, 116); + String::push(__local_0, 105); + String::push(__local_0, 97); + String::push(__local_0, 108); + String::push(__local_0, 61); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(shared, __local_1); break __tmpl: __local_0; @@ -405,7 +405,7 @@ fn test_functions() with Stdout { shared = shared + 1; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_2, String { repr: array.new_data("after increment="), used: 16 }); + String::push_str(__local_2, String { repr: array.new_data("after increment="), used: 16 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(shared, __local_3); break __tmpl: __local_2; @@ -413,7 +413,7 @@ fn test_functions() with Stdout { shared = shared * 2; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_4, String { repr: array.new_data("after double="), used: 13 }); + String::push_str(__local_4, String { repr: array.new_data("after double="), used: 13 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(shared, __local_5); break __tmpl: __local_4; @@ -422,7 +422,7 @@ fn test_functions() with Stdout { shared = shared + 1; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(37), used: 0 }; - String::append(__local_6, String { repr: array.new_data("after two increments="), used: 21 }); + String::push_str(__local_6, String { repr: array.new_data("after two increments="), used: 21 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(shared, __local_7); break __tmpl: __local_6; @@ -449,10 +449,10 @@ fn test_object() with Stdout { let __local_51: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_0, 108); - String::append_char(__local_0, 101); - String::append_char(__local_0, 110); - String::append_char(__local_0, 61); + String::push(__local_0, 108); + String::push(__local_0, 101); + String::push(__local_0, 110); + String::push(__local_0, 61); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(__inline_Array_i32___len_3: block -> i32 { __local_14 = ITEMS; @@ -462,12 +462,12 @@ fn test_object() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_2, 105); - String::append_char(__local_2, 116); - String::append_char(__local_2, 101); - String::append_char(__local_2, 109); - String::append_char(__local_2, 48); - String::append_char(__local_2, 61); + String::push(__local_2, 105); + String::push(__local_2, 116); + String::push(__local_2, 101); + String::push(__local_2, 109); + String::push(__local_2, 48); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_8: block -> i32 { __local_21 = ITEMS; @@ -479,10 +479,10 @@ fn test_object() with Stdout { }, __local_3); break __tmpl: __local_2; }); - Array::append(ITEMS, 4); + Array::push(ITEMS, 4); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_4, String { repr: array.new_data("after append len="), used: 17 }); + String::push_str(__local_4, String { repr: array.new_data("after append len="), used: 17 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(__inline_Array_i32___len_13: block -> i32 { __local_29 = ITEMS; @@ -495,14 +495,14 @@ fn test_object() with Stdout { "core:cli/println"(MESSAGE); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(37), used: 0 }; - String::append_char(__local_6, 120); - String::append_char(__local_6, 61); + String::push(__local_6, 120); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_35 = __local_7; i32::fmt_decimal(ORIGIN.x, __local_35); - String::append_char(__local_6, 32); - String::append_char(__local_6, 121); - String::append_char(__local_6, 61); + String::push(__local_6, 32); + String::push(__local_6, 121); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_40 = __local_7; i32::fmt_decimal(ORIGIN.y, __local_40); @@ -511,14 +511,14 @@ fn test_object() with Stdout { ORIGIN = GPoint { x: 10, y: 20 }; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(37), used: 0 }; - String::append_char(__local_8, 120); - String::append_char(__local_8, 61); + String::push(__local_8, 120); + String::push(__local_8, 61); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_46 = __local_9; i32::fmt_decimal(ORIGIN.x, __local_46); - String::append_char(__local_8, 32); - String::append_char(__local_8, 121); - String::append_char(__local_8, 61); + String::push(__local_8, 32); + String::push(__local_8, 121); + String::push(__local_8, 61); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_51 = __local_9; i32::fmt_decimal(ORIGIN.y, __local_51); @@ -539,40 +539,40 @@ fn test_topological_sort() with Stdout { let __local_9: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_0, 65); - String::append_char(__local_0, 61); + String::push(__local_0, 65); + String::push(__local_0, 61); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(5, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 66); - String::append_char(__local_2, 61); + String::push(__local_2, 66); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(15, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_4, 67); - String::append_char(__local_4, 61); + String::push(__local_4, 67); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(30, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_6, 88); - String::append_char(__local_6, 61); + String::push(__local_6, 88); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(15, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_8, 89); - String::append_char(__local_8, 61); + String::push(__local_8, 89); + String::push(__local_8, 61); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(45, __local_9); break __tmpl: __local_8; @@ -1379,8 +1379,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1435,8 +1435,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1468,7 +1468,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1597,27 +1597,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1777,9 +1777,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1833,13 +1833,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1874,9 +1874,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1929,7 +1929,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1944,7 +1944,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1971,7 +1971,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2024,7 +2024,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l164; }; @@ -2182,20 +2182,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2205,10 +2205,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2218,10 +2218,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2229,10 +2229,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/global_dce.wir.wado b/wado-compiler/tests/fixtures.golden/global_dce.wir.wado index 310d7e3a0..919d8ae7c 100644 --- a/wado-compiler/tests/fixtures.golden/global_dce.wir.wado +++ b/wado-compiler/tests/fixtures.golden/global_dce.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -112,8 +112,8 @@ fn run() with Stdout { __local_0 = String { repr: builtin::array_new(33), used: 0 }; __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(USED_MUT, __local_1); - String::append_char(__local_0, 44); - String::append(__local_0, USED_STRING); + String::push(__local_0, 44); + String::push_str(__local_0, USED_STRING); break __tmpl: __local_0; }); } @@ -313,7 +313,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -328,7 +328,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -366,7 +366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -400,20 +400,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/global_dce_cross_module.wir.wado b/wado-compiler/tests/fixtures.golden/global_dce_cross_module.wir.wado index f9fc9ec7b..4947948a8 100644 --- a/wado-compiler/tests/fixtures.golden/global_dce_cross_module.wir.wado +++ b/wado-compiler/tests/fixtures.golden/global_dce_cross_module.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,14 +102,14 @@ fn run() with Stdout { USED_COUNTER = USED_COUNTER + 1; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_0, 99); - String::append_char(__local_0, 111); - String::append_char(__local_0, 117); - String::append_char(__local_0, 110); - String::append_char(__local_0, 116); - String::append_char(__local_0, 101); - String::append_char(__local_0, 114); - String::append_char(__local_0, 61); + String::push(__local_0, 99); + String::push(__local_0, 111); + String::push(__local_0, 117); + String::push(__local_0, 110); + String::push(__local_0, 116); + String::push(__local_0, 101); + String::push(__local_0, 114); + String::push(__local_0, 61); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(USED_COUNTER, __local_1); break __tmpl: __local_0; @@ -311,7 +311,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -326,7 +326,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -364,7 +364,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -398,20 +398,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -421,10 +421,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -434,10 +434,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -445,10 +445,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/global_import.wir.wado b/wado-compiler/tests/fixtures.golden/global_import.wir.wado index 254539c99..6d6c8ad76 100644 --- a/wado-compiler/tests/fixtures.golden/global_import.wir.wado +++ b/wado-compiler/tests/fixtures.golden/global_import.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,14 +100,14 @@ fn run() with Stdout { let __local_4: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_1, String { repr: array.new_data("get_constant="), used: 13 }); + String::push_str(__local_1, String { repr: array.new_data("get_constant="), used: 13 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(42, __local_2); break __tmpl: __local_1; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_3, String { repr: array.new_data("CONSTANT="), used: 9 }); + String::push_str(__local_3, String { repr: array.new_data("CONSTANT="), used: 9 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(42, __local_4); break __tmpl: __local_3; @@ -309,7 +309,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -324,7 +324,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -362,7 +362,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -396,20 +396,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -419,10 +419,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -432,10 +432,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -443,10 +443,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/global_multimod.wir.wado b/wado-compiler/tests/fixtures.golden/global_multimod.wir.wado index 577685109..756923dcc 100644 --- a/wado-compiler/tests/fixtures.golden/global_multimod.wir.wado +++ b/wado-compiler/tests/fixtures.golden/global_multimod.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -116,21 +116,21 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_0, String { repr: array.new_data("HELPER_COUNTER="), used: 15 }); + String::push_str(__local_0, String { repr: array.new_data("HELPER_COUNTER="), used: 15 }); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(HELPER_COUNTER, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_2, String { repr: array.new_data("get_counter()="), used: 14 }); + String::push_str(__local_2, String { repr: array.new_data("get_counter()="), used: 14 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(HELPER_COUNTER, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_4, String { repr: array.new_data("MAIN_VALUE="), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("MAIN_VALUE="), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(MAIN_VALUE, __local_5); break __tmpl: __local_4; @@ -138,7 +138,7 @@ fn run() with Stdout { HELPER_COUNTER = HELPER_COUNTER + 1; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_6, String { repr: array.new_data("after increment="), used: 16 }); + String::push_str(__local_6, String { repr: array.new_data("after increment="), used: 16 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(HELPER_COUNTER, __local_7); break __tmpl: __local_6; @@ -340,7 +340,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -355,7 +355,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -393,7 +393,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -427,20 +427,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -450,10 +450,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -463,10 +463,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -474,10 +474,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-body-contains.wir.wado b/wado-compiler/tests/fixtures.golden/http-body-contains.wir.wado index f9163e560..d203d51b0 100644 --- a/wado-compiler/tests/fixtures.golden/http-body-contains.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-body-contains.wir.wado @@ -245,7 +245,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -850,7 +850,7 @@ fn "core:internal/cm_stream_write_u8"(handle, data) { // from core:internal drop("mem/realloc"(ptr, len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/http-echo-headers.wir.wado b/wado-compiler/tests/fixtures.golden/http-echo-headers.wir.wado index bc1a5c46b..149a97674 100644 --- a/wado-compiler/tests/fixtures.golden/http-echo-headers.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-echo-headers.wir.wado @@ -291,11 +291,11 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array>::append" = fn(ref Array>, ref Array); +type "functype/Array>::push" = fn(ref Array>, ref Array); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -869,7 +869,7 @@ fn __cm_binding__Fields_get(self, name) { break b45; }; __elem_addr_13 = __base_9 + (__i_12 * 1); - Array::append(__result_11, builtin::load_u8(__elem_addr_13)); + Array::push(__result_11, builtin::load_u8(__elem_addr_13)); __i_12 = __i_12 + 1; continue l46; }; @@ -877,7 +877,7 @@ fn __cm_binding__Fields_get(self, name) { if __count_10 > 0 { drop("mem/realloc"(__base_9, __count_10 * 1, 4, 0)); }; - Array>::append(__result_6, __result_11); + Array>::push(__result_6, __result_11); __i_7 = __i_7 + 1; continue l43; }; @@ -1084,7 +1084,7 @@ fn "core:internal/cm_stream_write_raw_u8"(handle, data, len) { // from core:int drop("mem/realloc"(ptr, raw_len, 1, 0)); } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1126,7 +1126,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/http-fields-copy-all.wir.wado b/wado-compiler/tests/fixtures.golden/http-fields-copy-all.wir.wado index 2f5900d15..b2a5fe0b6 100644 --- a/wado-compiler/tests/fixtures.golden/http-fields-copy-all.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-fields-copy-all.wir.wado @@ -309,15 +309,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>>::append" = fn(ref Array>>, ref "tuple/[String, Array]"); +type "functype/Array>>::push" = fn(ref Array>>, ref "tuple/[String, Array]"); type "functype/Array>>::grow" = fn(ref Array>>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -525,30 +525,30 @@ fn handle(request) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_13, 104); - String::append_char(__local_13, 97); - String::append_char(__local_13, 110); - String::append_char(__local_13, 100); - String::append_char(__local_13, 108); - String::append_char(__local_13, 101); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-copy-all.wado"), used: 54 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_13, 104); + String::push(__local_13, 97); + String::push(__local_13, 110); + String::push(__local_13, 100); + String::push(__local_13, 108); + String::push(__local_13, 101); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-copy-all.wado"), used: 54 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_182 = __local_14; i32::fmt_decimal(15, __local_182); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: all.len() == 2 "), used: 27 }); - String::append(__local_13, String { repr: array.new_data("all.len(): "), used: 11 }); + String::push_str(__local_13, String { repr: array.new_data("all.len(): "), used: 11 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_187 = __local_14; i32::fmt_decimal(__v0, __local_187); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -991,7 +991,7 @@ fn __cm_binding__Fields_copy_all(self) { break b49; }; __elem_addr_12 = __base_8 + (__i_11 * 1); - Array::append(__result_10, builtin::load_u8(__elem_addr_12)); + Array::push(__result_10, builtin::load_u8(__elem_addr_12)); __i_11 = __i_11 + 1; continue l50; }; @@ -999,7 +999,7 @@ fn __cm_binding__Fields_copy_all(self) { if __count_9 > 0 { drop("mem/realloc"(__base_8, __count_9 * 1, 4, 0)); }; - Array>>::append(__result_4, "tuple/[String, Array]" { 0: __lifted_result_7, 1: __result_10 }); + Array>>::push(__result_4, "tuple/[String, Array]" { 0: __lifted_result_7, 1: __result_10 }); drop("mem/realloc"(builtin::load_i32(__elem_addr_6 + 0), builtin::load_i32((__elem_addr_6 + 0) + 4), 1, 0)); __i_5 = __i_5 + 1; continue l47; @@ -1250,7 +1250,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1265,7 +1265,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1292,7 +1292,7 @@ fn String::append_char(self, c) { }; } -fn Array>>::append(self, value) { +fn Array>>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1334,7 +1334,7 @@ fn Array>>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1387,7 +1387,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l88; }; @@ -1421,20 +1421,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1444,10 +1444,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1457,10 +1457,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1468,10 +1468,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-fields-from-list.wir.wado b/wado-compiler/tests/fixtures.golden/http-fields-from-list.wir.wado index d2dc19f57..4faa797a6 100644 --- a/wado-compiler/tests/fixtures.golden/http-fields-from-list.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-fields-from-list.wir.wado @@ -324,15 +324,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>>::append" = fn(ref Array>>, ref "tuple/[String, Array]"); +type "functype/Array>>::push" = fn(ref Array>>, ref "tuple/[String, Array]"); type "functype/Array>>::grow" = fn(ref Array>>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -540,26 +540,26 @@ fn handle(request) { if __v0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(169), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 104); - String::append_char(__local_14, 97); - String::append_char(__local_14, 110); - String::append_char(__local_14, 100); - String::append_char(__local_14, 108); - String::append_char(__local_14, 101); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-from-list.wado"), used: 55 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 104); + String::push(__local_14, 97); + String::push(__local_14, 110); + String::push(__local_14, 100); + String::push(__local_14, 108); + String::push(__local_14, 101); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-from-list.wado"), used: 55 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_185 = __local_15; i32::fmt_decimal(15, __local_185); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: fields.has(\"x-one\" as FieldName) "), used: 45 }); - String::append(__local_14, String { repr: array.new_data("fields.has(\"x-one\" as FieldName): "), used: 34 }); + String::push_str(__local_14, String { repr: array.new_data("fields.has(\"x-one\" as FieldName): "), used: 34 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_190 = __local_15; Formatter::pad(__local_190, if __v0 -> ref String { @@ -567,7 +567,7 @@ condition: fields.has(\"x-one\" as FieldName) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -1250,7 +1250,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1265,7 +1265,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1292,7 +1292,7 @@ fn String::append_char(self, c) { }; } -fn Array>>::append(self, value) { +fn Array>>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1334,7 +1334,7 @@ fn Array>>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1387,7 +1387,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l86; }; @@ -1407,7 +1407,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1415,17 +1415,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1455,20 +1455,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1478,10 +1478,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1491,10 +1491,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1502,10 +1502,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-fields-get-and-delete.wir.wado b/wado-compiler/tests/fixtures.golden/http-fields-get-and-delete.wir.wado index 74f0433e4..03a15743a 100644 --- a/wado-compiler/tests/fixtures.golden/http-fields-get-and-delete.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-fields-get-and-delete.wir.wado @@ -323,15 +323,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref Array); +type "functype/Array>::push" = fn(ref Array>, ref Array); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -546,26 +546,26 @@ fn handle(request) { if __v0_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(171), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_17, 104); - String::append_char(__local_17, 97); - String::append_char(__local_17, 110); - String::append_char(__local_17, 100); - String::append_char(__local_17, 108); - String::append_char(__local_17, 101); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-get-and-delete.wado"), used: 60 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_17, 104); + String::push(__local_17, 97); + String::push(__local_17, 110); + String::push(__local_17, 100); + String::push(__local_17, 108); + String::push(__local_17, 101); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-get-and-delete.wado"), used: 60 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_185 = __local_18; i32::fmt_decimal(11, __local_185); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: fields.has(\"x-temp\" as FieldName) "), used: 46 }); - String::append(__local_17, String { repr: array.new_data("fields.has(\"x-temp\" as FieldName): "), used: 35 }); + String::push_str(__local_17, String { repr: array.new_data("fields.has(\"x-temp\" as FieldName): "), used: 35 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_190 = __local_18; Formatter::pad(__local_190, if __v0_4 -> ref String { @@ -573,7 +573,7 @@ condition: fields.has(\"x-temp\" as FieldName) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -586,30 +586,30 @@ condition: fields.has(\"x-temp\" as FieldName) if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 104); - String::append_char(__local_19, 97); - String::append_char(__local_19, 110); - String::append_char(__local_19, 100); - String::append_char(__local_19, 108); - String::append_char(__local_19, 101); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-get-and-delete.wado"), used: 60 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 104); + String::push(__local_19, 97); + String::push(__local_19, 110); + String::push(__local_19, 100); + String::push(__local_19, 108); + String::push(__local_19, 101); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-get-and-delete.wado"), used: 60 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_197 = __local_20; i32::fmt_decimal(16, __local_197); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: values.len() == 1 "), used: 30 }); - String::append(__local_19, String { repr: array.new_data("values.len(): "), used: 14 }); + String::push_str(__local_19, String { repr: array.new_data("values.len(): "), used: 14 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_202 = __local_20; i32::fmt_decimal(__v0_8, __local_202); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -623,26 +623,26 @@ condition: values.len() == 1 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(172), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 104); - String::append_char(__local_21, 97); - String::append_char(__local_21, 110); - String::append_char(__local_21, 100); - String::append_char(__local_21, 108); - String::append_char(__local_21, 101); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-get-and-delete.wado"), used: 60 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 104); + String::push(__local_21, 97); + String::push(__local_21, 110); + String::push(__local_21, 100); + String::push(__local_21, 108); + String::push(__local_21, 101); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-get-and-delete.wado"), used: 60 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_208 = __local_22; i32::fmt_decimal(22, __local_208); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: !fields.has(\"x-temp\" as FieldName) "), used: 47 }); - String::append(__local_21, String { repr: array.new_data("fields.has(\"x-temp\" as FieldName): "), used: 35 }); + String::push_str(__local_21, String { repr: array.new_data("fields.has(\"x-temp\" as FieldName): "), used: 35 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_213 = __local_22; Formatter::pad(__local_213, if __v0_10 -> ref String { @@ -650,7 +650,7 @@ condition: !fields.has(\"x-temp\" as FieldName) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -1104,7 +1104,7 @@ fn __cm_binding__Fields_get_and_delete(self, name) { break b55; }; __elem_addr_15 = __base_11 + (__i_14 * 1); - Array::append(__result_13, builtin::load_u8(__elem_addr_15)); + Array::push(__result_13, builtin::load_u8(__elem_addr_15)); __i_14 = __i_14 + 1; continue l56; }; @@ -1112,7 +1112,7 @@ fn __cm_binding__Fields_get_and_delete(self, name) { if __count_12 > 0 { drop("mem/realloc"(__base_11, __count_12 * 1, 4, 0)); }; - Array>::append(__result_8, __result_13); + Array>::push(__result_8, __result_13); __i_9 = __i_9 + 1; continue l53; }; @@ -1390,7 +1390,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1405,7 +1405,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1432,7 +1432,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1474,7 +1474,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1527,7 +1527,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l99; }; @@ -1547,7 +1547,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1555,17 +1555,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1595,20 +1595,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1618,10 +1618,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1631,10 +1631,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1642,10 +1642,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-fields-set.wir.wado b/wado-compiler/tests/fixtures.golden/http-fields-set.wir.wado index e4f055500..eae690354 100644 --- a/wado-compiler/tests/fixtures.golden/http-fields-set.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-fields-set.wir.wado @@ -312,15 +312,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref Array); +type "functype/Array>::push" = fn(ref Array>, ref Array); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -533,26 +533,26 @@ fn handle(request) { if __v0_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(171), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 104); - String::append_char(__local_19, 97); - String::append_char(__local_19, 110); - String::append_char(__local_19, 100); - String::append_char(__local_19, 108); - String::append_char(__local_19, 101); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-set.wado"), used: 49 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 104); + String::push(__local_19, 97); + String::push(__local_19, 110); + String::push(__local_19, 100); + String::push(__local_19, 108); + String::push(__local_19, 101); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-set.wado"), used: 49 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_189 = __local_20; i32::fmt_decimal(12, __local_189); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: fields.has(\"x-test\" as FieldName) "), used: 46 }); - String::append(__local_19, String { repr: array.new_data("fields.has(\"x-test\" as FieldName): "), used: 35 }); + String::push_str(__local_19, String { repr: array.new_data("fields.has(\"x-test\" as FieldName): "), used: 35 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_194 = __local_20; Formatter::pad(__local_194, if __v0_4 -> ref String { @@ -560,7 +560,7 @@ condition: fields.has(\"x-test\" as FieldName) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -584,30 +584,30 @@ condition: fields.has(\"x-test\" as FieldName) if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 104); - String::append_char(__local_21, 97); - String::append_char(__local_21, 110); - String::append_char(__local_21, 100); - String::append_char(__local_21, 108); - String::append_char(__local_21, 101); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-set.wado"), used: 49 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 104); + String::push(__local_21, 97); + String::push(__local_21, 110); + String::push(__local_21, 100); + String::push(__local_21, 108); + String::push(__local_21, 101); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields-set.wado"), used: 49 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_215 = __local_22; i32::fmt_decimal(24, __local_215); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: got.len() == 1 "), used: 27 }); - String::append(__local_21, String { repr: array.new_data("got.len(): "), used: 11 }); + String::push_str(__local_21, String { repr: array.new_data("got.len(): "), used: 11 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_220 = __local_22; i32::fmt_decimal(__v0_13, __local_220); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -1137,7 +1137,7 @@ fn __cm_binding__Fields_get(self, name) { break b62; }; __elem_addr_13 = __base_9 + (__i_12 * 1); - Array::append(__result_11, builtin::load_u8(__elem_addr_13)); + Array::push(__result_11, builtin::load_u8(__elem_addr_13)); __i_12 = __i_12 + 1; continue l63; }; @@ -1145,7 +1145,7 @@ fn __cm_binding__Fields_get(self, name) { if __count_10 > 0 { drop("mem/realloc"(__base_9, __count_10 * 1, 4, 0)); }; - Array>::append(__result_6, __result_11); + Array>::push(__result_6, __result_11); __i_7 = __i_7 + 1; continue l60; }; @@ -1395,7 +1395,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1410,7 +1410,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1437,7 +1437,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1479,7 +1479,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1532,7 +1532,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l101; }; @@ -1552,7 +1552,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1560,17 +1560,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1600,20 +1600,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1623,10 +1623,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1636,10 +1636,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1647,10 +1647,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-fields.wir.wado b/wado-compiler/tests/fixtures.golden/http-fields.wir.wado index 8830a8d9d..afef4441d 100644 --- a/wado-compiler/tests/fixtures.golden/http-fields.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-fields.wir.wado @@ -305,11 +305,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -533,26 +533,26 @@ fn handle(request) { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_30, 104); - String::append_char(__local_30, 97); - String::append_char(__local_30, 110); - String::append_char(__local_30, 100); - String::append_char(__local_30, 108); - String::append_char(__local_30, 101); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields.wado"), used: 45 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_30, 104); + String::push(__local_30, 97); + String::push(__local_30, 110); + String::push(__local_30, 100); + String::push(__local_30, 108); + String::push(__local_30, 101); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields.wado"), used: 45 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_198 = __local_31; i32::fmt_decimal(19, __local_198); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: !has_before "), used: 24 }); - String::append(__local_30, String { repr: array.new_data("has_before: "), used: 12 }); + String::push_str(__local_30, String { repr: array.new_data("has_before: "), used: 12 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_203 = __local_31; Formatter::pad(__local_203, if has_before -> ref String { @@ -560,7 +560,7 @@ condition: !has_before } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -579,26 +579,26 @@ condition: !has_before if has_after == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_32, 104); - String::append_char(__local_32, 97); - String::append_char(__local_32, 110); - String::append_char(__local_32, 100); - String::append_char(__local_32, 108); - String::append_char(__local_32, 101); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields.wado"), used: 45 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_32, 104); + String::push(__local_32, 97); + String::push(__local_32, 110); + String::push(__local_32, 100); + String::push(__local_32, 108); + String::push(__local_32, 101); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields.wado"), used: 45 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_222 = __local_33; i32::fmt_decimal(31, __local_222); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: has_after "), used: 22 }); - String::append(__local_32, String { repr: array.new_data("has_after: "), used: 11 }); + String::push_str(__local_32, String { repr: array.new_data("has_after: "), used: 11 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_227 = __local_33; Formatter::pad(__local_227, if has_after -> ref String { @@ -606,7 +606,7 @@ condition: has_after } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -616,26 +616,26 @@ condition: has_after if cloned_has == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_34, 104); - String::append_char(__local_34, 97); - String::append_char(__local_34, 110); - String::append_char(__local_34, 100); - String::append_char(__local_34, 108); - String::append_char(__local_34, 101); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields.wado"), used: 45 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_34, 104); + String::push(__local_34, 97); + String::push(__local_34, 110); + String::push(__local_34, 100); + String::push(__local_34, 108); + String::push(__local_34, 101); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields.wado"), used: 45 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_233 = __local_35; i32::fmt_decimal(36, __local_233); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: cloned_has "), used: 23 }); - String::append(__local_34, String { repr: array.new_data("cloned_has: "), used: 12 }); + String::push_str(__local_34, String { repr: array.new_data("cloned_has: "), used: 12 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_238 = __local_35; Formatter::pad(__local_238, if cloned_has -> ref String { @@ -643,7 +643,7 @@ condition: cloned_has } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -658,26 +658,26 @@ condition: cloned_has if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_36, 104); - String::append_char(__local_36, 97); - String::append_char(__local_36, 110); - String::append_char(__local_36, 100); - String::append_char(__local_36, 108); - String::append_char(__local_36, 101); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields.wado"), used: 45 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_36, 104); + String::push(__local_36, 97); + String::push(__local_36, 110); + String::push(__local_36, 100); + String::push(__local_36, 108); + String::push(__local_36, 101); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields.wado"), used: 45 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_244 = __local_37; i32::fmt_decimal(46, __local_244); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: !has_deleted "), used: 25 }); - String::append(__local_36, String { repr: array.new_data("has_deleted: "), used: 13 }); + String::push_str(__local_36, String { repr: array.new_data("has_deleted: "), used: 13 }); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_249 = __local_37; Formatter::pad(__local_249, if has_deleted -> ref String { @@ -685,7 +685,7 @@ condition: !has_deleted } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_36, 10); + String::push(__local_36, 10); break __tmpl: __local_36; }); unreachable; @@ -694,26 +694,26 @@ condition: !has_deleted if cloned_still_has == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_38, 104); - String::append_char(__local_38, 97); - String::append_char(__local_38, 110); - String::append_char(__local_38, 100); - String::append_char(__local_38, 108); - String::append_char(__local_38, 101); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields.wado"), used: 45 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_38, 104); + String::push(__local_38, 97); + String::push(__local_38, 110); + String::push(__local_38, 100); + String::push(__local_38, 108); + String::push(__local_38, 101); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/http-fields.wado"), used: 45 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_255 = __local_39; i32::fmt_decimal(50, __local_255); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: cloned_still_has "), used: 29 }); - String::append(__local_38, String { repr: array.new_data("cloned_still_has: "), used: 18 }); + String::push_str(__local_38, String { repr: array.new_data("cloned_still_has: "), used: 18 }); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_260 = __local_39; Formatter::pad(__local_260, if cloned_still_has -> ref String { @@ -721,7 +721,7 @@ condition: cloned_still_has } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; @@ -1419,7 +1419,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1434,7 +1434,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1461,7 +1461,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1514,7 +1514,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l93; }; @@ -1534,7 +1534,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1542,17 +1542,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1582,20 +1582,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1605,10 +1605,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1618,10 +1618,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1629,10 +1629,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-request-headers.wir.wado b/wado-compiler/tests/fixtures.golden/http-request-headers.wir.wado index 478ab63a7..25f8700b3 100644 --- a/wado-compiler/tests/fixtures.golden/http-request-headers.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-request-headers.wir.wado @@ -293,15 +293,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref Array); +type "functype/Array>::push" = fn(ref Array>, ref Array); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -502,26 +502,26 @@ fn handle(request) { if __v0_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(185), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 104); - String::append_char(__local_12, 97); - String::append_char(__local_12, 110); - String::append_char(__local_12, 100); - String::append_char(__local_12, 108); - String::append_char(__local_12, 101); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-headers.wado"), used: 54 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 104); + String::push(__local_12, 97); + String::push(__local_12, 110); + String::push(__local_12, 100); + String::push(__local_12, 108); + String::push(__local_12, 101); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-headers.wado"), used: 54 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_172 = __local_13; i32::fmt_decimal(11, __local_172); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: req_headers.has(\"x-custom\" as FieldName) "), used: 53 }); - String::append(__local_12, String { repr: array.new_data("req_headers.has(\"x-custom\" as FieldName): "), used: 42 }); + String::push_str(__local_12, String { repr: array.new_data("req_headers.has(\"x-custom\" as FieldName): "), used: 42 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_177 = __local_13; Formatter::pad(__local_177, if __v0_2 -> ref String { @@ -529,7 +529,7 @@ condition: req_headers.has(\"x-custom\" as FieldName) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -540,30 +540,30 @@ condition: req_headers.has(\"x-custom\" as FieldName) if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 104); - String::append_char(__local_14, 97); - String::append_char(__local_14, 110); - String::append_char(__local_14, 100); - String::append_char(__local_14, 108); - String::append_char(__local_14, 101); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-headers.wado"), used: 54 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 104); + String::push(__local_14, 97); + String::push(__local_14, 110); + String::push(__local_14, 100); + String::push(__local_14, 108); + String::push(__local_14, 101); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-headers.wado"), used: 54 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_184 = __local_15; i32::fmt_decimal(16, __local_184); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: values.len() == 1 "), used: 30 }); - String::append(__local_14, String { repr: array.new_data("values.len(): "), used: 14 }); + String::push_str(__local_14, String { repr: array.new_data("values.len(): "), used: 14 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_189 = __local_15; i32::fmt_decimal(__v0_5, __local_189); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -947,7 +947,7 @@ fn __cm_binding__Fields_get(self, name) { break b45; }; __elem_addr_13 = __base_9 + (__i_12 * 1); - Array::append(__result_11, builtin::load_u8(__elem_addr_13)); + Array::push(__result_11, builtin::load_u8(__elem_addr_13)); __i_12 = __i_12 + 1; continue l46; }; @@ -955,7 +955,7 @@ fn __cm_binding__Fields_get(self, name) { if __count_10 > 0 { drop("mem/realloc"(__base_9, __count_10 * 1, 4, 0)); }; - Array>::append(__result_6, __result_11); + Array>::push(__result_6, __result_11); __i_7 = __i_7 + 1; continue l43; }; @@ -1189,7 +1189,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1204,7 +1204,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1231,7 +1231,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1273,7 +1273,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1326,7 +1326,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l81; }; @@ -1346,7 +1346,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1354,17 +1354,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1394,20 +1394,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1417,10 +1417,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1430,10 +1430,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1441,10 +1441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-request-method-delete.wir.wado b/wado-compiler/tests/fixtures.golden/http-request-method-delete.wir.wado index b07539470..213ff8bad 100644 --- a/wado-compiler/tests/fixtures.golden/http-request-method-delete.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-request-method-delete.wir.wado @@ -293,9 +293,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -487,22 +487,22 @@ fn handle(request) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 104); - String::append_char(__local_8, 97); - String::append_char(__local_8, 110); - String::append_char(__local_8, 100); - String::append_char(__local_8, 108); - String::append_char(__local_8, 101); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-method-delete.wado"), used: 60 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 104); + String::push(__local_8, 97); + String::push(__local_8, 110); + String::push(__local_8, 100); + String::push(__local_8, 108); + String::push(__local_8, 101); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-method-delete.wado"), used: 60 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(8, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: method matches { Delete } "), used: 38 }); break __tmpl: __local_8; @@ -1125,7 +1125,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1140,7 +1140,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1178,7 +1178,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l76; }; @@ -1212,20 +1212,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1235,10 +1235,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1248,10 +1248,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1259,10 +1259,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-request-method-get.wir.wado b/wado-compiler/tests/fixtures.golden/http-request-method-get.wir.wado index 82b0d7dff..15698bbc1 100644 --- a/wado-compiler/tests/fixtures.golden/http-request-method-get.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-request-method-get.wir.wado @@ -293,9 +293,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -487,22 +487,22 @@ fn handle(request) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 104); - String::append_char(__local_8, 97); - String::append_char(__local_8, 110); - String::append_char(__local_8, 100); - String::append_char(__local_8, 108); - String::append_char(__local_8, 101); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-method-get.wado"), used: 57 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 104); + String::push(__local_8, 97); + String::push(__local_8, 110); + String::push(__local_8, 100); + String::push(__local_8, 108); + String::push(__local_8, 101); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-method-get.wado"), used: 57 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(8, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: method matches { Get } "), used: 35 }); break __tmpl: __local_8; @@ -1125,7 +1125,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1140,7 +1140,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1178,7 +1178,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l76; }; @@ -1212,20 +1212,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1235,10 +1235,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1248,10 +1248,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1259,10 +1259,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-request-method-patch.wir.wado b/wado-compiler/tests/fixtures.golden/http-request-method-patch.wir.wado index 60f3aff1b..a649a2a93 100644 --- a/wado-compiler/tests/fixtures.golden/http-request-method-patch.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-request-method-patch.wir.wado @@ -293,9 +293,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -487,22 +487,22 @@ fn handle(request) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 104); - String::append_char(__local_8, 97); - String::append_char(__local_8, 110); - String::append_char(__local_8, 100); - String::append_char(__local_8, 108); - String::append_char(__local_8, 101); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-method-patch.wado"), used: 59 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 104); + String::push(__local_8, 97); + String::push(__local_8, 110); + String::push(__local_8, 100); + String::push(__local_8, 108); + String::push(__local_8, 101); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-method-patch.wado"), used: 59 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(8, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: method matches { Patch } "), used: 37 }); break __tmpl: __local_8; @@ -1125,7 +1125,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1140,7 +1140,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1178,7 +1178,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l76; }; @@ -1212,20 +1212,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1235,10 +1235,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1248,10 +1248,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1259,10 +1259,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-request-method-put.wir.wado b/wado-compiler/tests/fixtures.golden/http-request-method-put.wir.wado index e2be744ba..d444cd099 100644 --- a/wado-compiler/tests/fixtures.golden/http-request-method-put.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-request-method-put.wir.wado @@ -293,9 +293,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -487,22 +487,22 @@ fn handle(request) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 104); - String::append_char(__local_8, 97); - String::append_char(__local_8, 110); - String::append_char(__local_8, 100); - String::append_char(__local_8, 108); - String::append_char(__local_8, 101); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-method-put.wado"), used: 57 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 104); + String::push(__local_8, 97); + String::push(__local_8, 110); + String::push(__local_8, 100); + String::push(__local_8, 108); + String::push(__local_8, 101); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-method-put.wado"), used: 57 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(8, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: method matches { Put } "), used: 35 }); break __tmpl: __local_8; @@ -1125,7 +1125,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1140,7 +1140,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1178,7 +1178,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l76; }; @@ -1212,20 +1212,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1235,10 +1235,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1248,10 +1248,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1259,10 +1259,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-request-method.wir.wado b/wado-compiler/tests/fixtures.golden/http-request-method.wir.wado index ee697f86d..8808810d2 100644 --- a/wado-compiler/tests/fixtures.golden/http-request-method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-request-method.wir.wado @@ -293,9 +293,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -487,22 +487,22 @@ fn handle(request) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 104); - String::append_char(__local_8, 97); - String::append_char(__local_8, 110); - String::append_char(__local_8, 100); - String::append_char(__local_8, 108); - String::append_char(__local_8, 101); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-method.wado"), used: 53 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 104); + String::push(__local_8, 97); + String::push(__local_8, 110); + String::push(__local_8, 100); + String::push(__local_8, 108); + String::push(__local_8, 101); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-method.wado"), used: 53 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(9, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: method matches { Post } "), used: 36 }); break __tmpl: __local_8; @@ -1125,7 +1125,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1140,7 +1140,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1178,7 +1178,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l76; }; @@ -1212,20 +1212,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1235,10 +1235,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1248,10 +1248,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1259,10 +1259,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-request-path.wir.wado b/wado-compiler/tests/fixtures.golden/http-request-path.wir.wado index 3ea9cd6a4..262d7a297 100644 --- a/wado-compiler/tests/fixtures.golden/http-request-path.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-request-path.wir.wado @@ -281,13 +281,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -483,31 +483,31 @@ fn handle(request) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 104); - String::append_char(__local_10, 97); - String::append_char(__local_10, 110); - String::append_char(__local_10, 100); - String::append_char(__local_10, 108); - String::append_char(__local_10, 101); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-path.wado"), used: 51 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 104); + String::push(__local_10, 97); + String::push(__local_10, 110); + String::push(__local_10, 100); + String::push(__local_10, 108); + String::push(__local_10, 101); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-path.wado"), used: 51 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_169 = __local_11; i32::fmt_decimal(10, __local_169); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: p == \"/hello\" "), used: 26 }); - String::append_char(__local_10, 112); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 112); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -1115,7 +1115,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1203,7 +1203,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1241,7 +1241,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l77; }; @@ -1275,20 +1275,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1298,10 +1298,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1311,10 +1311,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1322,10 +1322,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1337,7 +1337,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1354,22 +1354,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b96; @@ -1377,7 +1377,7 @@ fn String^Inspect::inspect(self, f) { continue l97; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__handle as "handle" diff --git a/wado-compiler/tests/fixtures.golden/http-request-scheme.wir.wado b/wado-compiler/tests/fixtures.golden/http-request-scheme.wir.wado index 9588faa8a..f5d96b968 100644 --- a/wado-compiler/tests/fixtures.golden/http-request-scheme.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-request-scheme.wir.wado @@ -286,9 +286,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -483,22 +483,22 @@ fn handle(request) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_9, 104); - String::append_char(__local_9, 97); - String::append_char(__local_9, 110); - String::append_char(__local_9, 100); - String::append_char(__local_9, 108); - String::append_char(__local_9, 101); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-scheme.wado"), used: 53 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_9, 104); + String::push(__local_9, 97); + String::push(__local_9, 110); + String::push(__local_9, 100); + String::push(__local_9, 108); + String::push(__local_9, 101); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/http-request-scheme.wado"), used: 53 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(11, __local_10); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: s matches { Http } "), used: 31 }); break __tmpl: __local_9; @@ -1115,7 +1115,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1130,7 +1130,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1168,7 +1168,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l71; }; @@ -1202,20 +1202,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1225,10 +1225,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1238,10 +1238,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1249,10 +1249,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-response-get-headers.wir.wado b/wado-compiler/tests/fixtures.golden/http-response-get-headers.wir.wado index 80d7aebba..df05f4a47 100644 --- a/wado-compiler/tests/fixtures.golden/http-response-get-headers.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-response-get-headers.wir.wado @@ -301,11 +301,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -515,26 +515,26 @@ fn handle(request) { if __v0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(185), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_11, 104); - String::append_char(__local_11, 97); - String::append_char(__local_11, 110); - String::append_char(__local_11, 100); - String::append_char(__local_11, 108); - String::append_char(__local_11, 101); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/http-response-get-headers.wado"), used: 59 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_11, 104); + String::push(__local_11, 97); + String::push(__local_11, 110); + String::push(__local_11, 100); + String::push(__local_11, 108); + String::push(__local_11, 101); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/http-response-get-headers.wado"), used: 59 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_178 = __local_12; i32::fmt_decimal(17, __local_178); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: resp_headers.has(\"x-check\" as FieldName) "), used: 53 }); - String::append(__local_11, String { repr: array.new_data("resp_headers.has(\"x-check\" as FieldName): "), used: 42 }); + String::push_str(__local_11, String { repr: array.new_data("resp_headers.has(\"x-check\" as FieldName): "), used: 42 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_183 = __local_12; Formatter::pad(__local_183, if __v0 -> ref String { @@ -542,7 +542,7 @@ condition: resp_headers.has(\"x-check\" as FieldName) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1181,7 +1181,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1196,7 +1196,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1223,7 +1223,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1276,7 +1276,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l77; }; @@ -1296,7 +1296,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1304,17 +1304,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1344,20 +1344,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1367,10 +1367,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1380,10 +1380,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1391,10 +1391,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/http-response-headers-multi.wir.wado b/wado-compiler/tests/fixtures.golden/http-response-headers-multi.wir.wado index 1e5db2cb1..2d68f6243 100644 --- a/wado-compiler/tests/fixtures.golden/http-response-headers-multi.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-response-headers-multi.wir.wado @@ -250,7 +250,7 @@ type "functype/core:internal/cm_lower_string" = fn(ref String) -> i64; type "functype/core:internal/cm_lower_list_u8" = fn(ref array, i32) -> i64; -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -897,7 +897,7 @@ fn "core:internal/cm_lower_list_u8"(data, len) { // from core:internal return builtin::i64_extend_i32_s(ptr) | (builtin::i64_extend_i32_s(len) << 32_i64); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/http-response-headers.wir.wado b/wado-compiler/tests/fixtures.golden/http-response-headers.wir.wado index 114a195b5..5105199bf 100644 --- a/wado-compiler/tests/fixtures.golden/http-response-headers.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-response-headers.wir.wado @@ -250,7 +250,7 @@ type "functype/core:internal/cm_lower_string" = fn(ref String) -> i64; type "functype/core:internal/cm_lower_list_u8" = fn(ref array, i32) -> i64; -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -890,7 +890,7 @@ fn "core:internal/cm_lower_list_u8"(data, len) { // from core:internal return builtin::i64_extend_i32_s(ptr) | (builtin::i64_extend_i32_s(len) << 32_i64); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/http-response-ops.wir.wado b/wado-compiler/tests/fixtures.golden/http-response-ops.wir.wado index d2ff11428..528cb1866 100644 --- a/wado-compiler/tests/fixtures.golden/http-response-ops.wir.wado +++ b/wado-compiler/tests/fixtures.golden/http-response-ops.wir.wado @@ -282,9 +282,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -490,32 +490,32 @@ fn handle(request) { if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_13, 104); - String::append_char(__local_13, 97); - String::append_char(__local_13, 110); - String::append_char(__local_13, 100); - String::append_char(__local_13, 108); - String::append_char(__local_13, 101); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/http-response-ops.wado"), used: 51 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_13, 104); + String::push(__local_13, 97); + String::push(__local_13, 110); + String::push(__local_13, 100); + String::push(__local_13, 108); + String::push(__local_13, 101); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/http-response-ops.wado"), used: 51 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_173 = __local_14; i32::fmt_decimal(26, __local_173); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: default_status == 200 "), used: 34 }); - String::append(__local_13, String { repr: array.new_data("default_status: "), used: 16 }); + String::push_str(__local_13, String { repr: array.new_data("default_status: "), used: 16 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_178 = __local_14; i32::fmt_decimal(default_status & 65535, __local_178); __local_184 = String { repr: array.new_data(" as StatusCode"), used: 14 }; - String::append(__local_178.buf, __local_184); - String::append_char(__local_13, 10); + String::push_str(__local_178.buf, __local_184); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -526,32 +526,32 @@ condition: default_status == 200 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_15, 104); - String::append_char(__local_15, 97); - String::append_char(__local_15, 110); - String::append_char(__local_15, 100); - String::append_char(__local_15, 108); - String::append_char(__local_15, 101); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/http-response-ops.wado"), used: 51 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_15, 104); + String::push(__local_15, 97); + String::push(__local_15, 110); + String::push(__local_15, 100); + String::push(__local_15, 108); + String::push(__local_15, 101); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/http-response-ops.wado"), used: 51 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_188 = __local_16; i32::fmt_decimal(33, __local_188); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: new_status == 404 "), used: 30 }); - String::append(__local_15, String { repr: array.new_data("new_status: "), used: 12 }); + String::push_str(__local_15, String { repr: array.new_data("new_status: "), used: 12 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_193 = __local_16; i32::fmt_decimal(new_status & 65535, __local_193); __local_199 = String { repr: array.new_data(" as StatusCode"), used: 14 }; - String::append(__local_193.buf, __local_199); - String::append_char(__local_15, 10); + String::push_str(__local_193.buf, __local_199); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -1119,7 +1119,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1134,7 +1134,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1172,7 +1172,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l65; }; @@ -1206,20 +1206,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1229,10 +1229,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1242,10 +1242,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1253,10 +1253,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/i64_arithmetic.wir.wado b/wado-compiler/tests/fixtures.golden/i64_arithmetic.wir.wado index c9b04be34..4d1eae578 100644 --- a/wado-compiler/tests/fixtures.golden/i64_arithmetic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/i64_arithmetic.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -104,47 +104,47 @@ fn run() with Stdout { let __local_13: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_6, 100); - String::append_char(__local_6, 105); - String::append_char(__local_6, 102); - String::append_char(__local_6, 102); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 100); + String::push(__local_6, 105); + String::push(__local_6, 102); + String::push(__local_6, 102); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i64::fmt_decimal(500000000000_i64, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_8, 115); - String::append_char(__local_8, 117); - String::append_char(__local_8, 109); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 115); + String::push(__local_8, 117); + String::push(__local_8, 109); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i64::fmt_decimal(1500000000000_i64, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_10, 112); - String::append_char(__local_10, 114); - String::append_char(__local_10, 111); - String::append_char(__local_10, 100); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 112); + String::push(__local_10, 114); + String::push(__local_10, 111); + String::push(__local_10, 100); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i64::fmt_decimal(1000000000000_i64, __local_11); break __tmpl: __local_10; }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_12, 113); - String::append_char(__local_12, 117); - String::append_char(__local_12, 111); - String::append_char(__local_12, 116); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 113); + String::push(__local_12, 117); + String::push(__local_12, 111); + String::push(__local_12, 116); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i64::fmt_decimal(2_i64, __local_13); break __tmpl: __local_12; @@ -365,7 +365,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -380,7 +380,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -418,7 +418,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -452,20 +452,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -475,10 +475,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -488,10 +488,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -499,10 +499,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/i64_to_string.wir.wado b/wado-compiler/tests/fixtures.golden/i64_to_string.wir.wado index eac7dbdea..e479cbc49 100644 --- a/wado-compiler/tests/fixtures.golden/i64_to_string.wir.wado +++ b/wado-compiler/tests/fixtures.golden/i64_to_string.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,30 +102,30 @@ fn run() with Stdout { let __local_8: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_3, 105); - String::append_char(__local_3, 54); - String::append_char(__local_3, 52); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 105); + String::push(__local_3, 54); + String::push(__local_3, 52); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i64::fmt_decimal(123456789012345_i64, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_5, String { repr: array.new_data("negative: "), used: 10 }); + String::push_str(__local_5, String { repr: array.new_data("negative: "), used: 10 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i64::fmt_decimal(-987654321_i64, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_7, 122); - String::append_char(__local_7, 101); - String::append_char(__local_7, 114); - String::append_char(__local_7, 111); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 122); + String::push(__local_7, 101); + String::push(__local_7, 114); + String::push(__local_7, 111); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i64::fmt_decimal(0_i64, __local_8); break __tmpl: __local_7; @@ -346,7 +346,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -361,7 +361,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -399,7 +399,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -433,20 +433,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -456,10 +456,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -469,10 +469,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -480,10 +480,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/ident_merged.wir.wado b/wado-compiler/tests/fixtures.golden/ident_merged.wir.wado index 1a8cf4e38..e7db4d359 100644 --- a/wado-compiler/tests/fixtures.golden/ident_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/ident_merged.wir.wado @@ -104,13 +104,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -182,29 +182,29 @@ fn __test_1_lowercase_type() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_1_lowercase_type"), used: 23 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_1_lowercase_type"), used: 23 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_33 = __local_18; i32::fmt_decimal(40, __local_33); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: p.x == 3 "), used: 21 }); - String::append_char(__local_17, 112); - String::append_char(__local_17, 46); - String::append_char(__local_17, 120); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 112); + String::push(__local_17, 46); + String::push(__local_17, 120); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_38 = __local_18; i32::fmt_decimal(__v0_1, __local_38); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -215,27 +215,27 @@ condition: p.x == 3 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_1_lowercase_type"), used: 23 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_1_lowercase_type"), used: 23 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_44 = __local_20; i32::fmt_decimal(42, __local_44); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: x == 3 "), used: 19 }); - String::append_char(__local_19, 120); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 120); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_49 = __local_20; i32::fmt_decimal(x, __local_49); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -244,27 +244,27 @@ condition: x == 3 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_1_lowercase_type"), used: 23 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_1_lowercase_type"), used: 23 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_55 = __local_22; i32::fmt_decimal(43, __local_55); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: y == 4 "), used: 19 }); - String::append_char(__local_21, 121); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 121); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_60 = __local_22; i32::fmt_decimal(y, __local_60); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -286,29 +286,29 @@ condition: y == 4 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("__test_1_lowercase_type"), used: 23 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("__test_1_lowercase_type"), used: 23 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_66 = __local_24; i32::fmt_decimal(51, __local_66); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: name == \"red\" "), used: 26 }); - String::append_char(__local_23, 110); - String::append_char(__local_23, 97); - String::append_char(__local_23, 109); - String::append_char(__local_23, 101); - String::append_char(__local_23, 58); - String::append_char(__local_23, 32); + String::push(__local_23, 110); + String::push(__local_23, 97); + String::push(__local_23, 109); + String::push(__local_23, 101); + String::push(__local_23, 58); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; String^Inspect::inspect(__v0_11, __local_24); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -320,27 +320,27 @@ condition: name == \"red\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("__test_1_lowercase_type"), used: 23 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("__test_1_lowercase_type"), used: 23 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_73 = __local_26; i32::fmt_decimal(55, __local_73); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: n == 10 "), used: 20 }); - String::append_char(__local_25, 110); - String::append_char(__local_25, 58); - String::append_char(__local_25, 32); + String::push(__local_25, 110); + String::push(__local_25, 58); + String::push(__local_25, 32); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_78 = __local_26; i32::fmt_decimal(n, __local_78); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -381,25 +381,25 @@ fn __test_2_case_independence() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("__test_2_case_independence"), used: 26 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("__test_2_case_independence"), used: 26 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_57 = __local_26; i32::fmt_decimal(64, __local_57); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: p.sum() == 7 "), used: 25 }); - String::append(__local_25, String { repr: array.new_data("p.sum(): "), used: 9 }); + String::push_str(__local_25, String { repr: array.new_data("p.sum(): "), used: 9 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_62 = __local_26; i32::fmt_decimal(__v0, __local_62); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -410,27 +410,27 @@ condition: p.sum() == 7 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("__test_2_case_independence"), used: 26 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("__test_2_case_independence"), used: 26 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_68 = __local_28; i32::fmt_decimal(67, __local_68); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: X == 3 "), used: 19 }); - String::append_char(__local_27, 88); - String::append_char(__local_27, 58); - String::append_char(__local_27, 32); + String::push(__local_27, 88); + String::push(__local_27, 58); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_73 = __local_28; i32::fmt_decimal(X, __local_73); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -439,27 +439,27 @@ condition: X == 3 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_29, String { repr: array.new_data("__test_2_case_independence"), used: 26 }); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_29, String { repr: array.new_data("__test_2_case_independence"), used: 26 }); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_79 = __local_30; i32::fmt_decimal(68, __local_79); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: Y == 4 "), used: 19 }); - String::append_char(__local_29, 89); - String::append_char(__local_29, 58); - String::append_char(__local_29, 32); + String::push(__local_29, 89); + String::push(__local_29, 58); + String::push(__local_29, 32); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_84 = __local_30; i32::fmt_decimal(Y, __local_84); - String::append_char(__local_29, 10); + String::push(__local_29, 10); break __tmpl: __local_29; }); unreachable; @@ -476,27 +476,27 @@ condition: Y == 4 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_33, String { repr: array.new_data("__test_2_case_independence"), used: 26 }); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_33, String { repr: array.new_data("__test_2_case_independence"), used: 26 }); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/ident_merged.wado"), used: 46 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_96 = __local_34; i32::fmt_decimal(77, __local_96); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: N == 10 "), used: 20 }); - String::append_char(__local_33, 78); - String::append_char(__local_33, 58); - String::append_char(__local_33, 32); + String::push(__local_33, 78); + String::push(__local_33, 58); + String::push(__local_33, 32); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_101 = __local_34; i32::fmt_decimal(N, __local_101); - String::append_char(__local_33, 10); + String::push(__local_33, 10); break __tmpl: __local_33; }); unreachable; @@ -751,7 +751,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -839,7 +839,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -877,7 +877,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l53; }; @@ -911,20 +911,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -934,10 +934,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -947,10 +947,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -958,10 +958,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -973,7 +973,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -990,22 +990,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b72; @@ -1013,7 +1013,7 @@ fn String^Inspect::inspect(self, f) { continue l73; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_uppercase_local as "__test_0_uppercase_local" diff --git a/wado-compiler/tests/fixtures.golden/if_merged.wir.wado b/wado-compiler/tests/fixtures.golden/if_merged.wir.wado index 96312e288..85163b7bd 100644 --- a/wado-compiler/tests/fixtures.golden/if_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/if_merged.wir.wado @@ -110,9 +110,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -337,23 +337,23 @@ fn test_if_let() with Stdout { let __local_11: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_4, 120); - String::append_char(__local_4, 32); - String::append_char(__local_4, 61); - String::append_char(__local_4, 32); + String::push(__local_4, 120); + String::push(__local_4, 32); + String::push(__local_4, 61); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(10, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_6, 115); - String::append_char(__local_6, 109); - String::append_char(__local_6, 97); - String::append_char(__local_6, 108); - String::append_char(__local_6, 108); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 115); + String::push(__local_6, 109); + String::push(__local_6, 97); + String::push(__local_6, 108); + String::push(__local_6, 108); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(3, __local_7); break __tmpl: __local_6; @@ -409,23 +409,23 @@ fn test_if_let_chain() with Stdout { let __local_94: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_26, 120); - String::append_char(__local_26, 32); - String::append_char(__local_26, 61); - String::append_char(__local_26, 32); + String::push(__local_26, 120); + String::push(__local_26, 32); + String::push(__local_26, 61); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; i32::fmt_decimal(10, __local_27); break __tmpl: __local_26; }); "core:cli/println"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_28, 115); - String::append_char(__local_28, 109); - String::append_char(__local_28, 97); - String::append_char(__local_28, 108); - String::append_char(__local_28, 108); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 115); + String::push(__local_28, 109); + String::push(__local_28, 97); + String::push(__local_28, 108); + String::push(__local_28, 108); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; i32::fmt_decimal(3, __local_29); break __tmpl: __local_28; @@ -442,11 +442,11 @@ fn test_if_let_chain() with Stdout { if x_5 > 10 { "core:cli/println"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_34, 98); - String::append_char(__local_34, 105); - String::append_char(__local_34, 103); - String::append_char(__local_34, 58); - String::append_char(__local_34, 32); + String::push(__local_34, 98); + String::push(__local_34, 105); + String::push(__local_34, 103); + String::push(__local_34, 58); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; i32::fmt_decimal(x_5, __local_35); break __tmpl: __local_34; @@ -464,7 +464,7 @@ fn test_if_let_chain() with Stdout { __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_89 = __local_37; i32::fmt_decimal(x_8, __local_89); - String::append_char(__local_36, 32); + String::push(__local_36, 32); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_94 = __local_37; i32::fmt_decimal(y_9, __local_94); @@ -479,14 +479,14 @@ fn test_if_let_chain() with Stdout { if (x_10 + y_11) > 25 { "core:cli/println"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_38, 115); - String::append_char(__local_38, 117); - String::append_char(__local_38, 109); - String::append_char(__local_38, 32); - String::append_char(__local_38, 111); - String::append_char(__local_38, 107); - String::append_char(__local_38, 58); - String::append_char(__local_38, 32); + String::push(__local_38, 115); + String::push(__local_38, 117); + String::push(__local_38, 109); + String::push(__local_38, 32); + String::push(__local_38, 111); + String::push(__local_38, 107); + String::push(__local_38, 58); + String::push(__local_38, 32); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; i32::fmt_decimal(x_10 + y_11, __local_39); break __tmpl: __local_38; @@ -499,7 +499,7 @@ fn test_if_let_chain() with Stdout { x_14 = ref.cast Option::Some(opt2).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_40, String { repr: array.new_data("flag and x="), used: 11 }); + String::push_str(__local_40, String { repr: array.new_data("flag and x="), used: 11 }); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; i32::fmt_decimal(x_14, __local_41); break __tmpl: __local_40; @@ -512,14 +512,14 @@ fn test_if_let_chain() with Stdout { n = ref.cast Option::Some(inner).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_42, 110); - String::append_char(__local_42, 101); - String::append_char(__local_42, 115); - String::append_char(__local_42, 116); - String::append_char(__local_42, 101); - String::append_char(__local_42, 100); - String::append_char(__local_42, 58); - String::append_char(__local_42, 32); + String::push(__local_42, 110); + String::push(__local_42, 101); + String::push(__local_42, 115); + String::push(__local_42, 116); + String::push(__local_42, 101); + String::push(__local_42, 100); + String::push(__local_42, 58); + String::push(__local_42, 32); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; i32::fmt_decimal(n, __local_43); break __tmpl: __local_42; @@ -533,7 +533,7 @@ fn test_if_let_chain() with Stdout { n2 = ref.cast Option::Some(inner2).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_44, String { repr: array.new_data("should not print: "), used: 18 }); + String::push_str(__local_44, String { repr: array.new_data("should not print: "), used: 18 }); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; i32::fmt_decimal(n2, __local_45); break __tmpl: __local_44; @@ -549,7 +549,7 @@ fn test_if_let_chain() with Stdout { x_24 = ref.cast Option::Some(opt3).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_46 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_46, String { repr: array.new_data("paren: x="), used: 9 }); + String::push_str(__local_46, String { repr: array.new_data("paren: x="), used: 9 }); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; i32::fmt_decimal(x_24, __local_47); break __tmpl: __local_46; @@ -944,7 +944,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -959,7 +959,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -997,7 +997,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l61; }; @@ -1031,20 +1031,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1054,10 +1054,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1067,10 +1067,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1078,10 +1078,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/import_from_nested_subdir.wir.wado b/wado-compiler/tests/fixtures.golden/import_from_nested_subdir.wir.wado index 40cc050d6..315b95f95 100644 --- a/wado-compiler/tests/fixtures.golden/import_from_nested_subdir.wir.wado +++ b/wado-compiler/tests/fixtures.golden/import_from_nested_subdir.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -98,7 +98,7 @@ fn run() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_1, String { repr: array.new_data("tripled: "), used: 9 }); + String::push_str(__local_1, String { repr: array.new_data("tripled: "), used: 9 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(42, __local_2); break __tmpl: __local_1; @@ -300,7 +300,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -315,7 +315,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -353,7 +353,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -387,20 +387,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -410,10 +410,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -434,10 +434,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/import_from_subdir.wir.wado b/wado-compiler/tests/fixtures.golden/import_from_subdir.wir.wado index 5337e3b24..b97c7862c 100644 --- a/wado-compiler/tests/fixtures.golden/import_from_subdir.wir.wado +++ b/wado-compiler/tests/fixtures.golden/import_from_subdir.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,17 +100,17 @@ fn run() with Stdout { let __local_14: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(50), used: 0 }; - String::append_char(__local_2, 109); - String::append_char(__local_2, 97); - String::append_char(__local_2, 103); - String::append_char(__local_2, 105); - String::append_char(__local_2, 99); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 109); + String::push(__local_2, 97); + String::push(__local_2, 103); + String::push(__local_2, 105); + String::push(__local_2, 99); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_9 = __local_3; i32::fmt_decimal(42, __local_9); - String::append(__local_2, String { repr: array.new_data(", doubled: "), used: 11 }); + String::push_str(__local_2, String { repr: array.new_data(", doubled: "), used: 11 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_14 = __local_3; i32::fmt_decimal(84, __local_14); @@ -313,7 +313,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -328,7 +328,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -366,7 +366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -400,20 +400,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/import_transitive_simple.wir.wado b/wado-compiler/tests/fixtures.golden/import_transitive_simple.wir.wado index 267103859..a28e1ffdc 100644 --- a/wado-compiler/tests/fixtures.golden/import_transitive_simple.wir.wado +++ b/wado-compiler/tests/fixtures.golden/import_transitive_simple.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -98,14 +98,14 @@ fn run() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_1, 114); - String::append_char(__local_1, 101); - String::append_char(__local_1, 115); - String::append_char(__local_1, 117); - String::append_char(__local_1, 108); - String::append_char(__local_1, 116); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 114); + String::push(__local_1, 101); + String::push(__local_1, 115); + String::push(__local_1, 117); + String::push(__local_1, 108); + String::push(__local_1, 116); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(42, __local_2); break __tmpl: __local_1; @@ -307,7 +307,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -322,7 +322,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -360,7 +360,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -394,20 +394,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -417,10 +417,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -430,10 +430,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -441,10 +441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/import_with_dot_segments.wir.wado b/wado-compiler/tests/fixtures.golden/import_with_dot_segments.wir.wado index f57a79b1d..4e0674916 100644 --- a/wado-compiler/tests/fixtures.golden/import_with_dot_segments.wir.wado +++ b/wado-compiler/tests/fixtures.golden/import_with_dot_segments.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,17 +100,17 @@ fn run() with Stdout { let __local_14: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(50), used: 0 }; - String::append_char(__local_2, 109); - String::append_char(__local_2, 97); - String::append_char(__local_2, 103); - String::append_char(__local_2, 105); - String::append_char(__local_2, 99); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 109); + String::push(__local_2, 97); + String::push(__local_2, 103); + String::push(__local_2, 105); + String::push(__local_2, 99); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_9 = __local_3; i32::fmt_decimal(42, __local_9); - String::append(__local_2, String { repr: array.new_data(", doubled: "), used: 11 }); + String::push_str(__local_2, String { repr: array.new_data(", doubled: "), used: 11 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_14 = __local_3; i32::fmt_decimal(84, __local_14); @@ -313,7 +313,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -328,7 +328,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -366,7 +366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -400,20 +400,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/include_bytes_basic.wir.wado b/wado-compiler/tests/fixtures.golden/include_bytes_basic.wir.wado index 3bd49238d..9d3f2bf00 100644 --- a/wado-compiler/tests/fixtures.golden/include_bytes_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/include_bytes_basic.wir.wado @@ -77,9 +77,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -151,27 +151,27 @@ fn run() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_13, 114); - String::append_char(__local_13, 117); - String::append_char(__local_13, 110); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_13, 114); + String::push(__local_13, 117); + String::push(__local_13, 110); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_30 = __local_14; i32::fmt_decimal(5, __local_30); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: data.len() == 5 "), used: 28 }); - String::append(__local_13, String { repr: array.new_data("data.len(): "), used: 12 }); + String::push_str(__local_13, String { repr: array.new_data("data.len(): "), used: 12 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_35 = __local_14; i32::fmt_decimal(__v0_1, __local_35); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -187,27 +187,27 @@ condition: data.len() == 5 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_15, 114); - String::append_char(__local_15, 117); - String::append_char(__local_15, 110); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_15, 114); + String::push(__local_15, 117); + String::push(__local_15, 110); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_43 = __local_16; i32::fmt_decimal(6, __local_43); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: data[0] == 72 "), used: 26 }); - String::append(__local_15, String { repr: array.new_data("data[0]: "), used: 9 }); + String::push_str(__local_15, String { repr: array.new_data("data[0]: "), used: 9 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_48 = __local_16; i32::fmt_decimal(__v0_3, __local_48); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -223,27 +223,27 @@ condition: data[0] == 72 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_17, 114); - String::append_char(__local_17, 117); - String::append_char(__local_17, 110); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_17, 114); + String::push(__local_17, 117); + String::push(__local_17, 110); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_56 = __local_18; i32::fmt_decimal(7, __local_56); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: data[1] == 101 "), used: 27 }); - String::append(__local_17, String { repr: array.new_data("data[1]: "), used: 9 }); + String::push_str(__local_17, String { repr: array.new_data("data[1]: "), used: 9 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_61 = __local_18; i32::fmt_decimal(__v0_5, __local_61); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -259,27 +259,27 @@ condition: data[1] == 101 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 114); - String::append_char(__local_19, 117); - String::append_char(__local_19, 110); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 114); + String::push(__local_19, 117); + String::push(__local_19, 110); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_69 = __local_20; i32::fmt_decimal(8, __local_69); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: data[2] == 108 "), used: 27 }); - String::append(__local_19, String { repr: array.new_data("data[2]: "), used: 9 }); + String::push_str(__local_19, String { repr: array.new_data("data[2]: "), used: 9 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_74 = __local_20; i32::fmt_decimal(__v0_7, __local_74); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -295,27 +295,27 @@ condition: data[2] == 108 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 114); - String::append_char(__local_21, 117); - String::append_char(__local_21, 110); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 114); + String::push(__local_21, 117); + String::push(__local_21, 110); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_82 = __local_22; i32::fmt_decimal(9, __local_82); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: data[3] == 108 "), used: 27 }); - String::append(__local_21, String { repr: array.new_data("data[3]: "), used: 9 }); + String::push_str(__local_21, String { repr: array.new_data("data[3]: "), used: 9 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_87 = __local_22; i32::fmt_decimal(__v0_9, __local_87); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -331,27 +331,27 @@ condition: data[3] == 108 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_23, 114); - String::append_char(__local_23, 117); - String::append_char(__local_23, 110); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_23, 114); + String::push(__local_23, 117); + String::push(__local_23, 110); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/include_bytes_basic.wado"), used: 53 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_95 = __local_24; i32::fmt_decimal(10, __local_95); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: data[4] == 111 "), used: 27 }); - String::append(__local_23, String { repr: array.new_data("data[4]: "), used: 9 }); + String::push_str(__local_23, String { repr: array.new_data("data[4]: "), used: 9 }); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_100 = __local_24; i32::fmt_decimal(__v0_11, __local_100); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -591,7 +591,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -606,7 +606,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -644,7 +644,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -678,20 +678,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -701,10 +701,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -714,10 +714,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -725,10 +725,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/include_str_basic.wir.wado b/wado-compiler/tests/fixtures.golden/include_str_basic.wir.wado index 0e02b9bbe..5e14f1c7a 100644 --- a/wado-compiler/tests/fixtures.golden/include_str_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/include_str_basic.wir.wado @@ -78,13 +78,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -131,26 +131,26 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/include_str_basic.wado"), used: 51 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_3, 114); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/include_str_basic.wado"), used: 51 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(5, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: content == \"Hello, World!\\n\" "), used: 41 }); - String::append(__local_3, String { repr: array.new_data("content: "), used: 9 }); + String::push_str(__local_3, String { repr: array.new_data("content: "), used: 9 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -390,7 +390,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -478,7 +478,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -516,7 +516,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -550,20 +550,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -573,10 +573,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -586,10 +586,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -597,10 +597,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -612,7 +612,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -629,22 +629,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b53; @@ -652,7 +652,7 @@ fn String^Inspect::inspect(self, f) { continue l54; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/index_assign.wir.wado b/wado-compiler/tests/fixtures.golden/index_assign.wir.wado index 3daba6ac3..597720c20 100644 --- a/wado-compiler/tests/fixtures.golden/index_assign.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_assign.wir.wado @@ -141,7 +141,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -151,23 +151,23 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, f64); +type "functype/Array::push" = fn(ref Array, f64); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i64); +type "functype/Array::push" = fn(ref Array, i64); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -280,7 +280,7 @@ fn index_assign_basic() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_12: builtin::array_get(arr.repr, 0); }, __local_25); - String::append_char(__local_2, 32); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_32 = __local_3; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_16: block -> i32 { @@ -290,7 +290,7 @@ fn index_assign_basic() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_16: builtin::array_get(arr.repr, 1); }, __local_32); - String::append_char(__local_2, 32); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_39 = __local_3; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_20: block -> i32 { @@ -376,7 +376,7 @@ fn index_assign_expression_value() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_22: builtin::array_get(arr.repr, 0); }, __local_44); - String::append_char(__local_4, 32); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_51 = __local_5; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_26: block -> i32 { @@ -386,7 +386,7 @@ fn index_assign_expression_value() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_26: builtin::array_get(arr.repr, 1); }, __local_51); - String::append_char(__local_4, 32); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_58 = __local_5; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_30: block -> i32 { @@ -396,7 +396,7 @@ fn index_assign_expression_value() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_30: builtin::array_get(arr.repr, 2); }, __local_58); - String::append_char(__local_4, 32); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_65 = __local_5; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_34: block -> i32 { @@ -448,7 +448,7 @@ fn index_assign_in_conditional() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_14: builtin::array_get(arr.repr, 0); }, __local_32); - String::append_char(__local_3, 32); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_39 = __local_4; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_18: block -> i32 { @@ -458,7 +458,7 @@ fn index_assign_in_conditional() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_18: builtin::array_get(arr.repr, 1); }, __local_39); - String::append_char(__local_3, 32); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_46 = __local_4; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_22: block -> i32 { @@ -515,7 +515,7 @@ fn index_assign_in_function() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_13: builtin::array_get(arr.repr, 0); }, __local_29); - String::append_char(__local_3, 32); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_36 = __local_4; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_17: block -> i32 { @@ -525,7 +525,7 @@ fn index_assign_in_function() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_17: builtin::array_get(arr.repr, 1); }, __local_36); - String::append_char(__local_3, 32); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_43 = __local_4; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_21: block -> i32 { @@ -549,7 +549,7 @@ fn index_assign_in_function() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_26: builtin::array_get(result.repr, 0); }, __local_51); - String::append_char(__local_5, 32); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_58 = __local_6; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_30: block -> i32 { @@ -629,11 +629,11 @@ fn index_assign_in_loop() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(89), used: 0 }; - String::append_char(__local_9, 102); - String::append_char(__local_9, 111); - String::append_char(__local_9, 114); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 102); + String::push(__local_9, 111); + String::push(__local_9, 114); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_34 = __local_10; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_12: block -> i32 { @@ -643,7 +643,7 @@ fn index_assign_in_loop() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_12: builtin::array_get(arr.repr, 0); }, __local_34); - String::append_char(__local_9, 32); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_41 = __local_10; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_16: block -> i32 { @@ -653,7 +653,7 @@ fn index_assign_in_loop() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_16: builtin::array_get(arr.repr, 1); }, __local_41); - String::append_char(__local_9, 32); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_48 = __local_10; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_20: block -> i32 { @@ -663,7 +663,7 @@ fn index_assign_in_loop() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_20: builtin::array_get(arr.repr, 2); }, __local_48); - String::append_char(__local_9, 32); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_55 = __local_10; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_24: block -> i32 { @@ -673,7 +673,7 @@ fn index_assign_in_loop() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_24: builtin::array_get(arr.repr, 3); }, __local_55); - String::append_char(__local_9, 32); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_62 = __local_10; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_28: block -> i32 { @@ -710,13 +710,13 @@ fn index_assign_in_loop() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(57), used: 0 }; - String::append_char(__local_11, 119); - String::append_char(__local_11, 104); - String::append_char(__local_11, 105); - String::append_char(__local_11, 108); - String::append_char(__local_11, 101); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 119); + String::push(__local_11, 104); + String::push(__local_11, 105); + String::push(__local_11, 108); + String::push(__local_11, 101); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_82 = __local_12; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_40: block -> i32 { @@ -726,7 +726,7 @@ fn index_assign_in_loop() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_40: builtin::array_get(arr2.repr, 0); }, __local_82); - String::append_char(__local_11, 32); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_89 = __local_12; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_44: block -> i32 { @@ -736,7 +736,7 @@ fn index_assign_in_loop() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_44: builtin::array_get(arr2.repr, 1); }, __local_89); - String::append_char(__local_11, 32); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_96 = __local_12; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_48: block -> i32 { @@ -773,12 +773,12 @@ fn index_assign_in_loop() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(56), used: 0 }; - String::append_char(__local_13, 108); - String::append_char(__local_13, 111); - String::append_char(__local_13, 111); - String::append_char(__local_13, 112); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 108); + String::push(__local_13, 111); + String::push(__local_13, 111); + String::push(__local_13, 112); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_116 = __local_14; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_60: block -> i32 { @@ -788,7 +788,7 @@ fn index_assign_in_loop() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_60: builtin::array_get(arr3.repr, 0); }, __local_116); - String::append_char(__local_13, 32); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_123 = __local_14; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_64: block -> i32 { @@ -798,7 +798,7 @@ fn index_assign_in_loop() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_64: builtin::array_get(arr3.repr, 1); }, __local_123); - String::append_char(__local_13, 32); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_130 = __local_14; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_68: block -> i32 { @@ -907,9 +907,9 @@ fn index_assign_multiple() with Stdout { builtin::array_set(d.repr, 1, 2.5); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(53), used: 0 }; - String::append_char(__local_8, 97); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_81 = __local_9; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_35: block -> i32 { @@ -919,7 +919,7 @@ fn index_assign_multiple() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_35: builtin::array_get(a.repr, 0); }, __local_81); - String::append_char(__local_8, 32); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_88 = __local_9; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_39: block -> i32 { @@ -929,7 +929,7 @@ fn index_assign_multiple() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_39: builtin::array_get(a.repr, 1); }, __local_88); - String::append_char(__local_8, 32); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_95 = __local_9; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_43: block -> i32 { @@ -943,9 +943,9 @@ fn index_assign_multiple() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(53), used: 0 }; - String::append_char(__local_10, 98); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 98); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_103 = __local_11; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_48: block -> i32 { @@ -955,7 +955,7 @@ fn index_assign_multiple() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_48: builtin::array_get(b.repr, 0); }, __local_103); - String::append_char(__local_10, 32); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_110 = __local_11; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_52: block -> i32 { @@ -965,7 +965,7 @@ fn index_assign_multiple() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_52: builtin::array_get(b.repr, 1); }, __local_110); - String::append_char(__local_10, 32); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_117 = __local_11; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_56: block -> i32 { @@ -979,9 +979,9 @@ fn index_assign_multiple() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(36), used: 0 }; - String::append_char(__local_12, 99); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 99); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_125 = __local_13; i64::fmt_decimal(__inline_Array_i64__IndexValue__index_value_61: block -> i64 { @@ -991,7 +991,7 @@ fn index_assign_multiple() with Stdout { }; break __inline_Array_i64__IndexValue__index_value_61: builtin::array_get(c.repr, 0); }, __local_125); - String::append_char(__local_12, 32); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_132 = __local_13; i64::fmt_decimal(__inline_Array_i64__IndexValue__index_value_65: block -> i64 { @@ -1005,9 +1005,9 @@ fn index_assign_multiple() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(36), used: 0 }; - String::append_char(__local_14, 100); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 100); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_140 = __local_15; f64::fmt_into(__inline_Array_f64__IndexValue__index_value_70: block -> f64 { @@ -1017,7 +1017,7 @@ fn index_assign_multiple() with Stdout { }; break __inline_Array_f64__IndexValue__index_value_70: builtin::array_get(d.repr, 0); }, __local_140); - String::append_char(__local_14, 32); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_145 = __local_15; f64::fmt_into(__inline_Array_f64__IndexValue__index_value_73: block -> f64 { @@ -1111,7 +1111,7 @@ fn index_assign_nested() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_21: builtin::array_get(values.repr, 0); }, __local_48); - String::append_char(__local_8, 32); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_55 = __local_9; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_25: block -> i32 { @@ -1121,7 +1121,7 @@ fn index_assign_nested() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_25: builtin::array_get(values.repr, 1); }, __local_55); - String::append_char(__local_8, 32); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_62 = __local_9; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_29: block -> i32 { @@ -1188,7 +1188,7 @@ fn index_assign_nested() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_52: builtin::array_get(dest.repr, 0); }, __local_103); - String::append_char(__local_10, 32); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_110 = __local_11; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_56: block -> i32 { @@ -1198,7 +1198,7 @@ fn index_assign_nested() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_56: builtin::array_get(dest.repr, 1); }, __local_110); - String::append_char(__local_10, 32); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_117 = __local_11; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_60: block -> i32 { @@ -1241,23 +1241,23 @@ fn index_assign_ref_array() with Stdout { builtin::array_set(strings.repr, 1, value_20); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(50), used: 0 }; - String::append(__local_4, __inline_Array_String__IndexValue__index_value_9: block -> ref String { + String::push_str(__local_4, __inline_Array_String__IndexValue__index_value_9: block -> ref String { if 0 >= strings.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; }; break __inline_Array_String__IndexValue__index_value_9: builtin::array_get(strings.repr, 0); }); - String::append_char(__local_4, 32); - String::append(__local_4, __inline_Array_String__IndexValue__index_value_10: block -> ref String { + String::push(__local_4, 32); + String::push_str(__local_4, __inline_Array_String__IndexValue__index_value_10: block -> ref String { if 1 >= strings.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; }; break __inline_Array_String__IndexValue__index_value_10: builtin::array_get(strings.repr, 1); }); - String::append_char(__local_4, 32); - String::append(__local_4, __inline_Array_String__IndexValue__index_value_11: block -> ref String { + String::push(__local_4, 32); + String::push_str(__local_4, __inline_Array_String__IndexValue__index_value_11: block -> ref String { if 2 >= strings.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; @@ -1284,15 +1284,15 @@ fn index_assign_ref_array() with Stdout { builtin::array_set(messages.repr, 1, value_40); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_5, __inline_Array_String__IndexValue__index_value_20: block -> ref String { + String::push_str(__local_5, __inline_Array_String__IndexValue__index_value_20: block -> ref String { if 0 >= messages.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; }; break __inline_Array_String__IndexValue__index_value_20: builtin::array_get(messages.repr, 0); }); - String::append_char(__local_5, 32); - String::append(__local_5, __inline_Array_String__IndexValue__index_value_21: block -> ref String { + String::push(__local_5, 32); + String::push_str(__local_5, __inline_Array_String__IndexValue__index_value_21: block -> ref String { if 1 >= messages.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; @@ -2096,8 +2096,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2152,8 +2152,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2185,7 +2185,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -2314,27 +2314,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2494,9 +2494,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -2550,13 +2550,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2591,9 +2591,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2646,7 +2646,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2661,7 +2661,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2688,7 +2688,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2730,7 +2730,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2772,7 +2772,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2814,7 +2814,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2867,7 +2867,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l275; }; @@ -3025,20 +3025,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3048,10 +3048,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3061,10 +3061,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3072,10 +3072,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_assign_types.wir.wado b/wado-compiler/tests/fixtures.golden/index_assign_types.wir.wado index 019eb6790..d7decd168 100644 --- a/wado-compiler/tests/fixtures.golden/index_assign_types.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_assign_types.wir.wado @@ -130,7 +130,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -140,27 +140,27 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, bool); +type "functype/Array::push" = fn(ref Array, bool); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, f64); +type "functype/Array::push" = fn(ref Array, f64); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, f32); +type "functype/Array::push" = fn(ref Array, f32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i64); +type "functype/Array::push" = fn(ref Array, i64); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -263,11 +263,11 @@ fn run() with Stdout { builtin::array_set(arr_i32.repr, 0, 42); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_10, 105); - String::append_char(__local_10, 51); - String::append_char(__local_10, 50); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 105); + String::push(__local_10, 51); + String::push(__local_10, 50); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_9: block -> i32 { if 0 >= arr_i32.used { @@ -289,11 +289,11 @@ fn run() with Stdout { builtin::array_set(arr_i64.repr, 0, 9999999999_i64); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_12, 105); - String::append_char(__local_12, 54); - String::append_char(__local_12, 52); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 105); + String::push(__local_12, 54); + String::push(__local_12, 52); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i64::fmt_decimal(__inline_Array_i64__IndexValue__index_value_19: block -> i64 { if 0 >= arr_i64.used { @@ -316,11 +316,11 @@ fn run() with Stdout { builtin::array_set(arr_f32.repr, 0, value); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_14, 102); - String::append_char(__local_14, 51); - String::append_char(__local_14, 50); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 102); + String::push(__local_14, 51); + String::push(__local_14, 50); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; f32::fmt_into(__inline_Array_f32__IndexValue__index_value_29: block -> f32 { if 0 >= arr_f32.used { @@ -342,11 +342,11 @@ fn run() with Stdout { builtin::array_set(arr_f64.repr, 0, 2.718281828); "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_16, 102); - String::append_char(__local_16, 54); - String::append_char(__local_16, 52); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 102); + String::push(__local_16, 54); + String::push(__local_16, 52); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; f64::fmt_into(__inline_Array_f64__IndexValue__index_value_38: block -> f64 { if 0 >= arr_f64.used { @@ -368,12 +368,12 @@ fn run() with Stdout { builtin::array_set(arr_bool.repr, 0, 1); "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_18, 98); - String::append_char(__local_18, 111); - String::append_char(__local_18, 111); - String::append_char(__local_18, 108); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 98); + String::push(__local_18, 111); + String::push(__local_18, 111); + String::push(__local_18, 108); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; Formatter::pad(__local_19, if __inline_Array_bool__IndexValue__index_value_47: block -> bool { if 0 >= arr_bool.used { @@ -1280,8 +1280,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1336,8 +1336,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1369,7 +1369,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1498,27 +1498,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1680,9 +1680,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1747,9 +1747,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1803,13 +1803,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1844,9 +1844,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1899,7 +1899,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1914,7 +1914,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1941,7 +1941,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1983,7 +1983,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2025,7 +2025,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2067,7 +2067,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2109,7 +2109,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2162,7 +2162,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l199; }; @@ -2182,7 +2182,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2190,17 +2190,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2354,20 +2354,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2377,10 +2377,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2390,10 +2390,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2401,10 +2401,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_mut_method_call.wir.wado b/wado-compiler/tests/fixtures.golden/index_mut_method_call.wir.wado index a3147547a..4f828466d 100644 --- a/wado-compiler/tests/fixtures.golden/index_mut_method_call.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_mut_method_call.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -98,7 +98,7 @@ fn run() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_1, String { repr: array.new_data("Counter value: "), used: 15 }); + String::push_str(__local_1, String { repr: array.new_data("Counter value: "), used: 15 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(3, __local_2); break __tmpl: __local_1; @@ -300,7 +300,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -315,7 +315,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -353,7 +353,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -387,20 +387,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -410,10 +410,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -434,10 +434,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_trait_assign.wir.wado b/wado-compiler/tests/fixtures.golden/index_trait_assign.wir.wado index c4e8bff48..b9e43f320 100644 --- a/wado-compiler/tests/fixtures.golden/index_trait_assign.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_trait_assign.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -98,13 +98,13 @@ fn run() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_1, 86); - String::append_char(__local_1, 97); - String::append_char(__local_1, 108); - String::append_char(__local_1, 117); - String::append_char(__local_1, 101); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 86); + String::push(__local_1, 97); + String::push(__local_1, 108); + String::push(__local_1, 117); + String::push(__local_1, 101); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(42, __local_2); break __tmpl: __local_1; @@ -306,7 +306,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -321,7 +321,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -359,7 +359,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -393,20 +393,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -416,10 +416,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -440,10 +440,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_trait_both.wir.wado b/wado-compiler/tests/fixtures.golden/index_trait_both.wir.wado index f606b33b0..9ab330a59 100644 --- a/wado-compiler/tests/fixtures.golden/index_trait_both.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_trait_both.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,7 +102,7 @@ fn run() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_1, String { repr: array.new_data("arr[0] = "), used: 9 }); + String::push_str(__local_1, String { repr: array.new_data("arr[0] = "), used: 9 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal("core:internal/Box" { value: 42 }.value, __local_2); break __tmpl: __local_1; @@ -304,7 +304,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -319,7 +319,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -357,7 +357,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -391,20 +391,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -414,10 +414,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -427,10 +427,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -438,10 +438,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_trait_chained.wir.wado b/wado-compiler/tests/fixtures.golden/index_trait_chained.wir.wado index 9c8882bf0..2f8297f05 100644 --- a/wado-compiler/tests/fixtures.golden/index_trait_chained.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_trait_chained.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -120,17 +120,17 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(61), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Results: "), used: 9 }); + String::push_str(__local_4, String { repr: array.new_data("Results: "), used: 9 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_24 = __local_5; i32::fmt_decimal(r1, __local_24); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); + String::push(__local_4, 44); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_29 = __local_5; i32::fmt_decimal(r2, __local_29); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); + String::push(__local_4, 44); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_34 = __local_5; i32::fmt_decimal(r3, __local_34); @@ -138,13 +138,13 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_6, 70); - String::append_char(__local_6, 105); - String::append_char(__local_6, 110); - String::append_char(__local_6, 97); - String::append_char(__local_6, 108); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 70); + String::push(__local_6, 105); + String::push(__local_6, 110); + String::push(__local_6, 97); + String::push(__local_6, 108); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(__sroa___sroa_h_num_n, __local_7); break __tmpl: __local_6; @@ -346,7 +346,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -361,7 +361,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -399,7 +399,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -433,20 +433,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -456,10 +456,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -469,10 +469,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -480,10 +480,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_trait_complex_static.wir.wado b/wado-compiler/tests/fixtures.golden/index_trait_complex_static.wir.wado index 4f43b6012..d6e398e91 100644 --- a/wado-compiler/tests/fixtures.golden/index_trait_complex_static.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_trait_complex_static.wir.wado @@ -72,9 +72,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -117,7 +117,7 @@ fn run() with Stdout { v = value_copy Value(__sroa_c_item); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Initial: "), used: 9 }); + String::push_str(__local_2, String { repr: array.new_data("Initial: "), used: 9 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v.n, __local_3); break __tmpl: __local_2; @@ -125,7 +125,7 @@ fn run() with Stdout { __sroa_c_item.n = __sroa_c_item.n * 2; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_4, String { repr: array.new_data("After double: "), used: 14 }); + String::push_str(__local_4, String { repr: array.new_data("After double: "), used: 14 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_23 = "core:internal/Box" { value: __sroa_c_item.n }; i32::fmt_decimal(__local_23.value, __local_5); @@ -135,7 +135,7 @@ fn run() with Stdout { __sroa_c_item = value; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_6, String { repr: array.new_data("After assign: "), used: 14 }); + String::push_str(__local_6, String { repr: array.new_data("After assign: "), used: 14 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_33 = "core:internal/Box" { value: __sroa_c_item.n }; i32::fmt_decimal(__local_33.value, __local_7); @@ -338,7 +338,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -353,7 +353,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -391,7 +391,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -425,20 +425,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -448,10 +448,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -461,10 +461,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -472,10 +472,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_trait_conditional.wir.wado b/wado-compiler/tests/fixtures.golden/index_trait_conditional.wir.wado index 735a3bc51..88b48741a 100644 --- a/wado-compiler/tests/fixtures.golden/index_trait_conditional.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_trait_conditional.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -98,13 +98,13 @@ fn run() with Stdout { let __local_3: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 86); - String::append_char(__local_2, 97); - String::append_char(__local_2, 108); - String::append_char(__local_2, 117); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 86); + String::push(__local_2, 97); + String::push(__local_2, 108); + String::push(__local_2, 117); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(12, __local_3); break __tmpl: __local_2; @@ -306,7 +306,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -321,7 +321,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -359,7 +359,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -393,20 +393,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -416,10 +416,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -440,10 +440,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_trait_full_struct.wir.wado b/wado-compiler/tests/fixtures.golden/index_trait_full_struct.wir.wado index 941a99698..73593c69c 100644 --- a/wado-compiler/tests/fixtures.golden/index_trait_full_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_trait_full_struct.wir.wado @@ -77,9 +77,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Value::describe" = fn(ref Value) -> ref String; @@ -161,21 +161,21 @@ fn run() with Stdout { v0 = Container^Index::index(c, 0); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_3, 118); - String::append_char(__local_3, 48); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); - String::append(__local_3, Value::describe(v0)); + String::push(__local_3, 118); + String::push(__local_3, 48); + String::push(__local_3, 58); + String::push(__local_3, 32); + String::push_str(__local_3, Value::describe(v0)); break __tmpl: __local_3; }); v1 = Container^Index::index(c, 1); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_4, 118); - String::append_char(__local_4, 49); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); - String::append(__local_4, Value::describe(v1)); + String::push(__local_4, 118); + String::push(__local_4, 49); + String::push(__local_4, 58); + String::push(__local_4, 32); + String::push_str(__local_4, Value::describe(v1)); break __tmpl: __local_4; }); self_26 = Container^IndexMut::index_mut(c, 0); @@ -187,29 +187,29 @@ fn run() with Stdout { "core:cli/println"(String { repr: array.new_data("After mutations:"), used: 16 }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_5, 118); - String::append_char(__local_5, 48); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); - String::append(__local_5, Value::describe(c.v0)); + String::push(__local_5, 118); + String::push(__local_5, 48); + String::push(__local_5, 58); + String::push(__local_5, 32); + String::push_str(__local_5, Value::describe(c.v0)); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_6, 118); - String::append_char(__local_6, 49); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); - String::append(__local_6, Value::describe(c.v1)); + String::push(__local_6, 118); + String::push(__local_6, 49); + String::push(__local_6, 58); + String::push(__local_6, 32); + String::push_str(__local_6, Value::describe(c.v1)); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_7, 118); - String::append_char(__local_7, 50); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); - String::append(__local_7, Value::describe(c.v2)); + String::push(__local_7, 118); + String::push(__local_7, 50); + String::push(__local_7, 58); + String::push(__local_7, 32); + String::push_str(__local_7, Value::describe(c.v2)); break __tmpl: __local_7; }); Container^IndexAssign::index_assign(c, 2, __inline_Value__new_14: block -> ref Value { @@ -218,41 +218,41 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_8, String { repr: array.new_data("After replace: "), used: 15 }); - String::append(__local_8, Value::describe(c.v2)); + String::push_str(__local_8, String { repr: array.new_data("After replace: "), used: 15 }); + String::push_str(__local_8, Value::describe(c.v2)); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_9, 84); - String::append_char(__local_9, 111); - String::append_char(__local_9, 116); - String::append_char(__local_9, 97); - String::append_char(__local_9, 108); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 84); + String::push(__local_9, 111); + String::push(__local_9, 116); + String::push(__local_9, 97); + String::push(__local_9, 108); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal((c.v0.n + c.v1.n) + c.v2.n, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_11, 83); - String::append_char(__local_11, 116); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 115); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); - String::append(__local_11, Container::stats(c)); + String::push(__local_11, 83); + String::push(__local_11, 116); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 115); + String::push(__local_11, 58); + String::push(__local_11, 32); + String::push_str(__local_11, Container::stats(c)); break __tmpl: __local_11; }); c.read_count = 0; c.write_count = 0; "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_12, String { repr: array.new_data("After reset: "), used: 13 }); - String::append(__local_12, Container::stats(c)); + String::push_str(__local_12, String { repr: array.new_data("After reset: "), used: 13 }); + String::push_str(__local_12, Container::stats(c)); break __tmpl: __local_12; }); self_47 = Container^IndexMut::index_mut(c, 0); @@ -261,8 +261,8 @@ fn run() with Stdout { self_48.n = self_48.n + 1; "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Final stats: "), used: 13 }); - String::append(__local_13, Container::stats(c)); + String::push_str(__local_13, String { repr: array.new_data("Final stats: "), used: 13 }); + String::push_str(__local_13, Container::stats(c)); break __tmpl: __local_13; }); } @@ -462,7 +462,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -477,7 +477,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -509,8 +509,8 @@ fn Value::describe(self) { let __local_2: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_1, self.tag); - String::append_char(__local_1, 58); + String::push_str(__local_1, self.tag); + String::push(__local_1, 58); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(self.n, __local_2); break __tmpl: __local_1; @@ -524,16 +524,16 @@ fn Container::stats(self) { let __local_11: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(47), used: 0 }; - String::append_char(__local_1, 114); - String::append_char(__local_1, 101); - String::append_char(__local_1, 97); - String::append_char(__local_1, 100); - String::append_char(__local_1, 115); - String::append_char(__local_1, 61); + String::push(__local_1, 114); + String::push(__local_1, 101); + String::push(__local_1, 97); + String::push(__local_1, 100); + String::push(__local_1, 115); + String::push(__local_1, 61); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_6 = __local_2; i32::fmt_decimal(self.read_count, __local_6); - String::append(__local_1, String { repr: array.new_data(", writes="), used: 9 }); + String::push_str(__local_1, String { repr: array.new_data(", writes="), used: 9 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_11 = __local_2; i32::fmt_decimal(self.write_count, __local_11); @@ -584,7 +584,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l29; }; @@ -618,20 +618,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -641,10 +641,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -654,10 +654,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -665,10 +665,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_trait_function.wir.wado b/wado-compiler/tests/fixtures.golden/index_trait_function.wir.wado index d89942172..a15c26227 100644 --- a/wado-compiler/tests/fixtures.golden/index_trait_function.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_trait_function.wir.wado @@ -72,9 +72,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -113,13 +113,13 @@ fn run() with Stdout { d = value_copy Data(h.data); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 86); - String::append_char(__local_2, 97); - String::append_char(__local_2, 108); - String::append_char(__local_2, 117); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 86); + String::push(__local_2, 97); + String::push(__local_2, 108); + String::push(__local_2, 117); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(d.value, __local_3); break __tmpl: __local_2; @@ -321,7 +321,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -336,7 +336,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -374,7 +374,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -408,20 +408,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -431,10 +431,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -444,10 +444,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -455,10 +455,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_trait_loop.wir.wado b/wado-compiler/tests/fixtures.golden/index_trait_loop.wir.wado index 36e8ae5ef..430755ee8 100644 --- a/wado-compiler/tests/fixtures.golden/index_trait_loop.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_trait_loop.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -116,7 +116,7 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Sum 1-5: "), used: 9 }); + String::push_str(__local_2, String { repr: array.new_data("Sum 1-5: "), used: 9 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(__sroa___sroa_w_acc_sum, __local_3); break __tmpl: __local_2; @@ -318,7 +318,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -333,7 +333,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -371,7 +371,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -405,20 +405,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -428,10 +428,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -441,10 +441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -452,10 +452,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_trait_multiple.wir.wado b/wado-compiler/tests/fixtures.golden/index_trait_multiple.wir.wado index 62dcb16b4..5759a818d 100644 --- a/wado-compiler/tests/fixtures.golden/index_trait_multiple.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_trait_multiple.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Point::move_by" = fn(ref Point, i32, i32); @@ -121,38 +121,38 @@ fn run() with Stdout { p2 = value_copy Point(__sroa_h2_point); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(40), used: 0 }; - String::append_char(__local_4, 104); - String::append_char(__local_4, 49); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); - String::append_char(__local_4, 40); + String::push(__local_4, 104); + String::push(__local_4, 49); + String::push(__local_4, 58); + String::push(__local_4, 32); + String::push(__local_4, 40); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_20 = __local_5; i32::fmt_decimal(p1.x, __local_20); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); + String::push(__local_4, 44); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_25 = __local_5; i32::fmt_decimal(p1.y, __local_25); - String::append_char(__local_4, 41); + String::push(__local_4, 41); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(40), used: 0 }; - String::append_char(__local_6, 104); - String::append_char(__local_6, 50); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); - String::append_char(__local_6, 40); + String::push(__local_6, 104); + String::push(__local_6, 50); + String::push(__local_6, 58); + String::push(__local_6, 32); + String::push(__local_6, 40); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_31 = __local_7; i32::fmt_decimal(p2.x, __local_31); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); + String::push(__local_6, 44); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_36 = __local_7; i32::fmt_decimal(p2.y, __local_36); - String::append_char(__local_6, 41); + String::push(__local_6, 41); break __tmpl: __local_6; }); } @@ -352,7 +352,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -367,7 +367,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -410,7 +410,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -444,20 +444,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -467,10 +467,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -480,10 +480,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -491,10 +491,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_trait_read.wir.wado b/wado-compiler/tests/fixtures.golden/index_trait_read.wir.wado index 1b8733af5..808f52361 100644 --- a/wado-compiler/tests/fixtures.golden/index_trait_read.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_trait_read.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -104,13 +104,13 @@ fn run() with Stdout { x = "core:internal/Box" { value: 42 }.value; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 86); - String::append_char(__local_2, 97); - String::append_char(__local_2, 108); - String::append_char(__local_2, 117); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 86); + String::push(__local_2, 97); + String::push(__local_2, 108); + String::push(__local_2, 117); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(x, __local_3); break __tmpl: __local_2; @@ -312,7 +312,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -327,7 +327,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -365,7 +365,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -399,20 +399,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -422,10 +422,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -435,10 +435,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -446,10 +446,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_value_generic.wir.wado b/wado-compiler/tests/fixtures.golden/index_value_generic.wir.wado index 306f341a4..97437d215 100644 --- a/wado-compiler/tests/fixtures.golden/index_value_generic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_value_generic.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -109,22 +109,22 @@ fn run() with Stdout { let __local_49: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(58), used: 0 }; - String::append_char(__local_8, 110); - String::append_char(__local_8, 117); - String::append_char(__local_8, 109); - String::append_char(__local_8, 115); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 110); + String::push(__local_8, 117); + String::push(__local_8, 109); + String::push(__local_8, 115); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_24 = __local_9; i32::fmt_decimal(10, __local_24); - String::append_char(__local_8, 44); - String::append_char(__local_8, 32); + String::push(__local_8, 44); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_29 = __local_9; i32::fmt_decimal(20, __local_29); - String::append_char(__local_8, 44); - String::append_char(__local_8, 32); + String::push(__local_8, 44); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_34 = __local_9; i32::fmt_decimal(30, __local_34); @@ -132,18 +132,18 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(41), used: 0 }; - String::append_char(__local_10, 108); - String::append_char(__local_10, 111); - String::append_char(__local_10, 110); - String::append_char(__local_10, 103); - String::append_char(__local_10, 115); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 108); + String::push(__local_10, 111); + String::push(__local_10, 110); + String::push(__local_10, 103); + String::push(__local_10, 115); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_44 = __local_11; i64::fmt_decimal(100_i64, __local_44); - String::append_char(__local_10, 44); - String::append_char(__local_10, 32); + String::push(__local_10, 44); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_49 = __local_11; i64::fmt_decimal(200_i64, __local_49); @@ -151,11 +151,11 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_12, 115); - String::append_char(__local_12, 117); - String::append_char(__local_12, 109); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 115); + String::push(__local_12, 117); + String::push(__local_12, 109); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(60, __local_13); break __tmpl: __local_12; @@ -396,7 +396,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -411,7 +411,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -449,7 +449,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -483,20 +483,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -506,10 +506,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -519,10 +519,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -530,10 +530,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/index_value_trait.wir.wado b/wado-compiler/tests/fixtures.golden/index_value_trait.wir.wado index 0fc0d014c..b6840ce2b 100644 --- a/wado-compiler/tests/fixtures.golden/index_value_trait.wir.wado +++ b/wado-compiler/tests/fixtures.golden/index_value_trait.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -104,51 +104,51 @@ fn run() with Stdout { let __local_12: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_5, 102); - String::append_char(__local_5, 105); - String::append_char(__local_5, 114); - String::append_char(__local_5, 115); - String::append_char(__local_5, 116); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 102); + String::push(__local_5, 105); + String::push(__local_5, 114); + String::push(__local_5, 115); + String::push(__local_5, 116); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(10, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_7, 115); - String::append_char(__local_7, 101); - String::append_char(__local_7, 99); - String::append_char(__local_7, 111); - String::append_char(__local_7, 110); - String::append_char(__local_7, 100); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 101); + String::push(__local_7, 99); + String::push(__local_7, 111); + String::push(__local_7, 110); + String::push(__local_7, 100); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(20, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_9, 116); - String::append_char(__local_9, 104); - String::append_char(__local_9, 105); - String::append_char(__local_9, 114); - String::append_char(__local_9, 100); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 116); + String::push(__local_9, 104); + String::push(__local_9, 105); + String::push(__local_9, 114); + String::push(__local_9, 100); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(30, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_11, 115); - String::append_char(__local_11, 117); - String::append_char(__local_11, 109); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 115); + String::push(__local_11, 117); + String::push(__local_11, 109); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(60, __local_12); break __tmpl: __local_11; @@ -350,7 +350,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -365,7 +365,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -403,7 +403,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -437,20 +437,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -460,10 +460,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -473,10 +473,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -484,10 +484,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/infer_method_type_arg_from_return_type.wir.wado b/wado-compiler/tests/fixtures.golden/infer_method_type_arg_from_return_type.wir.wado index e08226b56..ebf8e596b 100644 --- a/wado-compiler/tests/fixtures.golden/infer_method_type_arg_from_return_type.wir.wado +++ b/wado-compiler/tests/fixtures.golden/infer_method_type_arg_from_return_type.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -321,7 +321,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -336,7 +336,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -374,7 +374,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -408,20 +408,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -431,10 +431,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -444,10 +444,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -455,10 +455,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/inline_array_append_nested.wir.wado b/wado-compiler/tests/fixtures.golden/inline_array_append_nested.wir.wado index ed809bead..1c5b4136b 100644 --- a/wado-compiler/tests/fixtures.golden/inline_array_append_nested.wir.wado +++ b/wado-compiler/tests/fixtures.golden/inline_array_append_nested.wir.wado @@ -79,11 +79,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -131,10 +131,10 @@ fn run() with Stdout { Container::process(c.items); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_2, 108); - String::append_char(__local_2, 101); - String::append_char(__local_2, 110); - String::append_char(__local_2, 61); + String::push(__local_2, 108); + String::push(__local_2, 101); + String::push(__local_2, 110); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_10 = "core:internal/Box" { value: __inline_Array_i32___len_8: block -> i32 { __local_12 = c.items; @@ -340,7 +340,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -355,7 +355,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -393,8 +393,8 @@ fn Container::add_items(self, count) { if (i < count) == 0 { break __for_0; }; - Array::append(_licm_items_3, i); - Array::append(_licm_items_3, i * 2); + Array::push(_licm_items_3, i); + Array::push(_licm_items_3, i * 2); i = i + 1; continue l23; }; @@ -435,7 +435,7 @@ fn Container::process(self) { break __inline_Array_i32__IndexValue__index_value_4: builtin::array_get(_licm_repr_17, __local_11); }; if (val % 2) == 0 { - Array::append(temp, val); + Array::push(temp, val); }; i = i + 1; continue l26; @@ -452,7 +452,7 @@ fn Container::process(self) { if (j < _licm_used_18) == 0 { break __for_2; }; - Array::append(_licm_items_19, __inline_Array_i32__IndexValue__index_value_6: block -> i32 { + Array::push(_licm_items_19, __inline_Array_i32__IndexValue__index_value_6: block -> i32 { __local_14 = j; break __inline_Array_i32__IndexValue__index_value_6: builtin::array_get(_licm_repr_20, __local_14); } + 100); @@ -463,7 +463,7 @@ fn Container::process(self) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -516,7 +516,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l37; }; @@ -550,20 +550,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -573,10 +573,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -586,10 +586,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -597,10 +597,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/inline_cross_module_method.wir.wado b/wado-compiler/tests/fixtures.golden/inline_cross_module_method.wir.wado index 89b130c96..1656406c2 100644 --- a/wado-compiler/tests/fixtures.golden/inline_cross_module_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/inline_cross_module_method.wir.wado @@ -71,11 +71,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -117,33 +117,33 @@ fn run() { __local_0 = Array { repr: array.new_fixed(10, 20, 30), used: 3 }; break __seq_lit: __local_0; }; - Array::append(arr, 40); + Array::push(arr, 40); __v0 = arr.used; __cond = __v0 == 4; if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/inline_cross_module_method.wado"), used: 60 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/inline_cross_module_method.wado"), used: 60 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_20 = __local_5; i32::fmt_decimal(9, __local_20); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: arr.len() == 4 "), used: 27 }); - String::append(__local_4, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_25 = __local_5; i32::fmt_decimal(__v0, __local_25); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -346,7 +346,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -361,7 +361,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -388,7 +388,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -441,7 +441,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l28; }; @@ -475,20 +475,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -498,10 +498,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -511,10 +511,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -522,10 +522,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/inline_merged.wir.wado b/wado-compiler/tests/fixtures.golden/inline_merged.wir.wado index c4ac4d5b4..32737faac 100644 --- a/wado-compiler/tests/fixtures.golden/inline_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/inline_merged.wir.wado @@ -107,15 +107,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref InlineItem); +type "functype/Array::push" = fn(ref Array, ref InlineItem); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -166,7 +166,7 @@ fn test_array_append_minimal() with Stdout { if (i < 3) == 0 { break __for_0; }; - Array::append(arr, i); + Array::push(arr, i); i = i + 1; continue l1; }; @@ -174,10 +174,10 @@ fn test_array_append_minimal() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_3, 108); - String::append_char(__local_3, 101); - String::append_char(__local_3, 110); - String::append_char(__local_3, 61); + String::push(__local_3, 108); + String::push(__local_3, 101); + String::push(__local_3, 110); + String::push(__local_3, 61); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(arr.used, __local_4); break __tmpl: __local_3; @@ -360,9 +360,9 @@ fn test_method_minimal() with Stdout { __local_2 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_2; }; - Array::append(arr1, 1); - Array::append(arr1, 2); - Array::append(arr2, 3); + Array::push(arr1, 1); + Array::push(arr1, 2); + Array::push(arr2, 3); a = __inline_Array_i32__IndexValue__index_value_6: block -> i32 { if 0 >= arr1.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -379,19 +379,19 @@ fn test_method_minimal() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(42), used: 0 }; - String::append_char(__local_6, 82); - String::append_char(__local_6, 101); - String::append_char(__local_6, 115); - String::append_char(__local_6, 117); - String::append_char(__local_6, 108); - String::append_char(__local_6, 116); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 82); + String::push(__local_6, 101); + String::push(__local_6, 115); + String::push(__local_6, 117); + String::push(__local_6, 108); + String::push(__local_6, 116); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_21 = __local_7; i32::fmt_decimal(a, __local_21); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); + String::push(__local_6, 44); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_26 = __local_7; i32::fmt_decimal(b, __local_26); @@ -682,7 +682,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -697,7 +697,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -724,7 +724,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -766,7 +766,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -819,7 +819,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l56; }; @@ -853,20 +853,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -876,10 +876,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -889,10 +889,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -900,10 +900,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/inline_primitive_method.wir.wado b/wado-compiler/tests/fixtures.golden/inline_primitive_method.wir.wado index b9afdad04..b93550802 100644 --- a/wado-compiler/tests/fixtures.golden/inline_primitive_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/inline_primitive_method.wir.wado @@ -97,7 +97,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -107,9 +107,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -192,11 +192,11 @@ fn run() with Stdout { __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_10 = __local_4; f64::fmt_into(x, __local_10); - String::append_char(__local_3, 32); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_13 = __local_4; i64::fmt_decimal(bits, __local_13); - String::append_char(__local_3, 32); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_18 = __local_4; f64::fmt_into(back, __local_18); @@ -965,8 +965,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1021,8 +1021,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1054,7 +1054,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1183,27 +1183,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1343,9 +1343,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1399,13 +1399,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1440,9 +1440,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1495,7 +1495,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1510,7 +1510,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1548,7 +1548,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l154; }; @@ -1706,20 +1706,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1729,10 +1729,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1742,10 +1742,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1753,10 +1753,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/inlining_test.wir.wado b/wado-compiler/tests/fixtures.golden/inlining_test.wir.wado index 0f3a1c71c..46d6a440d 100644 --- a/wado-compiler/tests/fixtures.golden/inlining_test.wir.wado +++ b/wado-compiler/tests/fixtures.golden/inlining_test.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -98,13 +98,13 @@ fn run() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_1, 114); - String::append_char(__local_1, 101); - String::append_char(__local_1, 115); - String::append_char(__local_1, 117); - String::append_char(__local_1, 108); - String::append_char(__local_1, 116); - String::append_char(__local_1, 61); + String::push(__local_1, 114); + String::push(__local_1, 101); + String::push(__local_1, 115); + String::push(__local_1, 117); + String::push(__local_1, 108); + String::push(__local_1, 116); + String::push(__local_1, 61); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(42, __local_2); break __tmpl: __local_1; @@ -306,7 +306,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -321,7 +321,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -359,7 +359,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -393,20 +393,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -416,10 +416,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -440,10 +440,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/inspect_1.wir.wado b/wado-compiler/tests/fixtures.golden/inspect_1.wir.wado index e05cec62a..1e0349dcf 100644 --- a/wado-compiler/tests/fixtures.golden/inspect_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/inspect_1.wir.wado @@ -166,7 +166,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -176,13 +176,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/InspColor^Inspect::inspect" = fn(enum:InspColor, ref Formatter); @@ -301,17 +301,17 @@ fn __test_0_primitives() { if __cond_0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_0_primitives"), used: 19 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_0_primitives"), used: 19 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(2, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: `{42:?}` == \"42\" "), used: 29 }); break __tmpl: __local_8; @@ -327,17 +327,17 @@ condition: `{42:?}` == \"42\" if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_0_primitives"), used: 19 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_0_primitives"), used: 19 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(3, __local_13); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: `{-7:?}` == \"-7\" "), used: 29 }); break __tmpl: __local_12; @@ -353,17 +353,17 @@ condition: `{-7:?}` == \"-7\" if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_0_primitives"), used: 19 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_0_primitives"), used: 19 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(4, __local_17); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: `{3.14:?}` == \"3.14\" "), used: 33 }); break __tmpl: __local_16; @@ -381,17 +381,17 @@ condition: `{3.14:?}` == \"3.14\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_0_primitives"), used: 19 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_0_primitives"), used: 19 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(5, __local_21); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: `{true:?}` == \"true\" "), used: 33 }); break __tmpl: __local_20; @@ -409,17 +409,17 @@ condition: `{true:?}` == \"true\" if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("__test_0_primitives"), used: 19 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("__test_0_primitives"), used: 19 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i32::fmt_decimal(6, __local_25); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: `{false:?}` == \"false\" "), used: 35 }); break __tmpl: __local_24; @@ -435,17 +435,17 @@ condition: `{false:?}` == \"false\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("__test_0_primitives"), used: 19 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("__test_0_primitives"), used: 19 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; i32::fmt_decimal(7, __local_29); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: `{'A':?}` == \"'A'\" "), used: 31 }); break __tmpl: __local_28; @@ -496,17 +496,17 @@ fn __test_1_float_special() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_1_float_special"), used: 22 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_1_float_special"), used: 22 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(12, __local_13); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: `{inf:?}` == \"inf\" "), used: 31 }); break __tmpl: __local_12; @@ -522,17 +522,17 @@ condition: `{inf:?}` == \"inf\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_1_float_special"), used: 22 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_1_float_special"), used: 22 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(14, __local_17); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: `{neg_inf:?}` == \"-inf\" "), used: 36 }); break __tmpl: __local_16; @@ -548,17 +548,17 @@ condition: `{neg_inf:?}` == \"-inf\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_1_float_special"), used: 22 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_1_float_special"), used: 22 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(16, __local_21); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: `{zero:?}` == \"0.0\" "), used: 32 }); break __tmpl: __local_20; @@ -574,17 +574,17 @@ condition: `{zero:?}` == \"0.0\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("__test_1_float_special"), used: 22 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("__test_1_float_special"), used: 22 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i32::fmt_decimal(18, __local_25); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: `{neg_zero:?}` == \"-0.0\" "), used: 37 }); break __tmpl: __local_24; @@ -600,17 +600,17 @@ condition: `{neg_zero:?}` == \"-0.0\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("__test_1_float_special"), used: 22 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("__test_1_float_special"), used: 22 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; i32::fmt_decimal(20, __local_29); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: `{f32_inf:?}` == \"inf\" "), used: 35 }); break __tmpl: __local_28; @@ -661,17 +661,17 @@ fn __test_2_string() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_2_string"), used: 15 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_2_string"), used: 15 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(25, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{s:?}` == \"\\\"hello\\\"\" "), used: 35 }); break __tmpl: __local_10; @@ -688,17 +688,17 @@ condition: `{s:?}` == \"\\\"hello\\\"\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_2_string"), used: 15 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_2_string"), used: 15 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(27, __local_15); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: `{with_quote:?}` == \"\\\"say \\\\\\\"hi\\\\\\\"\\\"\" "), used: 53 }); break __tmpl: __local_14; @@ -716,17 +716,17 @@ line2"), used: 11 }; if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_2_string"), used: 15 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_2_string"), used: 15 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(29, __local_19); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: `{with_newline:?}` == \"\\\"line1\\\\nline2\\\"\" "), used: 54 }); break __tmpl: __local_18; @@ -743,17 +743,17 @@ condition: `{with_newline:?}` == \"\\\"line1\\\\nline2\\\"\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_2_string"), used: 15 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_2_string"), used: 15 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i32::fmt_decimal(31, __local_23); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: `{empty:?}` == \"\\\"\\\"\" "), used: 34 }); break __tmpl: __local_22; @@ -785,34 +785,34 @@ fn __test_3_tuple() { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_9 = String { repr: array.new_data("["), used: 1 }; - String::append(__local_3.buf, __local_9); + String::push_str(__local_3.buf, __local_9); i32::fmt_decimal(1, __local_3); __local_15 = String { repr: array.new_data(", "), used: 2 }; - String::append(__local_3.buf, __local_15); + String::push_str(__local_3.buf, __local_15); String^Inspect::inspect(__sroa_t_1, __local_3); __local_17 = String { repr: array.new_data(", "), used: 2 }; - String::append(__local_3.buf, __local_17); + String::push_str(__local_3.buf, __local_17); Formatter::pad(__local_3, block -> ref String { String { repr: array.new_data("true"), used: 4 }; }); __local_23 = String { repr: array.new_data("]"), used: 1 }; - String::append(__local_3.buf, __local_23); + String::push_str(__local_3.buf, __local_23); break __tmpl: __local_2; }, String { repr: array.new_data("[1, \"hello\", true]"), used: 18 }); if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_3_tuple"), used: 14 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_3_tuple"), used: 14 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(36, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: `{t:?}` == \"[1, \\\"hello\\\", true]\" "), used: 46 }); break __tmpl: __local_4; @@ -839,23 +839,23 @@ fn __test_4_unit() { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_9 = String { repr: array.new_data("()"), used: 2 }; - String::append(__local_3.buf, __local_9); + String::push_str(__local_3.buf, __local_9); break __tmpl: __local_2; }, String { repr: array.new_data("()"), used: 2 }); if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_4_unit"), used: 13 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_4_unit"), used: 13 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(41, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: `{u:?}` == \"()\" "), used: 28 }); break __tmpl: __local_4; @@ -920,7 +920,7 @@ fn __test_5_ref() { __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_31 = __local_13; __local_34 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_31.buf, __local_34); + String::push_str(__local_31.buf, __local_34); __local_32 = r; i32::fmt_decimal(__local_32.value, __local_31); break __tmpl: __local_12; @@ -928,17 +928,17 @@ fn __test_5_ref() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_5_ref"), used: 12 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_5_ref"), used: 12 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(47, __local_15); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: `{r:?}` == \"&42\" "), used: 29 }); break __tmpl: __local_14; @@ -953,7 +953,7 @@ condition: `{r:?}` == \"&42\" __local_47 = mr; __local_48 = __local_17; __local_51 = String { repr: array.new_data("&mut "), used: 5 }; - String::append(__local_48.buf, __local_51); + String::push_str(__local_48.buf, __local_51); __local_49 = __local_47; i32::fmt_decimal(__local_49.value, __local_48); break __tmpl: __local_16; @@ -961,17 +961,17 @@ condition: `{r:?}` == \"&42\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_5_ref"), used: 12 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_5_ref"), used: 12 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(50, __local_19); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: `{mr:?}` == \"&mut 100\" "), used: 35 }); break __tmpl: __local_18; @@ -985,7 +985,7 @@ condition: `{mr:?}` == \"&mut 100\" __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_65 = __local_21; __local_68 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_65.buf, __local_68); + String::push_str(__local_65.buf, __local_68); __local_66 = rs; String^Inspect::inspect(__local_66, __local_65); break __tmpl: __local_20; @@ -993,17 +993,17 @@ condition: `{mr:?}` == \"&mut 100\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_5_ref"), used: 12 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_5_ref"), used: 12 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i32::fmt_decimal(53, __local_23); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: `{rs:?}` == \"&\\\"hello\\\"\" "), used: 37 }); break __tmpl: __local_22; @@ -1017,7 +1017,7 @@ condition: `{rs:?}` == \"&\\\"hello\\\"\" __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_78 = __local_25; __local_81 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_78.buf, __local_81); + String::push_str(__local_78.buf, __local_81); __local_79 = rb; Formatter::pad(__local_78, if __local_79.value -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -1029,17 +1029,17 @@ condition: `{rs:?}` == \"&\\\"hello\\\"\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_26, String { repr: array.new_data("__test_5_ref"), used: 12 }); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_26, String { repr: array.new_data("__test_5_ref"), used: 12 }); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; i32::fmt_decimal(56, __local_27); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: `{rb:?}` == \"&true\" "), used: 32 }); break __tmpl: __local_26; @@ -1076,23 +1076,23 @@ fn __test_6_newtype() { __local_15 = __local_5; f64::inspect_into(100.5, __local_15); __local_19 = String { repr: array.new_data(" as Meters"), used: 10 }; - String::append(__local_15.buf, __local_19); + String::push_str(__local_15.buf, __local_19); break __tmpl: __local_4; }, String { repr: array.new_data("100.5 as Meters"), used: 15 }); if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_6_newtype"), used: 16 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_6_newtype"), used: 16 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(64, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{m:?}` == \"100.5 as Meters\" "), used: 41 }); break __tmpl: __local_6; @@ -1105,23 +1105,23 @@ condition: `{m:?}` == \"100.5 as Meters\" __local_29 = __local_9; i32::fmt_decimal(42, __local_29); __local_35 = String { repr: array.new_data(" as Seconds"), used: 11 }; - String::append(__local_29.buf, __local_35); + String::push_str(__local_29.buf, __local_35); break __tmpl: __local_8; }, String { repr: array.new_data("42 as Seconds"), used: 13 }); if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_6_newtype"), used: 16 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_6_newtype"), used: 16 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(66, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{s:?}` == \"42 as Seconds\" "), used: 39 }); break __tmpl: __local_10; @@ -1166,17 +1166,17 @@ fn __test_7_enum() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_7_enum"), used: 13 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_7_enum"), used: 13 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(77, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: `{r:?}` == \"InspColor::Red\" "), used: 40 }); break __tmpl: __local_8; @@ -1193,17 +1193,17 @@ condition: `{r:?}` == \"InspColor::Red\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_7_enum"), used: 13 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_7_enum"), used: 13 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(79, __local_13); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: `{g:?}` == \"InspColor::Green\" "), used: 42 }); break __tmpl: __local_12; @@ -1220,17 +1220,17 @@ condition: `{g:?}` == \"InspColor::Green\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_7_enum"), used: 13 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_7_enum"), used: 13 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(81, __local_17); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: `{b:?}` == \"InspColor::Blue\" "), used: 41 }); break __tmpl: __local_16; @@ -1275,17 +1275,17 @@ fn __test_8_variant() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_8_variant"), used: 16 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_8_variant"), used: 16 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(92, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: `{c:?}` == \"InspShape::Circle(5.0)\" "), used: 48 }); break __tmpl: __local_8; @@ -1302,17 +1302,17 @@ condition: `{c:?}` == \"InspShape::Circle(5.0)\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_8_variant"), used: 16 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_8_variant"), used: 16 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(94, __local_13); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: `{r:?}` == \"InspShape::Rectangle([3.0, 4.0])\" "), used: 58 }); break __tmpl: __local_12; @@ -1329,17 +1329,17 @@ condition: `{r:?}` == \"InspShape::Rectangle([3.0, 4.0])\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_8_variant"), used: 16 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_8_variant"), used: 16 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(96, __local_17); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: `{p:?}` == \"InspShape::InspPoint\" "), used: 46 }); break __tmpl: __local_16; @@ -1385,17 +1385,17 @@ fn __test_9_flags() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_9_flags"), used: 14 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_9_flags"), used: 14 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(107, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{r:?}` == \"InspPerms::Read\" "), used: 41 }); break __tmpl: __local_10; @@ -1411,17 +1411,17 @@ condition: `{r:?}` == \"InspPerms::Read\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_9_flags"), used: 14 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_9_flags"), used: 14 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(109, __local_15); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: `{rw:?}` == \"InspPerms::Read | InspPerms::Write\" "), used: 61 }); break __tmpl: __local_14; @@ -1437,17 +1437,17 @@ condition: `{rw:?}` == \"InspPerms::Read | InspPerms::Write\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_9_flags"), used: 14 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_9_flags"), used: 14 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(111, __local_19); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: `{all:?}` == \"InspPerms::Read | InspPerms::Write | InspPerms::Execute\" "), used: 83 }); break __tmpl: __local_18; @@ -1463,17 +1463,17 @@ condition: `{all:?}` == \"InspPerms::Read | InspPerms::Write | InspPerms::Execut if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_9_flags"), used: 14 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_9_flags"), used: 14 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i32::fmt_decimal(113, __local_23); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: `{none:?}` == \"InspPerms::none()\" "), used: 46 }); break __tmpl: __local_22; @@ -1530,23 +1530,23 @@ fn __test_10_closure() { __local_9 = String { repr: builtin::array_new(16), used: 0 }; __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_36 = String { repr: array.new_data("|i32| -> i32"), used: 12 }; - String::append(__local_10.buf, __local_36); + String::push_str(__local_10.buf, __local_36); break __tmpl: __local_9; }, String { repr: array.new_data("|i32| -> i32"), used: 12 }); if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_10_closure"), used: 17 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_10_closure"), used: 17 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(118, __local_12); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: `{add_one:?}` == \"|i32| -> i32\" "), used: 44 }); break __tmpl: __local_11; @@ -1557,23 +1557,23 @@ condition: `{add_one:?}` == \"|i32| -> i32\" __local_13 = String { repr: builtin::array_new(16), used: 0 }; __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_46 = String { repr: array.new_data("|i32, i32| -> i32"), used: 17 }; - String::append(__local_14.buf, __local_46); + String::push_str(__local_14.buf, __local_46); break __tmpl: __local_13; }, String { repr: array.new_data("|i32, i32| -> i32"), used: 17 }); if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_10_closure"), used: 17 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_10_closure"), used: 17 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(120, __local_16); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: `{add:?}` == \"|i32, i32| -> i32\" "), used: 45 }); break __tmpl: __local_15; @@ -1584,23 +1584,23 @@ condition: `{add:?}` == \"|i32, i32| -> i32\" __local_17 = String { repr: builtin::array_new(16), used: 0 }; __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_56 = String { repr: array.new_data("|| -> i32"), used: 9 }; - String::append(__local_18.buf, __local_56); + String::push_str(__local_18.buf, __local_56); break __tmpl: __local_17; }, String { repr: array.new_data("|| -> i32"), used: 9 }); if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_10_closure"), used: 17 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_10_closure"), used: 17 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; i32::fmt_decimal(122, __local_20); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: `{always42:?}` == \"|| -> i32\" "), used: 42 }); break __tmpl: __local_19; @@ -1611,23 +1611,23 @@ condition: `{always42:?}` == \"|| -> i32\" __local_21 = String { repr: builtin::array_new(16), used: 0 }; __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_66 = String { repr: array.new_data("|x: i32| x + 1"), used: 14 }; - String::append(__local_22.buf, __local_66); + String::push_str(__local_22.buf, __local_66); break __tmpl: __local_21; }, String { repr: array.new_data("|x: i32| x + 1"), used: 14 }); if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("__test_10_closure"), used: 17 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("__test_10_closure"), used: 17 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; i32::fmt_decimal(125, __local_24); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: `{add_one:#?}` == \"|x: i32| x + 1\" "), used: 47 }); break __tmpl: __local_23; @@ -1638,23 +1638,23 @@ condition: `{add_one:#?}` == \"|x: i32| x + 1\" __local_25 = String { repr: builtin::array_new(16), used: 0 }; __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_76 = String { repr: array.new_data("|a: i32, b: i32| a + b"), used: 22 }; - String::append(__local_26.buf, __local_76); + String::push_str(__local_26.buf, __local_76); break __tmpl: __local_25; }, String { repr: array.new_data("|a: i32, b: i32| a + b"), used: 22 }); if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("__test_10_closure"), used: 17 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("__test_10_closure"), used: 17 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; i32::fmt_decimal(126, __local_28); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: `{add:#?}` == \"|a: i32, b: i32| a + b\" "), used: 51 }); break __tmpl: __local_27; @@ -1665,23 +1665,23 @@ condition: `{add:#?}` == \"|a: i32, b: i32| a + b\" __local_29 = String { repr: builtin::array_new(16), used: 0 }; __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_86 = String { repr: array.new_data("|| 42"), used: 5 }; - String::append(__local_30.buf, __local_86); + String::push_str(__local_30.buf, __local_86); break __tmpl: __local_29; }, String { repr: array.new_data("|| 42"), used: 5 }); if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_31, String { repr: array.new_data("__test_10_closure"), used: 17 }); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_31, String { repr: array.new_data("__test_10_closure"), used: 17 }); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_1.wado"), used: 43 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; i32::fmt_decimal(127, __local_32); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: `{always42:#?}` == \"|| 42\" "), used: 39 }); break __tmpl: __local_31; @@ -2594,8 +2594,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2650,13 +2650,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -2664,25 +2664,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -2690,7 +2690,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -2732,8 +2732,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2765,7 +2765,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -2894,27 +2894,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3039,9 +3039,9 @@ fn f32::inspect_into(self, f) { break __inline_String__len_6: __local_23.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -3051,8 +3051,8 @@ fn f32::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -3120,9 +3120,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -3132,8 +3132,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -3188,13 +3188,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -3229,9 +3229,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -3239,27 +3239,27 @@ fn f64::fmt_fixed(self, precision, f) { fn char^Inspect::inspect(self, f) { let c: char; - String::append_char(f.buf, 39); + String::push(f.buf, 39); c = self; if c == 39 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 39); + String::push(f.buf, 92); + String::push(f.buf, 39); } else if c == 92 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 92); + String::push(f.buf, 92); + String::push(f.buf, 92); } else if c == 10 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 110); + String::push(f.buf, 92); + String::push(f.buf, 110); } else if c == 13 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 114); + String::push(f.buf, 92); + String::push(f.buf, 114); } else if c == 9 { - String::append_char(f.buf, 92); - String::append_char(f.buf, 116); + String::push(f.buf, 92); + String::push(f.buf, 116); } else { - String::append_char(f.buf, c); + String::push(f.buf, c); }; - String::append_char(f.buf, 39); + String::push(f.buf, 39); } fn String::grow(self, min_capacity) { @@ -3309,7 +3309,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -3397,7 +3397,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -3430,13 +3430,13 @@ fn InspColor^Inspect::inspect(self, f) { let __local_7: ref String; if self == 0 { __local_3 = String { repr: array.new_data("InspColor::Red"), used: 14 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); } else if self == 1 { __local_5 = String { repr: array.new_data("InspColor::Green"), used: 16 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if self == 2 { __local_7 = String { repr: array.new_data("InspColor::Blue"), used: 15 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -3448,19 +3448,19 @@ fn InspShape^Inspect::inspect(self, f) { let __local_13: ref String; if ref.test InspShape::Circle(self) { __local_3 = String { repr: array.new_data("InspShape::Circle("), used: 18 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); f64::inspect_into(ref.cast InspShape::Circle(self).payload_0, f); __local_7 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); } else if ref.test InspShape::Rectangle(self) { __local_9 = String { repr: array.new_data("InspShape::Rectangle("), used: 21 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); Tuple^Inspect::inspect(ref.cast InspShape::Rectangle(self).payload_0, f); __local_11 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_11); + String::push_str(f.buf, __local_11); } else if self.discriminant == 2 { __local_13 = String { repr: array.new_data("InspShape::InspPoint"), used: 20 }; - String::append(f.buf, __local_13); + String::push_str(f.buf, __local_13); }; } @@ -3473,27 +3473,27 @@ fn InspPerms^Inspect::inspect(self, f) { let __local_13: ref String; if self == 0 { __local_3 = String { repr: array.new_data("InspPerms::none()"), used: 17 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); }; if (self & 1) != 0 { __local_5 = String { repr: array.new_data("InspPerms::Read"), used: 15 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); }; if (self & 2) != 0 { if (self & 1) != 0 { __local_7 = String { repr: array.new_data(" | "), used: 3 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; __local_9 = String { repr: array.new_data("InspPerms::Write"), used: 16 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); }; if (self & 4) != 0 { if (self & 3) != 0 { __local_11 = String { repr: array.new_data(" | "), used: 3 }; - String::append(f.buf, __local_11); + String::push_str(f.buf, __local_11); }; __local_13 = String { repr: array.new_data("InspPerms::Execute"), used: 18 }; - String::append(f.buf, __local_13); + String::push_str(f.buf, __local_13); }; } @@ -3505,16 +3505,16 @@ fn Tuple^Inspect::inspect(self, f) { let s_14: ref String; let s_18: ref String; s_8 = String { repr: array.new_data("["), used: 1 }; - String::append(f.buf, s_8); + String::push_str(f.buf, s_8); __tuple_3 = self; v_5 = __tuple_3.0; f64::inspect_into(v_5, f); v_6 = __tuple_3.1; s_14 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_14); + String::push_str(f.buf, s_14); f64::inspect_into(v_6, f); s_18 = String { repr: array.new_data("]"), used: 1 }; - String::append(f.buf, s_18); + String::push_str(f.buf, s_18); } fn Formatter::write_char_n(self, c, n) { @@ -3528,7 +3528,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l256; }; @@ -3548,7 +3548,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3556,17 +3556,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3720,20 +3720,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3743,10 +3743,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3756,10 +3756,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3767,10 +3767,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3782,7 +3782,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3799,22 +3799,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b295; @@ -3822,7 +3822,7 @@ fn String^Inspect::inspect(self, f) { continue l296; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_primitives as "__test_0_primitives" diff --git a/wado-compiler/tests/fixtures.golden/inspect_2.wir.wado b/wado-compiler/tests/fixtures.golden/inspect_2.wir.wado index 2a96bf7fe..a01bbe908 100644 --- a/wado-compiler/tests/fixtures.golden/inspect_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/inspect_2.wir.wado @@ -52,6 +52,8 @@ struct InspLine { mut end: ref InspPoint, } +array array (mut ref String); + array array> (mut ref Array); array array (mut i32); @@ -60,8 +62,6 @@ array array> (mut ref "tuple/[i32, String]"); array array> (mut ref Array); -array array (mut ref String); - array array>> (mut ref Array>); array array (mut ref InspPoint); @@ -103,6 +103,11 @@ struct Array { // Array with T=i32 mut used: i32, } +struct Array { // Array with T=String + mut repr: ref array, + mut used: i32, +} + struct Array { // Array with T=InspPoint mut repr: ref array, mut used: i32, @@ -113,11 +118,6 @@ struct Array> { // Array with T=Option mut used: i32, } -struct Array { // Array with T=String - mut repr: ref array, - mut used: i32, -} - struct Array> { // Array with T=Tuple mut repr: ref array>, mut used: i32, @@ -247,13 +247,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/InspPoint^Inspect::inspect" = fn(ref InspPoint, ref Formatter); @@ -267,7 +267,7 @@ type "functype/Array>^Inspect::inspect" = fn(ref Array^Inspect::inspect" = fn(ref "tuple/[i32, String]", ref Formatter); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[i32, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[i32, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -275,23 +275,23 @@ type "functype/Array>^Inspect::inspect" = fn(ref Array^Inspect::inspect" = fn(ref Array, ref Formatter); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array>::append" = fn(ref Array>, ref Array); +type "functype/Array>::push" = fn(ref Array>, ref Array); type "functype/Array>::grow" = fn(ref Array>); type "functype/Array>>^Inspect::inspect" = fn(ref Array>>, ref Formatter); -type "functype/Array>>::append" = fn(ref Array>>, ref Array>); +type "functype/Array>>::push" = fn(ref Array>>, ref Array>); type "functype/Array>>::grow" = fn(ref Array>>); type "functype/Array>^Inspect::inspect" = fn(ref Array>, ref Formatter); -type "functype/Array>::append" = fn(ref Array>, ref Array); +type "functype/Array>::push" = fn(ref Array>, ref Array); type "functype/Array>::grow" = fn(ref Array>); @@ -299,17 +299,17 @@ type "functype/Array^Inspect::inspect" = fn(ref Array, ref type "functype/Array>^Inspect::inspect" = fn(ref Array>, ref Formatter); -type "functype/Array>::append" = fn(ref Array>, ref Option); +type "functype/Array>::push" = fn(ref Array>, ref Option); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, ref InspPoint); +type "functype/Array::push" = fn(ref Array, ref InspPoint); type "functype/Array::grow" = fn(ref Array); type "functype/Array^Inspect::inspect" = fn(ref Array, ref Formatter); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -383,17 +383,17 @@ fn __test_0_struct() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_0_struct"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_0_struct"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(47, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{p:?}` == \"InspPoint { x: 10, y: 20 }\" "), used: 52 }); break __tmpl: __local_6; @@ -410,17 +410,17 @@ condition: `{p:?}` == \"InspPoint { x: 10, y: 20 }\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_0_struct"), used: 15 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_0_struct"), used: 15 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(49, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{origin:?}` == \"InspPoint { x: 0, y: 0 }\" "), used: 55 }); break __tmpl: __local_10; @@ -449,17 +449,17 @@ fn __test_1_struct_option_field() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_1_struct_option_field"), used: 28 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_1_struct_option_field"), used: 28 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(54, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{w1:?}` == \"InspWrapper { value: Option::Some(42) }\" "), used: 66 }); break __tmpl: __local_6; @@ -475,17 +475,17 @@ condition: `{w1:?}` == \"InspWrapper { value: Option::Some(42) }\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_1_struct_option_field"), used: 28 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_1_struct_option_field"), used: 28 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(56, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{w2:?}` == \"InspWrapper { value: Option::None }\" "), used: 62 }); break __tmpl: __local_10; @@ -515,17 +515,17 @@ fn __test_2_generic_struct() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_2_generic_struct"), used: 23 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_2_generic_struct"), used: 23 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(61, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{b:?}` == \"InspBox { value: 42 }\" "), used: 47 }); break __tmpl: __local_6; @@ -542,17 +542,17 @@ condition: `{b:?}` == \"InspBox { value: 42 }\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_2_generic_struct"), used: 23 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_2_generic_struct"), used: 23 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(63, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{p:?}` == \"InspPair { first: \\\"hello\\\", second: \\\"world\\\" }\" "), used: 74 }); break __tmpl: __local_10; @@ -584,17 +584,17 @@ fn __test_3_hidden_fields() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_3_hidden_fields"), used: 22 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_3_hidden_fields"), used: 22 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(68, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{u:?}` == \"InspUser { name: \\\"Alice\\\", age: 30, .. }\" "), used: 67 }); break __tmpl: __local_6; @@ -605,23 +605,23 @@ condition: `{u:?}` == \"InspUser { name: \\\"Alice\\\", age: 30, .. }\" __local_8 = String { repr: builtin::array_new(16), used: 0 }; __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_26 = String { repr: array.new_data("InspAllHidden { .. }"), used: 20 }; - String::append(__local_9.buf, __local_26); + String::push_str(__local_9.buf, __local_26); break __tmpl: __local_8; }, String { repr: array.new_data("InspAllHidden { .. }"), used: 20 }); if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_3_hidden_fields"), used: 22 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_3_hidden_fields"), used: 22 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(70, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{h:?}` == \"InspAllHidden { .. }\" "), used: 46 }); break __tmpl: __local_10; @@ -682,17 +682,17 @@ fn __test_4_array() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_4_array"), used: 14 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_4_array"), used: 14 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(75, __local_17); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: `{arr:?}` == \"[1, 2, 3]\" "), used: 37 }); break __tmpl: __local_16; @@ -712,17 +712,17 @@ condition: `{arr:?}` == \"[1, 2, 3]\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_4_array"), used: 14 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_4_array"), used: 14 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(77, __local_21); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: `{empty:?}` == \"[]\" "), used: 32 }); break __tmpl: __local_20; @@ -742,17 +742,17 @@ condition: `{empty:?}` == \"[]\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("__test_4_array"), used: 14 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("__test_4_array"), used: 14 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i32::fmt_decimal(79, __local_25); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: `{single:?}` == \"[42]\" "), used: 35 }); break __tmpl: __local_24; @@ -768,17 +768,17 @@ condition: `{single:?}` == \"[42]\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("__test_4_array"), used: 14 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("__test_4_array"), used: 14 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; i32::fmt_decimal(82, __local_29); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: `{arr}` == \"[1, 2, 3]\" "), used: 35 }); break __tmpl: __local_28; @@ -794,17 +794,17 @@ condition: `{arr}` == \"[1, 2, 3]\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(103), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_32, String { repr: array.new_data("__test_4_array"), used: 14 }); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_32, String { repr: array.new_data("__test_4_array"), used: 14 }); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; i32::fmt_decimal(83, __local_33); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: `{empty}` == \"[]\" "), used: 30 }); break __tmpl: __local_32; @@ -824,17 +824,17 @@ condition: `{empty}` == \"[]\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_36, String { repr: array.new_data("__test_4_array"), used: 14 }); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_36, String { repr: array.new_data("__test_4_array"), used: 14 }); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; i32::fmt_decimal(86, __local_37); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: `{points}` == \"[InspPoint { x: 1, y: 2 }, InspPoint { x: 3, y: 4 }]\" "), used: 81 }); break __tmpl: __local_36; @@ -864,17 +864,17 @@ fn __test_5_array_option() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_5_array_option"), used: 21 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_5_array_option"), used: 21 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(91, __local_6); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: `{arr:?}` == \"[Option::Some(1), Option::None, Option::Some(3)]\" "), used: 76 }); break __tmpl: __local_5; @@ -907,17 +907,17 @@ fn __test_6_nested_struct() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(179), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_6_nested_struct"), used: 22 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_6_nested_struct"), used: 22 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(99, __local_8); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: `{line:?}` == \"InspLine { start: InspPoint { x: 0, y: 0 }, end: InspPoint { x: 10, y: 20 } }\" "), used: 106 }); break __tmpl: __local_7; @@ -937,17 +937,17 @@ condition: `{line:?}` == \"InspLine { start: InspPoint { x: 0, y: 0 }, end: Insp if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_6_nested_struct"), used: 22 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_6_nested_struct"), used: 22 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(102, __local_12); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: `{points:?}` == \"[InspPoint { x: 1, y: 2 }, InspPoint { x: 3, y: 4 }]\" "), used: 83 }); break __tmpl: __local_11; @@ -979,17 +979,17 @@ fn __test_7_option() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_7_option"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_7_option"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(107, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{some_val:?}` == \"Option::Some(42)\" "), used: 49 }); break __tmpl: __local_6; @@ -1006,17 +1006,17 @@ condition: `{some_val:?}` == \"Option::Some(42)\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_7_option"), used: 15 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_7_option"), used: 15 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(109, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{none_val:?}` == \"Option::None\" "), used: 45 }); break __tmpl: __local_10; @@ -1054,17 +1054,17 @@ fn __test_8_option_nested() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_8_option_nested"), used: 22 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_8_option_nested"), used: 22 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(114, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: `{some_some:?}` == \"Option::Some(Option::Some(42))\" "), used: 64 }); break __tmpl: __local_8; @@ -1081,17 +1081,17 @@ condition: `{some_some:?}` == \"Option::Some(Option::Some(42))\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_8_option_nested"), used: 22 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_8_option_nested"), used: 22 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(116, __local_13); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: `{some_none:?}` == \"Option::Some(Option::None)\" "), used: 60 }); break __tmpl: __local_12; @@ -1108,17 +1108,17 @@ condition: `{some_none:?}` == \"Option::Some(Option::None)\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_8_option_nested"), used: 22 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_8_option_nested"), used: 22 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(118, __local_17); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: `{none:?}` == \"Option::None\" "), used: 41 }); break __tmpl: __local_16; @@ -1144,17 +1144,17 @@ fn __test_9_option_deeply_nested() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_9_option_deeply_nested"), used: 29 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_9_option_deeply_nested"), used: 29 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(123, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: `{deep:?}` == \"Option::Some(Option::Some(Option::Some(7)))\" "), used: 72 }); break __tmpl: __local_4; @@ -1180,17 +1180,17 @@ fn __test_10_option_of_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_10_option_of_string"), used: 26 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_10_option_of_string"), used: 26 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(128, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: `{some_some:?}` == \"Option::Some(Option::Some(\\\"hello\\\"))\" "), used: 71 }); break __tmpl: __local_4; @@ -1249,17 +1249,17 @@ fn __test_11_nested_arrays() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_11_nested_arrays"), used: 23 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_11_nested_arrays"), used: 23 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(133, __local_21); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: `{matrix:?}` == \"[[1, 2], [3, 4]]\" "), used: 47 }); break __tmpl: __local_20; @@ -1294,17 +1294,17 @@ condition: `{matrix:?}` == \"[[1, 2], [3, 4]]\" if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("__test_11_nested_arrays"), used: 23 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("__test_11_nested_arrays"), used: 23 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i32::fmt_decimal(135, __local_25); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: `{deep:?}` == \"[[[1, 2], [3]], [[4, 5, 6]]]\" "), used: 57 }); break __tmpl: __local_24; @@ -1330,17 +1330,17 @@ condition: `{deep:?}` == \"[[[1, 2], [3]], [[4, 5, 6]]]\" if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("__test_11_nested_arrays"), used: 23 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("__test_11_nested_arrays"), used: 23 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; i32::fmt_decimal(137, __local_29); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: `{strs:?}` == \"[[\\\"a\\\", \\\"b\\\"], [\\\"c\\\"]]\" "), used: 54 }); break __tmpl: __local_28; @@ -1380,17 +1380,17 @@ fn __test_12_nested_array_struct() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_12_nested_array_struct"), used: 29 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_12_nested_array_struct"), used: 29 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(143, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: `{m:?}` == \"InspMatrix { data: [[1, 2], [3, 4]], rows: 2 }\" "), used: 72 }); break __tmpl: __local_8; @@ -1420,17 +1420,17 @@ fn __test_13_nested_array_tuple() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_13_nested_array_tuple"), used: 28 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_13_nested_array_tuple"), used: 28 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(148, __local_6); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: `{arr:?}` == \"[[1, \\\"one\\\"], [2, \\\"two\\\"]]\" "), used: 56 }); break __tmpl: __local_5; @@ -1462,17 +1462,17 @@ fn __test_14_option_of_struct() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_14_option_of_struct"), used: 26 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_14_option_of_struct"), used: 26 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(153, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{opt_p:?}` == \"Option::Some(InspPoint { x: 10, y: 20 })\" "), used: 70 }); break __tmpl: __local_6; @@ -1489,17 +1489,17 @@ condition: `{opt_p:?}` == \"Option::Some(InspPoint { x: 10, y: 20 })\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_14_option_of_struct"), used: 26 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_14_option_of_struct"), used: 26 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(155, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{none_p:?}` == \"Option::None\" "), used: 43 }); break __tmpl: __local_10; @@ -1531,17 +1531,17 @@ fn __test_15_fallback() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_15_fallback"), used: 18 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_15_fallback"), used: 18 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(160, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{p}` == \"InspPoint { x: 5, y: 10 }\" "), used: 49 }); break __tmpl: __local_6; @@ -1558,17 +1558,17 @@ condition: `{p}` == \"InspPoint { x: 5, y: 10 }\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_15_fallback"), used: 18 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_15_fallback"), used: 18 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_2.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(162, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{opt}` == \"Option::Some(InspPoint { x: 1, y: 2 })\" "), used: 64 }); break __tmpl: __local_10; @@ -1848,7 +1848,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1936,7 +1936,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1970,17 +1970,17 @@ fn InspPoint^Inspect::inspect(self, f) { let s_13: ref String; let s_19: ref String; s_3 = String { repr: array.new_data("InspPoint { "), used: 12 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("x: "), used: 3 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self.x, f); s_11 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); s_13 = String { repr: array.new_data("y: "), used: 3 }; - String::append(f.buf, s_13); + String::push_str(f.buf, s_13); i32::fmt_decimal(self.y, f); s_19 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); } fn InspLine^Inspect::inspect(self, f) { @@ -1990,17 +1990,17 @@ fn InspLine^Inspect::inspect(self, f) { let s_9: ref String; let s_11: ref String; s_3 = String { repr: array.new_data("InspLine { "), used: 11 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("start: "), used: 7 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); InspPoint^Inspect::inspect(self.start, f); s_7 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_7); + String::push_str(f.buf, s_7); s_9 = String { repr: array.new_data("end: "), used: 5 }; - String::append(f.buf, s_9); + String::push_str(f.buf, s_9); InspPoint^Inspect::inspect(self.end, f); s_11 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); } fn InspWrapper^Inspect::inspect(self, f) { @@ -2008,12 +2008,12 @@ fn InspWrapper^Inspect::inspect(self, f) { let s_5: ref String; let s_7: ref String; s_3 = String { repr: array.new_data("InspWrapper { "), used: 14 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("value: "), used: 7 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); Option^Inspect::inspect(self, f); s_7 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_7); + String::push_str(f.buf, s_7); } fn InspMatrix^Inspect::inspect(self, f) { @@ -2023,17 +2023,17 @@ fn InspMatrix^Inspect::inspect(self, f) { let s_9: ref String; let s_15: ref String; s_3 = String { repr: array.new_data("InspMatrix { "), used: 13 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("data: "), used: 6 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); Array>^Inspect::inspect(self.data, f); s_7 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_7); + String::push_str(f.buf, s_7); s_9 = String { repr: array.new_data("rows: "), used: 6 }; - String::append(f.buf, s_9); + String::push_str(f.buf, s_9); i32::fmt_decimal(self.rows, f); s_15 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_15); + String::push_str(f.buf, s_15); } fn InspUser^Inspect::inspect(self, f) { @@ -2044,19 +2044,19 @@ fn InspUser^Inspect::inspect(self, f) { let s_15: ref String; let s_17: ref String; s_3 = String { repr: array.new_data("InspUser { "), used: 11 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("name: "), used: 6 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); String^Inspect::inspect(self.name, f); s_7 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_7); + String::push_str(f.buf, s_7); s_9 = String { repr: array.new_data("age: "), used: 5 }; - String::append(f.buf, s_9); + String::push_str(f.buf, s_9); i32::fmt_decimal(self.age, f); s_15 = String { repr: array.new_data(", .."), used: 4 }; - String::append(f.buf, s_15); + String::push_str(f.buf, s_15); s_17 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_17); + String::push_str(f.buf, s_17); } fn Option^Inspect::inspect(self, f) { @@ -2065,13 +2065,13 @@ fn Option^Inspect::inspect(self, f) { let __local_7: ref String; if ref.is_null(self) == 0 { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); InspPoint^Inspect::inspect(ref.as_non_null(self), f); __local_5 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if ref.is_null(self) { __local_7 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -2081,7 +2081,7 @@ fn Array>^Inspect::inspect(self, f) { let __local_9: i32; let _licm_used_12: i32; let _licm_repr_13: ref array>; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_12 = self.used; @@ -2093,7 +2093,7 @@ fn Array>^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; Tuple^Inspect::inspect(__inline_Array_Tuple_i32_String___IndexValue__index_value_3: block -> ref "tuple/[i32, String]" { __local_9 = i; @@ -2104,7 +2104,7 @@ fn Array>^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } fn Tuple^Inspect::inspect(self, f) { @@ -2115,19 +2115,19 @@ fn Tuple^Inspect::inspect(self, f) { let s_16: ref String; let s_18: ref String; s_8 = String { repr: array.new_data("["), used: 1 }; - String::append(f.buf, s_8); + String::push_str(f.buf, s_8); __tuple_3 = self; v_5 = __tuple_3.0; i32::fmt_decimal(v_5, f); v_6 = __tuple_3.1; s_16 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_16); + String::push_str(f.buf, s_16); String^Inspect::inspect(v_6, f); s_18 = String { repr: array.new_data("]"), used: 1 }; - String::append(f.buf, s_18); + String::push_str(f.buf, s_18); } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2175,7 +2175,7 @@ fn Array>^Inspect::inspect(self, f) { let __local_9: i32; let _licm_used_12: i32; let _licm_repr_13: ref array>; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_12 = self.used; @@ -2187,7 +2187,7 @@ fn Array>^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; Array^Inspect::inspect(__inline_Array_Array_String___IndexValue__index_value_3: block -> ref Array { __local_9 = i; @@ -2198,7 +2198,7 @@ fn Array>^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } fn Array^Inspect::inspect(self, f) { @@ -2207,7 +2207,7 @@ fn Array^Inspect::inspect(self, f) { let __local_9: i32; let _licm_used_12: i32; let _licm_repr_13: ref array; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_12 = self.used; @@ -2219,7 +2219,7 @@ fn Array^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; String^Inspect::inspect(__inline_Array_String__IndexValue__index_value_3: block -> ref String { __local_9 = i; @@ -2230,10 +2230,10 @@ fn Array^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2275,7 +2275,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2323,7 +2323,7 @@ fn Array>>^Inspect::inspect(self, f) { let __local_9: i32; let _licm_used_12: i32; let _licm_repr_13: ref array>>; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_12 = self.used; @@ -2335,7 +2335,7 @@ fn Array>>^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; Array>^Inspect::inspect(__inline_Array_Array_Array_i32____IndexValue__index_value_3: block -> ref Array> { __local_9 = i; @@ -2346,10 +2346,10 @@ fn Array>>^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } -fn Array>>::append(self, value) { +fn Array>>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2397,7 +2397,7 @@ fn Array>^Inspect::inspect(self, f) { let __local_9: i32; let _licm_used_12: i32; let _licm_repr_13: ref array>; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_12 = self.used; @@ -2409,7 +2409,7 @@ fn Array>^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; Array^Inspect::inspect(__inline_Array_Array_i32___IndexValue__index_value_3: block -> ref Array { __local_9 = i; @@ -2420,10 +2420,10 @@ fn Array>^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2471,13 +2471,13 @@ fn Option>^Inspect::inspect(self, f) { let __local_7: ref String; if ref.test Option>::Some(self) { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); Option^Inspect::inspect(ref.cast Option>::Some(self).payload_0, f); __local_5 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if self.discriminant == 1 { __local_7 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -2487,13 +2487,13 @@ fn Option^Inspect::inspect(self, f) { let __local_7: ref String; if ref.is_null(self) == 0 { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); String^Inspect::inspect(ref.as_non_null(self), f); __local_5 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if ref.is_null(self) { __local_7 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -2503,13 +2503,13 @@ fn Option>>^Inspect::inspect(self, f) { let __local_7: ref String; if ref.test Option>>::Some(self) { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); Option>^Inspect::inspect(ref.cast Option>>::Some(self).payload_0, f); __local_5 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if self.discriminant == 1 { __local_7 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -2519,13 +2519,13 @@ fn Option>^Inspect::inspect(self, f) { let __local_7: ref String; if ref.is_null(self) == 0 { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); Option^Inspect::inspect(ref.as_non_null(self), f); __local_5 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if ref.is_null(self) { __local_7 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -2535,13 +2535,13 @@ fn Option^Inspect::inspect(self, f) { let __local_11: ref String; if ref.test Option::Some(self) { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); i32::fmt_decimal(ref.cast Option::Some(self).payload_0, f); __local_9 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); } else if self.discriminant == 1 { __local_11 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_11); + String::push_str(f.buf, __local_11); }; } @@ -2551,7 +2551,7 @@ fn Array^Inspect::inspect(self, f) { let __local_9: i32; let _licm_used_12: i32; let _licm_repr_13: ref array; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_12 = self.used; @@ -2563,7 +2563,7 @@ fn Array^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; InspPoint^Inspect::inspect(__inline_Array_InspPoint__IndexValue__index_value_3: block -> ref InspPoint { __local_9 = i; @@ -2574,7 +2574,7 @@ fn Array^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } fn Array>^Inspect::inspect(self, f) { @@ -2583,7 +2583,7 @@ fn Array>^Inspect::inspect(self, f) { let __local_9: i32; let _licm_used_12: i32; let _licm_repr_13: ref array>; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_12 = self.used; @@ -2595,7 +2595,7 @@ fn Array>^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; Option^Inspect::inspect(ref.as_non_null(__inline_Array_Option_i32___IndexValue__index_value_3: block -> ref Option { __local_9 = i; @@ -2606,10 +2606,10 @@ fn Array>^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2651,7 +2651,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2699,7 +2699,7 @@ fn Array^Inspect::inspect(self, f) { let __local_11: i32; let _licm_used_16: i32; let _licm_repr_17: ref array; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_16 = self.used; @@ -2711,7 +2711,7 @@ fn Array^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_4: block -> i32 { __local_11 = i; @@ -2722,10 +2722,10 @@ fn Array^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2774,17 +2774,17 @@ fn InspPair^Inspect::inspect(self, f) { let s_9: ref String; let s_11: ref String; s_3 = String { repr: array.new_data("InspPair { "), used: 11 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("first: "), used: 7 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); String^Inspect::inspect(self.first, f); s_7 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_7); + String::push_str(f.buf, s_7); s_9 = String { repr: array.new_data("second: "), used: 8 }; - String::append(f.buf, s_9); + String::push_str(f.buf, s_9); String^Inspect::inspect(self.second, f); s_11 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); } fn InspBox^Inspect::inspect(self, f) { @@ -2792,12 +2792,12 @@ fn InspBox^Inspect::inspect(self, f) { let s_5: ref String; let s_11: ref String; s_3 = String { repr: array.new_data("InspBox { "), used: 10 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("value: "), used: 7 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self, f); s_11 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); } fn Formatter::write_char_n(self, c, n) { @@ -2811,7 +2811,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l141; }; @@ -2845,20 +2845,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2868,10 +2868,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2881,10 +2881,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2892,10 +2892,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -2907,7 +2907,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -2924,22 +2924,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b160; @@ -2947,7 +2947,7 @@ fn String^Inspect::inspect(self, f) { continue l161; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_struct as "__test_0_struct" diff --git a/wado-compiler/tests/fixtures.golden/inspect_3.wir.wado b/wado-compiler/tests/fixtures.golden/inspect_3.wir.wado index 00181bb42..349ee0016 100644 --- a/wado-compiler/tests/fixtures.golden/inspect_3.wir.wado +++ b/wado-compiler/tests/fixtures.golden/inspect_3.wir.wado @@ -147,7 +147,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -157,13 +157,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/NDColor^Inspect::inspect" = fn(enum:NDColor, ref Formatter); @@ -177,11 +177,11 @@ type "functype/Array^Inspect::inspect" = fn(ref Array, type "functype/Array^InspectAlt::inspect_alt" = fn(ref Array, ref Formatter); -type "functype/Array::append" = fn(ref Array, ref PrettyPoint); +type "functype/Array::push" = fn(ref Array, ref PrettyPoint); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -291,17 +291,17 @@ fn __test_0_pretty_array() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_0_pretty_array"), used: 21 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_0_pretty_array"), used: 21 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(13, __local_12); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: `{empty:#?}` == \"[]\" "), used: 33 }); break __tmpl: __local_11; @@ -325,17 +325,17 @@ condition: `{empty:#?}` == \"[]\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_0_pretty_array"), used: 21 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_0_pretty_array"), used: 21 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(16, __local_16); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: `{nums:#?}` == \"[\\n 1,\\n 2,\\n 3,\\n]\" "), used: 52 }); break __tmpl: __local_15; @@ -364,17 +364,17 @@ condition: `{nums:#?}` == \"[\\n 1,\\n 2,\\n 3,\\n]\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(199), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_0_pretty_array"), used: 21 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_0_pretty_array"), used: 21 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; i32::fmt_decimal(22, __local_20); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: `{points:#?}` == \"[\\n PrettyPoint {\\n x: 1,\\n y: 2,\\n },\\n PrettyPoint {\\n x: 3,\\n y: 4,\\n },\\n]\" "), used: 126 }); break __tmpl: __local_19; @@ -416,17 +416,17 @@ fn __test_1_pretty_struct() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_1_pretty_struct"), used: 22 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_1_pretty_struct"), used: 22 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(27, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{p:#?}` == \"PrettyPoint {\\n x: 1,\\n y: 2,\\n}\" "), used: 61 }); break __tmpl: __local_6; @@ -452,17 +452,17 @@ condition: `{p:#?}` == \"PrettyPoint {\\n x: 1,\\n y: 2,\\n}\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(224), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_1_pretty_struct"), used: 22 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_1_pretty_struct"), used: 22 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(33, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: `{line:#?}` == \"PrettyLine {\\n start: PrettyPoint {\\n x: 10,\\n y: 20,\\n },\\n end: PrettyPoint {\\n x: 30,\\n y: 40,\\n },\\n}\" "), used: 151 }); break __tmpl: __local_10; @@ -509,17 +509,17 @@ fn __test_2_pretty_variant() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_2_pretty_variant"), used: 23 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_2_pretty_variant"), used: 23 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(38, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: `{some_val:#?}` == \"Option::Some(\\n 42,\\n)\" "), used: 57 }); break __tmpl: __local_8; @@ -536,17 +536,17 @@ condition: `{some_val:#?}` == \"Option::Some(\\n 42,\\n)\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_2_pretty_variant"), used: 23 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_2_pretty_variant"), used: 23 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(40, __local_13); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: `{none_val:#?}` == \"Option::None\" "), used: 46 }); break __tmpl: __local_12; @@ -568,17 +568,17 @@ condition: `{none_val:#?}` == \"Option::None\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(166), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_2_pretty_variant"), used: 23 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_2_pretty_variant"), used: 23 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(43, __local_17); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: `{nested:#?}` == \"Option::Some(\\n PrettyPoint {\\n x: 1,\\n y: 2,\\n },\\n)\" "), used: 93 }); break __tmpl: __local_16; @@ -659,17 +659,17 @@ fn __test_3_no_display() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_3_no_display"), used: 19 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_3_no_display"), used: 19 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; i32::fmt_decimal(65, __local_22); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: `{p:?}` == \"PrettyPoint { x: 1, y: 2 }\" "), used: 52 }); break __tmpl: __local_21; @@ -686,17 +686,17 @@ condition: `{p:?}` == \"PrettyPoint { x: 1, y: 2 }\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("__test_3_no_display"), used: 19 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("__test_3_no_display"), used: 19 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; i32::fmt_decimal(67, __local_26); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: `{c:?}` == \"NDColor::Red\" "), used: 38 }); break __tmpl: __local_25; @@ -713,17 +713,17 @@ condition: `{c:?}` == \"NDColor::Red\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_29, String { repr: array.new_data("__test_3_no_display"), used: 19 }); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_29, String { repr: array.new_data("__test_3_no_display"), used: 19 }); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; i32::fmt_decimal(69, __local_30); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: `{s:?}` == \"NDShape::Circle(3.14)\" "), used: 47 }); break __tmpl: __local_29; @@ -739,17 +739,17 @@ condition: `{s:?}` == \"NDShape::Circle(3.14)\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_33, String { repr: array.new_data("__test_3_no_display"), used: 19 }); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_33, String { repr: array.new_data("__test_3_no_display"), used: 19 }); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; i32::fmt_decimal(71, __local_34); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: `{m:?}` == \"NDMode::Read | NDMode::Write\" "), used: 54 }); break __tmpl: __local_33; @@ -766,17 +766,17 @@ condition: `{m:?}` == \"NDMode::Read | NDMode::Write\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_37 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_37, String { repr: array.new_data("__test_3_no_display"), used: 19 }); - String::append_char(__local_37, 32); - String::append_char(__local_37, 97); - String::append_char(__local_37, 116); - String::append_char(__local_37, 32); - String::append(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_37, 58); + String::push_str(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_37, String { repr: array.new_data("__test_3_no_display"), used: 19 }); + String::push(__local_37, 32); + String::push(__local_37, 97); + String::push(__local_37, 116); + String::push(__local_37, 32); + String::push_str(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_37, 58); __local_38 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_37 }; i32::fmt_decimal(73, __local_38); - String::append(__local_37, String { repr: array.new_data(" + String::push_str(__local_37, String { repr: array.new_data(" condition: `{opt:?}` == \"Option::Some(42)\" "), used: 44 }); break __tmpl: __local_37; @@ -793,17 +793,17 @@ condition: `{opt:?}` == \"Option::Some(42)\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_41 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_41, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_41, String { repr: array.new_data("__test_3_no_display"), used: 19 }); - String::append_char(__local_41, 32); - String::append_char(__local_41, 97); - String::append_char(__local_41, 116); - String::append_char(__local_41, 32); - String::append(__local_41, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_41, 58); + String::push_str(__local_41, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_41, String { repr: array.new_data("__test_3_no_display"), used: 19 }); + String::push(__local_41, 32); + String::push(__local_41, 97); + String::push(__local_41, 116); + String::push(__local_41, 32); + String::push_str(__local_41, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_41, 58); __local_42 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_41 }; i32::fmt_decimal(75, __local_42); - String::append(__local_41, String { repr: array.new_data(" + String::push_str(__local_41, String { repr: array.new_data(" condition: `{none:?}` == \"Option::None\" "), used: 41 }); break __tmpl: __local_41; @@ -820,17 +820,17 @@ condition: `{none:?}` == \"Option::None\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_45 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_45, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_45, String { repr: array.new_data("__test_3_no_display"), used: 19 }); - String::append_char(__local_45, 32); - String::append_char(__local_45, 97); - String::append_char(__local_45, 116); - String::append_char(__local_45, 32); - String::append(__local_45, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_45, 58); + String::push_str(__local_45, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_45, String { repr: array.new_data("__test_3_no_display"), used: 19 }); + String::push(__local_45, 32); + String::push(__local_45, 97); + String::push(__local_45, 116); + String::push(__local_45, 32); + String::push_str(__local_45, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_45, 58); __local_46 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_45 }; i32::fmt_decimal(77, __local_46); - String::append(__local_45, String { repr: array.new_data(" + String::push_str(__local_45, String { repr: array.new_data(" condition: `{opt_p:?}` == \"Option::Some(PrettyPoint { x: 10, y: 20 })\" "), used: 72 }); break __tmpl: __local_45; @@ -850,17 +850,17 @@ condition: `{opt_p:?}` == \"Option::Some(PrettyPoint { x: 10, y: 20 })\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_49 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_49, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_49, String { repr: array.new_data("__test_3_no_display"), used: 19 }); - String::append_char(__local_49, 32); - String::append_char(__local_49, 97); - String::append_char(__local_49, 116); - String::append_char(__local_49, 32); - String::append(__local_49, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_49, 58); + String::push_str(__local_49, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_49, String { repr: array.new_data("__test_3_no_display"), used: 19 }); + String::push(__local_49, 32); + String::push(__local_49, 97); + String::push(__local_49, 116); + String::push(__local_49, 32); + String::push_str(__local_49, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_49, 58); __local_50 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_49 }; i32::fmt_decimal(79, __local_50); - String::append(__local_49, String { repr: array.new_data(" + String::push_str(__local_49, String { repr: array.new_data(" condition: `{arr:?}` == \"[PrettyPoint { x: 1, y: 2 }, PrettyPoint { x: 3, y: 4 }]\" "), used: 84 }); break __tmpl: __local_49; @@ -871,23 +871,23 @@ condition: `{arr:?}` == \"[PrettyPoint { x: 1, y: 2 }, PrettyPoint { x: 3, y: 4 __local_51 = String { repr: builtin::array_new(16), used: 0 }; __local_52 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_51 }; __local_129 = String { repr: array.new_data("|i32| -> i32"), used: 12 }; - String::append(__local_52.buf, __local_129); + String::push_str(__local_52.buf, __local_129); break __tmpl: __local_51; }, String { repr: array.new_data("|i32| -> i32"), used: 12 }); if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_53 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_53, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_53, String { repr: array.new_data("__test_3_no_display"), used: 19 }); - String::append_char(__local_53, 32); - String::append_char(__local_53, 97); - String::append_char(__local_53, 116); - String::append_char(__local_53, 32); - String::append(__local_53, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); - String::append_char(__local_53, 58); + String::push_str(__local_53, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_53, String { repr: array.new_data("__test_3_no_display"), used: 19 }); + String::push(__local_53, 32); + String::push(__local_53, 97); + String::push(__local_53, 116); + String::push(__local_53, 32); + String::push_str(__local_53, String { repr: array.new_data("wado-compiler/tests/fixtures/inspect_3.wado"), used: 43 }); + String::push(__local_53, 58); __local_54 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_53 }; i32::fmt_decimal(81, __local_54); - String::append(__local_53, String { repr: array.new_data(" + String::push_str(__local_53, String { repr: array.new_data(" condition: `{f:?}` == \"|i32| -> i32\" "), used: 38 }); break __tmpl: __local_53; @@ -1636,8 +1636,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1692,13 +1692,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1706,25 +1706,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1732,7 +1732,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1774,8 +1774,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1807,7 +1807,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1936,27 +1936,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2079,9 +2079,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2091,8 +2091,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2147,13 +2147,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2188,9 +2188,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2243,7 +2243,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2287,7 +2287,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2320,13 +2320,13 @@ fn NDColor^Inspect::inspect(self, f) { let __local_7: ref String; if self == 0 { __local_3 = String { repr: array.new_data("NDColor::Red"), used: 12 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); } else if self == 1 { __local_5 = String { repr: array.new_data("NDColor::Green"), used: 14 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if self == 2 { __local_7 = String { repr: array.new_data("NDColor::Blue"), used: 13 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -2337,17 +2337,17 @@ fn PrettyPoint^Inspect::inspect(self, f) { let s_13: ref String; let s_19: ref String; s_3 = String { repr: array.new_data("PrettyPoint { "), used: 14 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("x: "), used: 3 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self.x, f); s_11 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); s_13 = String { repr: array.new_data("y: "), used: 3 }; - String::append(f.buf, s_13); + String::push_str(f.buf, s_13); i32::fmt_decimal(self.y, f); s_19 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); } fn NDShape^Inspect::inspect(self, f) { @@ -2356,13 +2356,13 @@ fn NDShape^Inspect::inspect(self, f) { let __local_9: ref String; if ref.test NDShape::Circle(self) { __local_3 = String { repr: array.new_data("NDShape::Circle("), used: 16 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); f64::inspect_into(ref.cast NDShape::Circle(self).payload_0, f); __local_7 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); } else if self.discriminant == 1 { __local_9 = String { repr: array.new_data("NDShape::NDPoint"), used: 16 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); }; } @@ -2373,19 +2373,19 @@ fn NDMode^Inspect::inspect(self, f) { let __local_9: ref String; if self == 0 { __local_3 = String { repr: array.new_data("NDMode::none()"), used: 14 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); }; if (self & 1) != 0 { __local_5 = String { repr: array.new_data("NDMode::Read"), used: 12 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); }; if (self & 2) != 0 { if (self & 1) != 0 { __local_7 = String { repr: array.new_data(" | "), used: 3 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; __local_9 = String { repr: array.new_data("NDMode::Write"), used: 13 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); }; } @@ -2397,27 +2397,27 @@ fn PrettyPoint^InspectAlt::inspect_alt(self, f) { let s_31: ref String; let close: ref String; open = String { repr: array.new_data("PrettyPoint {"), used: 13 }; - String::append(f.buf, open); + String::push_str(f.buf, open); f.indent = f.indent + 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); s_10 = String { repr: array.new_data("x: "), used: 3 }; - String::append(f.buf, s_10); + String::push_str(f.buf, s_10); i32::fmt_decimal(self.x, f); s_18 = String { repr: array.new_data(","), used: 1 }; - String::append(f.buf, s_18); - String::append_char(f.buf, 10); + String::push_str(f.buf, s_18); + String::push(f.buf, 10); Formatter::write_indent(f); s_23 = String { repr: array.new_data("y: "), used: 3 }; - String::append(f.buf, s_23); + String::push_str(f.buf, s_23); i32::fmt_decimal(self.y, f); s_31 = String { repr: array.new_data(","), used: 1 }; - String::append(f.buf, s_31); + String::push_str(f.buf, s_31); close = String { repr: array.new_data("}"), used: 1 }; f.indent = f.indent - 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); - String::append(f.buf, close); + String::push_str(f.buf, close); } fn PrettyLine^InspectAlt::inspect_alt(self, f) { @@ -2428,27 +2428,27 @@ fn PrettyLine^InspectAlt::inspect_alt(self, f) { let s_19: ref String; let close: ref String; open = String { repr: array.new_data("PrettyLine {"), used: 12 }; - String::append(f.buf, open); + String::push_str(f.buf, open); f.indent = f.indent + 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); s_10 = String { repr: array.new_data("start: "), used: 7 }; - String::append(f.buf, s_10); + String::push_str(f.buf, s_10); PrettyPoint^InspectAlt::inspect_alt(self.start, f); s_12 = String { repr: array.new_data(","), used: 1 }; - String::append(f.buf, s_12); - String::append_char(f.buf, 10); + String::push_str(f.buf, s_12); + String::push(f.buf, 10); Formatter::write_indent(f); s_17 = String { repr: array.new_data("end: "), used: 5 }; - String::append(f.buf, s_17); + String::push_str(f.buf, s_17); PrettyPoint^InspectAlt::inspect_alt(self.end, f); s_19 = String { repr: array.new_data(","), used: 1 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); close = String { repr: array.new_data("}"), used: 1 }; f.indent = f.indent - 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); - String::append(f.buf, close); + String::push_str(f.buf, close); } fn Array^Inspect::inspect(self, f) { @@ -2457,7 +2457,7 @@ fn Array^Inspect::inspect(self, f) { let __local_9: i32; let _licm_used_12: i32; let _licm_repr_13: ref array; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_12 = self.used; @@ -2469,7 +2469,7 @@ fn Array^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; PrettyPoint^Inspect::inspect(__inline_Array_PrettyPoint__IndexValue__index_value_3: block -> ref PrettyPoint { __local_9 = i; @@ -2480,7 +2480,7 @@ fn Array^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } fn Option^Inspect::inspect(self, f) { @@ -2489,13 +2489,13 @@ fn Option^Inspect::inspect(self, f) { let __local_7: ref String; if ref.is_null(self) == 0 { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); PrettyPoint^Inspect::inspect(ref.as_non_null(self), f); __local_5 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if ref.is_null(self) { __local_7 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -2505,13 +2505,13 @@ fn Option^Inspect::inspect(self, f) { let __local_11: ref String; if ref.test Option::Some(self) { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); i32::fmt_decimal(ref.cast Option::Some(self).payload_0, f); __local_9 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); } else if self.discriminant == 1 { __local_11 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_11); + String::push_str(f.buf, __local_11); }; } @@ -2522,21 +2522,21 @@ fn Option^InspectAlt::inspect_alt(self, f) { let __local_19: ref String; if ref.is_null(self) == 0 { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); f.indent = f.indent + 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); PrettyPoint^InspectAlt::inspect_alt(ref.as_non_null(self), f); __local_10 = String { repr: array.new_data(","), used: 1 }; - String::append(f.buf, __local_10); + String::push_str(f.buf, __local_10); __local_12 = String { repr: array.new_data(")"), used: 1 }; f.indent = f.indent - 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); - String::append(f.buf, __local_12); + String::push_str(f.buf, __local_12); } else if ref.is_null(self) { __local_19 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_19); + String::push_str(f.buf, __local_19); }; } @@ -2547,21 +2547,21 @@ fn Option^InspectAlt::inspect_alt(self, f) { let __local_25: ref String; if ref.test Option::Some(self) { __local_3 = String { repr: array.new_data("Option::Some("), used: 13 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); f.indent = f.indent + 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); i32::fmt_decimal(ref.cast Option::Some(self).payload_0, f); __local_16 = String { repr: array.new_data(","), used: 1 }; - String::append(f.buf, __local_16); + String::push_str(f.buf, __local_16); __local_18 = String { repr: array.new_data(")"), used: 1 }; f.indent = f.indent - 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); - String::append(f.buf, __local_18); + String::push_str(f.buf, __local_18); } else if self.discriminant == 1 { __local_25 = String { repr: array.new_data("Option::None"), used: 12 }; - String::append(f.buf, __local_25); + String::push_str(f.buf, __local_25); }; } @@ -2575,11 +2575,11 @@ fn Array^InspectAlt::inspect_alt(self, f) { let _licm_repr_26: ref array; if self.used == 0 { s = String { repr: array.new_data("[]"), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); return; }; open = String { repr: array.new_data("["), used: 1 }; - String::append(f.buf, open); + String::push_str(f.buf, open); f.indent = f.indent + 1; __for_6: block { i = 0; @@ -2590,13 +2590,13 @@ fn Array^InspectAlt::inspect_alt(self, f) { if (i < _licm_used_25) == 0 { break __for_6; }; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); PrettyPoint^InspectAlt::inspect_alt(__inline_Array_PrettyPoint__IndexValue__index_value_7: block -> ref PrettyPoint { __local_15 = i; break __inline_Array_PrettyPoint__IndexValue__index_value_7: builtin::array_get(_licm_repr_26, __local_15); }, f); - String::append_char(f.buf, 44); + String::push(f.buf, 44); i = i + 1; continue l208; }; @@ -2604,12 +2604,12 @@ fn Array^InspectAlt::inspect_alt(self, f) { }; close = String { repr: array.new_data("]"), used: 1 }; f.indent = f.indent - 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); - String::append(f.buf, close); + String::push_str(f.buf, close); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2651,7 +2651,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2703,11 +2703,11 @@ fn Array^InspectAlt::inspect_alt(self, f) { let _licm_repr_32: ref array; if self.used == 0 { s = String { repr: array.new_data("[]"), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); return; }; open = String { repr: array.new_data("["), used: 1 }; - String::append(f.buf, open); + String::push_str(f.buf, open); f.indent = f.indent + 1; __for_6: block { i = 0; @@ -2718,13 +2718,13 @@ fn Array^InspectAlt::inspect_alt(self, f) { if (i < _licm_used_31) == 0 { break __for_6; }; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_8: block -> i32 { __local_17 = i; break __inline_Array_i32__IndexValue__index_value_8: builtin::array_get(_licm_repr_32, __local_17); }, f); - String::append_char(f.buf, 44); + String::push(f.buf, 44); i = i + 1; continue l220; }; @@ -2732,9 +2732,9 @@ fn Array^InspectAlt::inspect_alt(self, f) { }; close = String { repr: array.new_data("]"), used: 1 }; f.indent = f.indent - 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); - String::append(f.buf, close); + String::push_str(f.buf, close); } fn Formatter::write_char_n(self, c, n) { @@ -2748,7 +2748,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l223; }; @@ -2906,20 +2906,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2929,10 +2929,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2942,10 +2942,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2953,10 +2953,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -2977,7 +2977,7 @@ fn Formatter::write_indent(self) { break __for_4; }; s = String { repr: array.new_data(" "), used: 2 }; - String::append(_licm_buf_5, s); + String::push_str(_licm_buf_5, s); i = i + 1; continue l259; }; diff --git a/wado-compiler/tests/fixtures.golden/int128_coercion.wir.wado b/wado-compiler/tests/fixtures.golden/int128_coercion.wir.wado index 0970fda77..d6d1674e7 100644 --- a/wado-compiler/tests/fixtures.golden/int128_coercion.wir.wado +++ b/wado-compiler/tests/fixtures.golden/int128_coercion.wir.wado @@ -105,9 +105,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -164,7 +164,7 @@ fn run() with Stdout { a = u128 { low: 100_i64, high: 0_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_10, String { repr: array.new_data("u128 literal coercion: "), used: 23 }); + String::push_str(__local_10, String { repr: array.new_data("u128 literal coercion: "), used: 23 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; u128::fmt_decimal(a, __local_11); break __tmpl: __local_10; @@ -172,7 +172,7 @@ fn run() with Stdout { b = i128 { low: 42_i64, high: 0_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("i128 literal coercion: "), used: 23 }); + String::push_str(__local_12, String { repr: array.new_data("i128 literal coercion: "), used: 23 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i128::fmt_decimal(b, __local_13); break __tmpl: __local_12; @@ -180,7 +180,7 @@ fn run() with Stdout { c = i128 { low: -100_i64, high: -1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(48), used: 0 }; - String::append(__local_14, String { repr: array.new_data("i128 negative literal coercion: "), used: 32 }); + String::push_str(__local_14, String { repr: array.new_data("i128 negative literal coercion: "), used: 32 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i128::fmt_decimal(c, __local_15); break __tmpl: __local_14; @@ -188,7 +188,7 @@ fn run() with Stdout { d = u128 { low: 200_i64, high: 0_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_16, String { repr: array.new_data("u128 cast: "), used: 11 }); + String::push_str(__local_16, String { repr: array.new_data("u128 cast: "), used: 11 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; u128::fmt_decimal(d, __local_17); break __tmpl: __local_16; @@ -196,7 +196,7 @@ fn run() with Stdout { e = i128 { low: 300_i64, high: 0_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_18, String { repr: array.new_data("i128 cast: "), used: 11 }); + String::push_str(__local_18, String { repr: array.new_data("i128 cast: "), used: 11 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i128::fmt_decimal(e, __local_19); break __tmpl: __local_18; @@ -204,7 +204,7 @@ fn run() with Stdout { g = u128 { low: 500_i64, high: 0_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(40), used: 0 }; - String::append(__local_20, String { repr: array.new_data("u128 from i64 variable: "), used: 24 }); + String::push_str(__local_20, String { repr: array.new_data("u128 from i64 variable: "), used: 24 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; u128::fmt_decimal(g, __local_21); break __tmpl: __local_20; @@ -212,7 +212,7 @@ fn run() with Stdout { h = i128 { low: 500_i64, high: 0_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(40), used: 0 }; - String::append(__local_22, String { repr: array.new_data("i128 from i64 variable: "), used: 24 }); + String::push_str(__local_22, String { repr: array.new_data("i128 from i64 variable: "), used: 24 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i128::fmt_decimal(h, __local_23); break __tmpl: __local_22; @@ -221,7 +221,7 @@ fn run() with Stdout { sum2 = u128^Add::add(sum, u128 { low: 5_i64, high: 0_i64 }); "core:cli/println"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_24, String { repr: array.new_data("u128 arithmetic: "), used: 17 }); + String::push_str(__local_24, String { repr: array.new_data("u128 arithmetic: "), used: 17 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; u128::fmt_decimal(sum2, __local_25); break __tmpl: __local_24; @@ -723,7 +723,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -738,7 +738,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -776,7 +776,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l51; }; @@ -810,20 +810,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -833,10 +833,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -846,10 +846,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -857,10 +857,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/int128_large_literal.wir.wado b/wado-compiler/tests/fixtures.golden/int128_large_literal.wir.wado index 3fe3673c5..56998efc5 100644 --- a/wado-compiler/tests/fixtures.golden/int128_large_literal.wir.wado +++ b/wado-compiler/tests/fixtures.golden/int128_large_literal.wir.wado @@ -103,9 +103,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -173,7 +173,7 @@ fn run() with Stdout { large_u128 = u128 { low: 0_i64, high: 1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_12, String { repr: array.new_data("large_u128 = "), used: 13 }); + String::push_str(__local_12, String { repr: array.new_data("large_u128 = "), used: 13 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; u128::fmt_decimal(large_u128, __local_13); break __tmpl: __local_12; @@ -181,7 +181,7 @@ fn run() with Stdout { max_u128 = u128 { low: -1_i64, high: -1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_14, String { repr: array.new_data("max_u128 = "), used: 11 }); + String::push_str(__local_14, String { repr: array.new_data("max_u128 = "), used: 11 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; u128::fmt_decimal(max_u128, __local_15); break __tmpl: __local_14; @@ -189,7 +189,7 @@ fn run() with Stdout { large_i128 = i128 { low: -9223372036854775808_i64, high: 0_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_16, String { repr: array.new_data("large_i128 = "), used: 13 }); + String::push_str(__local_16, String { repr: array.new_data("large_i128 = "), used: 13 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i128::fmt_decimal(large_i128, __local_17); break __tmpl: __local_16; @@ -197,7 +197,7 @@ fn run() with Stdout { max_i128 = i128 { low: -1_i64, high: 9223372036854775807_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_18, String { repr: array.new_data("max_i128 = "), used: 11 }); + String::push_str(__local_18, String { repr: array.new_data("max_i128 = "), used: 11 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i128::fmt_decimal(max_i128, __local_19); break __tmpl: __local_18; @@ -205,7 +205,7 @@ fn run() with Stdout { min_i128 = i128 { low: 0_i64, high: -9223372036854775808_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_20, String { repr: array.new_data("min_i128 = "), used: 11 }); + String::push_str(__local_20, String { repr: array.new_data("min_i128 = "), used: 11 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i128::fmt_decimal(min_i128, __local_21); break __tmpl: __local_20; @@ -213,7 +213,7 @@ fn run() with Stdout { cast_u128 = u128 { low: 0_i64, high: 1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_22, String { repr: array.new_data("cast_u128 = "), used: 12 }); + String::push_str(__local_22, String { repr: array.new_data("cast_u128 = "), used: 12 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; u128::fmt_decimal(cast_u128, __local_23); break __tmpl: __local_22; @@ -221,7 +221,7 @@ fn run() with Stdout { cast_i128 = i128 { low: -9223372036854775808_i64, high: 0_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_24, String { repr: array.new_data("cast_i128 = "), used: 12 }); + String::push_str(__local_24, String { repr: array.new_data("cast_i128 = "), used: 12 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i128::fmt_decimal(cast_i128, __local_25); break __tmpl: __local_24; @@ -229,7 +229,7 @@ fn run() with Stdout { with_underscores = u128 { low: -1_i64, high: -1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_26, String { repr: array.new_data("with_underscores = "), used: 19 }); + String::push_str(__local_26, String { repr: array.new_data("with_underscores = "), used: 19 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; u128::fmt_decimal(with_underscores, __local_27); break __tmpl: __local_26; @@ -237,7 +237,7 @@ fn run() with Stdout { hex_large = u128 { low: 0_i64, high: 1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_28, String { repr: array.new_data("hex_large = "), used: 12 }); + String::push_str(__local_28, String { repr: array.new_data("hex_large = "), used: 12 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; u128::fmt_decimal(hex_large, __local_29); break __tmpl: __local_28; @@ -245,7 +245,7 @@ fn run() with Stdout { hex_max = u128 { low: -1_i64, high: -1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_30, String { repr: array.new_data("hex_max = "), used: 10 }); + String::push_str(__local_30, String { repr: array.new_data("hex_max = "), used: 10 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; u128::fmt_decimal(hex_max, __local_31); break __tmpl: __local_30; @@ -253,7 +253,7 @@ fn run() with Stdout { bin_large = u128 { low: 0_i64, high: 1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_32, String { repr: array.new_data("bin_large = "), used: 12 }); + String::push_str(__local_32, String { repr: array.new_data("bin_large = "), used: 12 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; u128::fmt_decimal(bin_large, __local_33); break __tmpl: __local_32; @@ -261,7 +261,7 @@ fn run() with Stdout { hex_cast = u128 { low: 0_i64, high: 1_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_34, String { repr: array.new_data("hex_cast = "), used: 11 }); + String::push_str(__local_34, String { repr: array.new_data("hex_cast = "), used: 11 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; u128::fmt_decimal(hex_cast, __local_35); break __tmpl: __local_34; @@ -755,7 +755,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -770,7 +770,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -808,7 +808,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l51; }; @@ -842,20 +842,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -865,10 +865,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -878,10 +878,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -889,10 +889,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/integer_1.wir.wado b/wado-compiler/tests/fixtures.golden/integer_1.wir.wado index 13a07fdd8..d043e0ceb 100644 --- a/wado-compiler/tests/fixtures.golden/integer_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/integer_1.wir.wado @@ -110,9 +110,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -158,58 +158,58 @@ fn integer_i8_basic() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(13, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 100); - String::append_char(__local_9, 105); - String::append_char(__local_9, 102); - String::append_char(__local_9, 102); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 100); + String::push(__local_9, 105); + String::push(__local_9, 102); + String::push(__local_9, 102); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(7, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 112); - String::append_char(__local_11, 114); - String::append_char(__local_11, 111); - String::append_char(__local_11, 100); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 112); + String::push(__local_11, 114); + String::push(__local_11, 111); + String::push(__local_11, 100); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(30, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_13, 113); - String::append_char(__local_13, 117); - String::append_char(__local_13, 111); - String::append_char(__local_13, 116); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 113); + String::push(__local_13, 117); + String::push(__local_13, 111); + String::push(__local_13, 116); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(3, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_15, 114); - String::append_char(__local_15, 101); - String::append_char(__local_15, 109); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 114); + String::push(__local_15, 101); + String::push(__local_15, 109); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(1, __local_16); break __tmpl: __local_15; @@ -241,43 +241,43 @@ fn integer_i8_edge() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 109); - String::append_char(__local_7, 97); - String::append_char(__local_7, 120); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 109); + String::push(__local_7, 97); + String::push(__local_7, 120); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(127, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_9, 109); - String::append_char(__local_9, 105); - String::append_char(__local_9, 110); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 109); + String::push(__local_9, 105); + String::push(__local_9, 110); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(-128, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_11, String { repr: array.new_data("neg + pos: "), used: 11 }); + String::push_str(__local_11, String { repr: array.new_data("neg + pos: "), used: 11 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(-20, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_13, String { repr: array.new_data("-10 / 3: "), used: 9 }); + String::push_str(__local_13, String { repr: array.new_data("-10 / 3: "), used: 9 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(-3, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_15, String { repr: array.new_data("-10 % 3: "), used: 9 }); + String::push_str(__local_15, String { repr: array.new_data("-10 % 3: "), used: 9 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(-1, __local_16); break __tmpl: __local_15; @@ -297,58 +297,58 @@ fn integer_i16_basic() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(1030, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 100); - String::append_char(__local_9, 105); - String::append_char(__local_9, 102); - String::append_char(__local_9, 102); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 100); + String::push(__local_9, 105); + String::push(__local_9, 102); + String::push(__local_9, 102); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(970, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 112); - String::append_char(__local_11, 114); - String::append_char(__local_11, 111); - String::append_char(__local_11, 100); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 112); + String::push(__local_11, 114); + String::push(__local_11, 111); + String::push(__local_11, 100); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(30000, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_13, 113); - String::append_char(__local_13, 117); - String::append_char(__local_13, 111); - String::append_char(__local_13, 116); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 113); + String::push(__local_13, 117); + String::push(__local_13, 111); + String::push(__local_13, 116); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(33, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_15, 114); - String::append_char(__local_15, 101); - String::append_char(__local_15, 109); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 114); + String::push(__local_15, 101); + String::push(__local_15, 109); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(10, __local_16); break __tmpl: __local_15; @@ -380,43 +380,43 @@ fn integer_i16_edge() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 109); - String::append_char(__local_7, 97); - String::append_char(__local_7, 120); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 109); + String::push(__local_7, 97); + String::push(__local_7, 120); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(32767, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_9, 109); - String::append_char(__local_9, 105); - String::append_char(__local_9, 110); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 109); + String::push(__local_9, 105); + String::push(__local_9, 110); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(-32768, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_11, String { repr: array.new_data("neg + pos: "), used: 11 }); + String::push_str(__local_11, String { repr: array.new_data("neg + pos: "), used: 11 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(-2000, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_13, String { repr: array.new_data("-100 / 7: "), used: 10 }); + String::push_str(__local_13, String { repr: array.new_data("-100 / 7: "), used: 10 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(-14, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_15, String { repr: array.new_data("-100 % 7: "), used: 10 }); + String::push_str(__local_15, String { repr: array.new_data("-100 % 7: "), used: 10 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(-2, __local_16); break __tmpl: __local_15; @@ -436,58 +436,58 @@ fn integer_i32_basic() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(103000, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 100); - String::append_char(__local_9, 105); - String::append_char(__local_9, 102); - String::append_char(__local_9, 102); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 100); + String::push(__local_9, 105); + String::push(__local_9, 102); + String::push(__local_9, 102); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(97000, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 112); - String::append_char(__local_11, 114); - String::append_char(__local_11, 111); - String::append_char(__local_11, 100); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 112); + String::push(__local_11, 114); + String::push(__local_11, 111); + String::push(__local_11, 100); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(300000000, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_13, 113); - String::append_char(__local_13, 117); - String::append_char(__local_13, 111); - String::append_char(__local_13, 116); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 113); + String::push(__local_13, 117); + String::push(__local_13, 111); + String::push(__local_13, 116); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(33, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_15, 114); - String::append_char(__local_15, 101); - String::append_char(__local_15, 109); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 114); + String::push(__local_15, 101); + String::push(__local_15, 109); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(1000, __local_16); break __tmpl: __local_15; @@ -519,43 +519,43 @@ fn integer_i32_edge() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 109); - String::append_char(__local_7, 97); - String::append_char(__local_7, 120); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 109); + String::push(__local_7, 97); + String::push(__local_7, 120); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(2147483647, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_9, 109); - String::append_char(__local_9, 105); - String::append_char(__local_9, 110); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 109); + String::push(__local_9, 105); + String::push(__local_9, 110); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(-2147483648, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_11, String { repr: array.new_data("neg + pos: "), used: 11 }); + String::push_str(__local_11, String { repr: array.new_data("neg + pos: "), used: 11 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(-20000000, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_13, String { repr: array.new_data("-1000 / 7: "), used: 11 }); + String::push_str(__local_13, String { repr: array.new_data("-1000 / 7: "), used: 11 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(-142, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_15, String { repr: array.new_data("-1000 % 7: "), used: 11 }); + String::push_str(__local_15, String { repr: array.new_data("-1000 % 7: "), used: 11 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(-6, __local_16); break __tmpl: __local_15; @@ -587,43 +587,43 @@ fn integer_i64_edge() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 109); - String::append_char(__local_7, 97); - String::append_char(__local_7, 120); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 109); + String::push(__local_7, 97); + String::push(__local_7, 120); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i64::fmt_decimal(9223372036854775807_i64, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_9, 109); - String::append_char(__local_9, 105); - String::append_char(__local_9, 110); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 109); + String::push(__local_9, 105); + String::push(__local_9, 110); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i64::fmt_decimal(-9223372036854775808_i64, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_11, String { repr: array.new_data("neg + pos: "), used: 11 }); + String::push_str(__local_11, String { repr: array.new_data("neg + pos: "), used: 11 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i64::fmt_decimal(-2000000000000_i64, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_13, String { repr: array.new_data("-1000000000000 / 7: "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("-1000000000000 / 7: "), used: 20 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i64::fmt_decimal(-142857142857_i64, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_15, String { repr: array.new_data("-1000000000000 % 7: "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("-1000000000000 % 7: "), used: 20 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i64::fmt_decimal(-1_i64, __local_16); break __tmpl: __local_15; @@ -643,58 +643,58 @@ fn integer_u8_basic() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(13, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 100); - String::append_char(__local_9, 105); - String::append_char(__local_9, 102); - String::append_char(__local_9, 102); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 100); + String::push(__local_9, 105); + String::push(__local_9, 102); + String::push(__local_9, 102); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(7, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 112); - String::append_char(__local_11, 114); - String::append_char(__local_11, 111); - String::append_char(__local_11, 100); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 112); + String::push(__local_11, 114); + String::push(__local_11, 111); + String::push(__local_11, 100); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(30, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_13, 113); - String::append_char(__local_13, 117); - String::append_char(__local_13, 111); - String::append_char(__local_13, 116); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 113); + String::push(__local_13, 117); + String::push(__local_13, 111); + String::push(__local_13, 116); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(3, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_15, 114); - String::append_char(__local_15, 101); - String::append_char(__local_15, 109); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 114); + String::push(__local_15, 101); + String::push(__local_15, 109); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(1, __local_16); break __tmpl: __local_15; @@ -723,36 +723,36 @@ fn integer_u8_edge() with Stdout { let __local_13: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_6, 109); - String::append_char(__local_6, 97); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 109); + String::push(__local_6, 97); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(255, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_8, 109); - String::append_char(__local_8, 105); - String::append_char(__local_8, 110); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 109); + String::push(__local_8, 105); + String::push(__local_8, 110); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(0, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_10, String { repr: array.new_data("200 / 3: "), used: 9 }); + String::push_str(__local_10, String { repr: array.new_data("200 / 3: "), used: 9 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(66, __local_11); break __tmpl: __local_10; }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_12, String { repr: array.new_data("200 % 3: "), used: 9 }); + String::push_str(__local_12, String { repr: array.new_data("200 % 3: "), used: 9 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(2, __local_13); break __tmpl: __local_12; @@ -772,58 +772,58 @@ fn integer_u16_basic() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(1030, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 100); - String::append_char(__local_9, 105); - String::append_char(__local_9, 102); - String::append_char(__local_9, 102); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 100); + String::push(__local_9, 105); + String::push(__local_9, 102); + String::push(__local_9, 102); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(970, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 112); - String::append_char(__local_11, 114); - String::append_char(__local_11, 111); - String::append_char(__local_11, 100); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 112); + String::push(__local_11, 114); + String::push(__local_11, 111); + String::push(__local_11, 100); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(30000, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_13, 113); - String::append_char(__local_13, 117); - String::append_char(__local_13, 111); - String::append_char(__local_13, 116); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 113); + String::push(__local_13, 117); + String::push(__local_13, 111); + String::push(__local_13, 116); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(33, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_15, 114); - String::append_char(__local_15, 101); - String::append_char(__local_15, 109); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 114); + String::push(__local_15, 101); + String::push(__local_15, 109); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(10, __local_16); break __tmpl: __local_15; @@ -852,36 +852,36 @@ fn integer_u16_edge() with Stdout { let __local_13: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_6, 109); - String::append_char(__local_6, 97); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 109); + String::push(__local_6, 97); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(65535, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_8, 109); - String::append_char(__local_8, 105); - String::append_char(__local_8, 110); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 109); + String::push(__local_8, 105); + String::push(__local_8, 110); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(0, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_10, String { repr: array.new_data("60000 / 7: "), used: 11 }); + String::push_str(__local_10, String { repr: array.new_data("60000 / 7: "), used: 11 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(8571, __local_11); break __tmpl: __local_10; }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_12, String { repr: array.new_data("60000 % 7: "), used: 11 }); + String::push_str(__local_12, String { repr: array.new_data("60000 % 7: "), used: 11 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(3, __local_13); break __tmpl: __local_12; @@ -901,58 +901,58 @@ fn integer_u32_basic() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; u32::fmt_decimal(103000, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 100); - String::append_char(__local_9, 105); - String::append_char(__local_9, 102); - String::append_char(__local_9, 102); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 100); + String::push(__local_9, 105); + String::push(__local_9, 102); + String::push(__local_9, 102); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; u32::fmt_decimal(97000, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 112); - String::append_char(__local_11, 114); - String::append_char(__local_11, 111); - String::append_char(__local_11, 100); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 112); + String::push(__local_11, 114); + String::push(__local_11, 111); + String::push(__local_11, 100); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; u32::fmt_decimal(300000000, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_13, 113); - String::append_char(__local_13, 117); - String::append_char(__local_13, 111); - String::append_char(__local_13, 116); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 113); + String::push(__local_13, 117); + String::push(__local_13, 111); + String::push(__local_13, 116); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; u32::fmt_decimal(33, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_15, 114); - String::append_char(__local_15, 101); - String::append_char(__local_15, 109); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 114); + String::push(__local_15, 101); + String::push(__local_15, 109); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; u32::fmt_decimal(1000, __local_16); break __tmpl: __local_15; @@ -982,49 +982,49 @@ fn integer_u32_edge() with Stdout { let __local_14: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_5, 109); - String::append_char(__local_5, 97); - String::append_char(__local_5, 120); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 109); + String::push(__local_5, 97); + String::push(__local_5, 120); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; u32::fmt_decimal(-1, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 109); - String::append_char(__local_7, 105); - String::append_char(__local_7, 110); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 109); + String::push(__local_7, 105); + String::push(__local_7, 110); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; u32::fmt_decimal(0, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_9, 108); - String::append_char(__local_9, 97); - String::append_char(__local_9, 114); - String::append_char(__local_9, 103); - String::append_char(__local_9, 101); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 108); + String::push(__local_9, 97); + String::push(__local_9, 114); + String::push(__local_9, 103); + String::push(__local_9, 101); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; u32::fmt_decimal(-1294967296, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_11, String { repr: array.new_data("3000000000 / 2: "), used: 16 }); + String::push_str(__local_11, String { repr: array.new_data("3000000000 / 2: "), used: 16 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; u32::fmt_decimal(1500000000, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_13, String { repr: array.new_data("3000000000 % 7: "), used: 16 }); + String::push_str(__local_13, String { repr: array.new_data("3000000000 % 7: "), used: 16 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; u32::fmt_decimal(4, __local_14); break __tmpl: __local_13; @@ -1044,58 +1044,58 @@ fn integer_u64_basic() with Stdout { let __local_16: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; u64::fmt_decimal(1300000000000_i64, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 100); - String::append_char(__local_9, 105); - String::append_char(__local_9, 102); - String::append_char(__local_9, 102); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 100); + String::push(__local_9, 105); + String::push(__local_9, 102); + String::push(__local_9, 102); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; u64::fmt_decimal(700000000000_i64, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 112); - String::append_char(__local_11, 114); - String::append_char(__local_11, 111); - String::append_char(__local_11, 100); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 112); + String::push(__local_11, 114); + String::push(__local_11, 111); + String::push(__local_11, 100); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; u64::fmt_decimal(1000000000000_i64, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_13, 113); - String::append_char(__local_13, 117); - String::append_char(__local_13, 111); - String::append_char(__local_13, 116); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 113); + String::push(__local_13, 117); + String::push(__local_13, 111); + String::push(__local_13, 116); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; u64::fmt_decimal(3_i64, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_15, 114); - String::append_char(__local_15, 101); - String::append_char(__local_15, 109); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 114); + String::push(__local_15, 101); + String::push(__local_15, 109); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; u64::fmt_decimal(100000000000_i64, __local_16); break __tmpl: __local_15; @@ -1125,49 +1125,49 @@ fn integer_u64_edge() with Stdout { let __local_14: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_5, 109); - String::append_char(__local_5, 97); - String::append_char(__local_5, 120); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 109); + String::push(__local_5, 97); + String::push(__local_5, 120); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; u64::fmt_decimal(-1_i64, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 109); - String::append_char(__local_7, 105); - String::append_char(__local_7, 110); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 109); + String::push(__local_7, 105); + String::push(__local_7, 110); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; u64::fmt_decimal(0_i64, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_9, 108); - String::append_char(__local_9, 97); - String::append_char(__local_9, 114); - String::append_char(__local_9, 103); - String::append_char(__local_9, 101); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 108); + String::push(__local_9, 97); + String::push(__local_9, 114); + String::push(__local_9, 103); + String::push(__local_9, 101); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; u64::fmt_decimal(-8446744073709551616_i64, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(42), used: 0 }; - String::append(__local_11, String { repr: array.new_data("10000000000000000000 / 2: "), used: 26 }); + String::push_str(__local_11, String { repr: array.new_data("10000000000000000000 / 2: "), used: 26 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; u64::fmt_decimal(5000000000000000000_i64, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(42), used: 0 }; - String::append(__local_13, String { repr: array.new_data("10000000000000000000 % 7: "), used: 26 }); + String::push_str(__local_13, String { repr: array.new_data("10000000000000000000 % 7: "), used: 26 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; u64::fmt_decimal(3_i64, __local_14); break __tmpl: __local_13; @@ -1543,7 +1543,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1558,7 +1558,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1596,7 +1596,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l38; }; @@ -1630,20 +1630,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1653,10 +1653,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1666,10 +1666,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1677,10 +1677,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/integer_2.wir.wado b/wado-compiler/tests/fixtures.golden/integer_2.wir.wado index 71a51c643..164340f5b 100644 --- a/wado-compiler/tests/fixtures.golden/integer_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/integer_2.wir.wado @@ -72,9 +72,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -112,7 +112,7 @@ fn test_i8_overflow() with Stdout { let __local_18: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_11, String { repr: array.new_data("127 + 1: "), used: 9 }); + String::push_str(__local_11, String { repr: array.new_data("127 + 1: "), used: 9 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(-128, __local_12); break __tmpl: __local_11; @@ -120,7 +120,7 @@ fn test_i8_overflow() with Stdout { "core:cli/println"(String { repr: array.new_data("sum is negative: true"), used: 21 }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_13, String { repr: array.new_data("-128 - 1: "), used: 10 }); + String::push_str(__local_13, String { repr: array.new_data("-128 - 1: "), used: 10 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(127, __local_14); break __tmpl: __local_13; @@ -128,14 +128,14 @@ fn test_i8_overflow() with Stdout { "core:cli/println"(String { repr: array.new_data("sub is positive: true"), used: 21 }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_15, String { repr: array.new_data("127 * 2: "), used: 9 }); + String::push_str(__local_15, String { repr: array.new_data("127 * 2: "), used: 9 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(-2, __local_16); break __tmpl: __local_15; }); "core:cli/println"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_17, String { repr: array.new_data("-(-128): "), used: 9 }); + String::push_str(__local_17, String { repr: array.new_data("-(-128): "), used: 9 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; i32::fmt_decimal(-128, __local_18); break __tmpl: __local_17; @@ -152,7 +152,7 @@ fn test_i16_overflow() with Stdout { let __local_12: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_7, String { repr: array.new_data("32767 + 1: "), used: 11 }); + String::push_str(__local_7, String { repr: array.new_data("32767 + 1: "), used: 11 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(-32768, __local_8); break __tmpl: __local_7; @@ -160,7 +160,7 @@ fn test_i16_overflow() with Stdout { "core:cli/println"(String { repr: array.new_data("sum is negative: true"), used: 21 }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_9, String { repr: array.new_data("-32768 - 1: "), used: 12 }); + String::push_str(__local_9, String { repr: array.new_data("-32768 - 1: "), used: 12 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(32767, __local_10); break __tmpl: __local_9; @@ -168,7 +168,7 @@ fn test_i16_overflow() with Stdout { "core:cli/println"(String { repr: array.new_data("sub is positive: true"), used: 21 }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_11, String { repr: array.new_data("32767 * 2: "), used: 11 }); + String::push_str(__local_11, String { repr: array.new_data("32767 * 2: "), used: 11 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(-2, __local_12); break __tmpl: __local_11; @@ -186,7 +186,7 @@ fn test_u8_overflow() with Stdout { let __local_17: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_10, String { repr: array.new_data("255 + 1: "), used: 9 }); + String::push_str(__local_10, String { repr: array.new_data("255 + 1: "), used: 9 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(0, __local_11); break __tmpl: __local_10; @@ -194,20 +194,20 @@ fn test_u8_overflow() with Stdout { "core:cli/println"(String { repr: array.new_data("sum == 0: true"), used: 14 }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_12, String { repr: array.new_data("200 + 100: "), used: 11 }); + String::push_str(__local_12, String { repr: array.new_data("200 + 100: "), used: 11 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(44, __local_13); break __tmpl: __local_12; }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_14, 48); - String::append_char(__local_14, 32); - String::append_char(__local_14, 45); - String::append_char(__local_14, 32); - String::append_char(__local_14, 49); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 48); + String::push(__local_14, 32); + String::push(__local_14, 45); + String::push(__local_14, 32); + String::push(__local_14, 49); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(255, __local_15); break __tmpl: __local_14; @@ -215,7 +215,7 @@ fn test_u8_overflow() with Stdout { "core:cli/println"(String { repr: array.new_data("sub == 255: true"), used: 16 }); "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_16, String { repr: array.new_data("200 * 2: "), used: 9 }); + String::push_str(__local_16, String { repr: array.new_data("200 * 2: "), used: 9 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(144, __local_17); break __tmpl: __local_16; @@ -231,7 +231,7 @@ fn test_u16_overflow() with Stdout { let __local_13: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_8, String { repr: array.new_data("65535 + 1: "), used: 11 }); + String::push_str(__local_8, String { repr: array.new_data("65535 + 1: "), used: 11 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(0, __local_9); break __tmpl: __local_8; @@ -239,13 +239,13 @@ fn test_u16_overflow() with Stdout { "core:cli/println"(String { repr: array.new_data("sum == 0: true"), used: 14 }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_10, 48); - String::append_char(__local_10, 32); - String::append_char(__local_10, 45); - String::append_char(__local_10, 32); - String::append_char(__local_10, 49); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 48); + String::push(__local_10, 32); + String::push(__local_10, 45); + String::push(__local_10, 32); + String::push(__local_10, 49); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(65535, __local_11); break __tmpl: __local_10; @@ -253,7 +253,7 @@ fn test_u16_overflow() with Stdout { "core:cli/println"(String { repr: array.new_data("sub == 65535: true"), used: 18 }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_12, String { repr: array.new_data("60000 * 2: "), used: 11 }); + String::push_str(__local_12, String { repr: array.new_data("60000 * 2: "), used: 11 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(54464, __local_13); break __tmpl: __local_12; @@ -465,7 +465,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -480,7 +480,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -518,7 +518,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -552,20 +552,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -575,10 +575,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -588,10 +588,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -599,10 +599,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/internal_f64_to_string.wir.wado b/wado-compiler/tests/fixtures.golden/internal_f64_to_string.wir.wado index 13390a863..b8241d005 100644 --- a/wado-compiler/tests/fixtures.golden/internal_f64_to_string.wir.wado +++ b/wado-compiler/tests/fixtures.golden/internal_f64_to_string.wir.wado @@ -91,7 +91,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -99,7 +99,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -941,7 +941,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -996,7 +996,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1028,7 +1028,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1110,25 +1110,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1229,9 +1229,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1285,13 +1285,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1326,9 +1326,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1369,7 +1369,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/into_iterator_item_bound.wir.wado b/wado-compiler/tests/fixtures.golden/into_iterator_item_bound.wir.wado index 3783a769d..b53221e97 100644 --- a/wado-compiler/tests/fixtures.golden/into_iterator_item_bound.wir.wado +++ b/wado-compiler/tests/fixtures.golden/into_iterator_item_bound.wir.wado @@ -77,11 +77,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -349,7 +349,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -364,7 +364,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -401,7 +401,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -454,7 +454,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -488,20 +488,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -511,10 +511,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -524,10 +524,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -535,10 +535,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/iterator_assoc_type_chain.wir.wado b/wado-compiler/tests/fixtures.golden/iterator_assoc_type_chain.wir.wado index 053873e45..ef2eb11cc 100644 --- a/wado-compiler/tests/fixtures.golden/iterator_assoc_type_chain.wir.wado +++ b/wado-compiler/tests/fixtures.golden/iterator_assoc_type_chain.wir.wado @@ -91,13 +91,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/IterFilter>^Iterator::collect" = fn(ref "core:allocator/IterFilter>") -> ref Array; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -168,27 +168,27 @@ fn run() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_9, 114); - String::append_char(__local_9, 117); - String::append_char(__local_9, 110); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_assoc_type_chain.wado"), used: 59 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_9, 114); + String::push(__local_9, 117); + String::push(__local_9, 110); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_assoc_type_chain.wado"), used: 59 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_36 = __local_10; i32::fmt_decimal(7, __local_36); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: evens.len() == 2 "), used: 29 }); - String::append(__local_9, String { repr: array.new_data("evens.len(): "), used: 13 }); + String::push_str(__local_9, String { repr: array.new_data("evens.len(): "), used: 13 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_41 = __local_10; i32::fmt_decimal(__v0_3, __local_41); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -204,27 +204,27 @@ condition: evens.len() == 2 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_11, 114); - String::append_char(__local_11, 117); - String::append_char(__local_11, 110); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_assoc_type_chain.wado"), used: 59 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_11, 114); + String::push(__local_11, 117); + String::push(__local_11, 110); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_assoc_type_chain.wado"), used: 59 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_49 = __local_12; i32::fmt_decimal(8, __local_49); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: evens[0] == 2 "), used: 26 }); - String::append(__local_11, String { repr: array.new_data("evens[0]: "), used: 10 }); + String::push_str(__local_11, String { repr: array.new_data("evens[0]: "), used: 10 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_54 = __local_12; i32::fmt_decimal(__v0_5, __local_54); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -240,27 +240,27 @@ condition: evens[0] == 2 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_13, 114); - String::append_char(__local_13, 117); - String::append_char(__local_13, 110); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_assoc_type_chain.wado"), used: 59 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_13, 114); + String::push(__local_13, 117); + String::push(__local_13, 110); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_assoc_type_chain.wado"), used: 59 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_62 = __local_14; i32::fmt_decimal(9, __local_62); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: evens[1] == 4 "), used: 26 }); - String::append(__local_13, String { repr: array.new_data("evens[1]: "), used: 10 }); + String::push_str(__local_13, String { repr: array.new_data("evens[1]: "), used: 10 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_67 = __local_14; i32::fmt_decimal(__v0_7, __local_67); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -463,7 +463,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -478,7 +478,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -520,7 +520,7 @@ fn IterFilter>^Iterator::collect(self) { multivalue_bind [__sroa___pattern_temp_0_discriminant, __sroa___pattern_temp_0_payload_0] = IterFilter>^Iterator::next(self); if __sroa___pattern_temp_0_discriminant == 0 { item = __sroa___pattern_temp_0_payload_0; - Array::append(result, item); + Array::push(result, item); } else { break b27; }; @@ -530,7 +530,7 @@ fn IterFilter>^Iterator::collect(self) { return result; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -625,7 +625,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l41; }; @@ -659,20 +659,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -682,10 +682,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -695,10 +695,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -706,10 +706,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/iterator_filter_o3_regression.wir.wado b/wado-compiler/tests/fixtures.golden/iterator_filter_o3_regression.wir.wado index b0a5a871e..040071c77 100644 --- a/wado-compiler/tests/fixtures.golden/iterator_filter_o3_regression.wir.wado +++ b/wado-compiler/tests/fixtures.golden/iterator_filter_o3_regression.wir.wado @@ -100,13 +100,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/IterFilter>>^Iterator::collect" = fn(ref "core:allocator/IterFilter>>") -> ref Array; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -201,27 +201,27 @@ fn run() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_filter_o3_regression.wado"), used: 63 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_filter_o3_regression.wado"), used: 63 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_45 = __local_15; i32::fmt_decimal(9, __local_45); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: evens.len() == 2 "), used: 29 }); - String::append(__local_14, String { repr: array.new_data("evens.len(): "), used: 13 }); + String::push_str(__local_14, String { repr: array.new_data("evens.len(): "), used: 13 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_50 = __local_15; i32::fmt_decimal(__v0_3, __local_50); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -237,27 +237,27 @@ condition: evens.len() == 2 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_filter_o3_regression.wado"), used: 63 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_filter_o3_regression.wado"), used: 63 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_58 = __local_17; i32::fmt_decimal(10, __local_58); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: evens[0] == 2 "), used: 26 }); - String::append(__local_16, String { repr: array.new_data("evens[0]: "), used: 10 }); + String::push_str(__local_16, String { repr: array.new_data("evens[0]: "), used: 10 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_63 = __local_17; i32::fmt_decimal(__v0_5, __local_63); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -273,27 +273,27 @@ condition: evens[0] == 2 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_filter_o3_regression.wado"), used: 63 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_filter_o3_regression.wado"), used: 63 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_71 = __local_19; i32::fmt_decimal(11, __local_71); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: evens[1] == 4 "), used: 26 }); - String::append(__local_18, String { repr: array.new_data("evens[1]: "), used: 10 }); + String::push_str(__local_18, String { repr: array.new_data("evens[1]: "), used: 10 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_76 = __local_19; i32::fmt_decimal(__v0_7, __local_76); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -311,27 +311,27 @@ condition: evens[1] == 4 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_filter_o3_regression.wado"), used: 63 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_filter_o3_regression.wado"), used: 63 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_88 = __local_21; i32::fmt_decimal(15, __local_88); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: big_evens.len() == 1 "), used: 33 }); - String::append(__local_20, String { repr: array.new_data("big_evens.len(): "), used: 17 }); + String::push_str(__local_20, String { repr: array.new_data("big_evens.len(): "), used: 17 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_93 = __local_21; i32::fmt_decimal(__v0_10, __local_93); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -347,27 +347,27 @@ condition: big_evens.len() == 1 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_filter_o3_regression.wado"), used: 63 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_filter_o3_regression.wado"), used: 63 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_101 = __local_23; i32::fmt_decimal(16, __local_101); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: big_evens[0] == 4 "), used: 30 }); - String::append(__local_22, String { repr: array.new_data("big_evens[0]: "), used: 14 }); + String::push_str(__local_22, String { repr: array.new_data("big_evens[0]: "), used: 14 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_106 = __local_23; i32::fmt_decimal(__v0_12, __local_106); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -570,7 +570,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -585,7 +585,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -627,7 +627,7 @@ fn IterFilter>>^Iterator::collect(self) { multivalue_bind [__sroa___pattern_temp_0_discriminant, __sroa___pattern_temp_0_payload_0] = IterFilter>>^Iterator::next(self); if __sroa___pattern_temp_0_discriminant == 0 { item = __sroa___pattern_temp_0_payload_0; - Array::append(result, item); + Array::push(result, item); } else { break b30; }; @@ -637,7 +637,7 @@ fn IterFilter>>^Iterator::collect(self) { return result; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -760,7 +760,7 @@ fn IterFilter>^Iterator::collect(self) { multivalue_bind [__sroa___pattern_temp_0_discriminant, __sroa___pattern_temp_0_payload_0] = IterFilter>^Iterator::next(self); if __sroa___pattern_temp_0_discriminant == 0 { item = __sroa___pattern_temp_0_payload_0; - Array::append(result, item); + Array::push(result, item); } else { break b48; }; @@ -793,7 +793,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l52; }; @@ -827,20 +827,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -850,10 +850,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -863,10 +863,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -874,10 +874,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/iterator_generic_map.wir.wado b/wado-compiler/tests/fixtures.golden/iterator_generic_map.wir.wado index 807692e3e..34a96f6f9 100644 --- a/wado-compiler/tests/fixtures.golden/iterator_generic_map.wir.wado +++ b/wado-compiler/tests/fixtures.golden/iterator_generic_map.wir.wado @@ -101,13 +101,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/GenericMapIter,i32>^Iterator::next" = fn(ref GenericMapIter,i32>) -> ref Option; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -178,19 +178,19 @@ fn run() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_11, 114); - String::append_char(__local_11, 117); - String::append_char(__local_11, 110); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map.wado"), used: 54 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_11, 114); + String::push(__local_11, 117); + String::push(__local_11, 110); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map.wado"), used: 54 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(23, __local_12); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: a matches { Some(2) } "), used: 34 }); break __tmpl: __local_11; @@ -210,19 +210,19 @@ condition: a matches { Some(2) } if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_13, 114); - String::append_char(__local_13, 117); - String::append_char(__local_13, 110); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map.wado"), used: 54 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_13, 114); + String::push(__local_13, 117); + String::push(__local_13, 110); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map.wado"), used: 54 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(25, __local_14); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: b matches { Some(4) } "), used: 34 }); break __tmpl: __local_13; @@ -242,19 +242,19 @@ condition: b matches { Some(4) } if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_15, 114); - String::append_char(__local_15, 117); - String::append_char(__local_15, 110); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map.wado"), used: 54 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_15, 114); + String::push(__local_15, 117); + String::push(__local_15, 110); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map.wado"), used: 54 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(27, __local_16); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: c matches { Some(6) } "), used: 34 }); break __tmpl: __local_15; @@ -272,19 +272,19 @@ condition: c matches { Some(6) } if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_17, 114); - String::append_char(__local_17, 117); - String::append_char(__local_17, 110); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map.wado"), used: 54 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_17, 114); + String::push(__local_17, 117); + String::push(__local_17, 110); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map.wado"), used: 54 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; i32::fmt_decimal(29, __local_18); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: d matches { None } "), used: 31 }); break __tmpl: __local_17; @@ -489,7 +489,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -504,7 +504,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -557,7 +557,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -614,7 +614,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l38; }; @@ -648,20 +648,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -671,10 +671,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -684,10 +684,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -695,10 +695,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/iterator_generic_map_cross_module.wir.wado b/wado-compiler/tests/fixtures.golden/iterator_generic_map_cross_module.wir.wado index 7c983d693..21229fe7b 100644 --- a/wado-compiler/tests/fixtures.golden/iterator_generic_map_cross_module.wir.wado +++ b/wado-compiler/tests/fixtures.golden/iterator_generic_map_cross_module.wir.wado @@ -101,13 +101,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/GenericMapIter,i32>^Iterator::next" = fn(ref "./sub/iterator_generic_map_lib.wado/GenericMapIter,i32>") -> ref Option; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -178,19 +178,19 @@ fn run() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_11, 114); - String::append_char(__local_11, 117); - String::append_char(__local_11, 110); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_cross_module.wado"), used: 67 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_11, 114); + String::push(__local_11, 117); + String::push(__local_11, 110); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_cross_module.wado"), used: 67 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(8, __local_12); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: a matches { Some(10) } "), used: 35 }); break __tmpl: __local_11; @@ -210,19 +210,19 @@ condition: a matches { Some(10) } if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_13, 114); - String::append_char(__local_13, 117); - String::append_char(__local_13, 110); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_cross_module.wado"), used: 67 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_13, 114); + String::push(__local_13, 117); + String::push(__local_13, 110); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_cross_module.wado"), used: 67 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(10, __local_14); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: b matches { Some(20) } "), used: 35 }); break __tmpl: __local_13; @@ -242,19 +242,19 @@ condition: b matches { Some(20) } if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_15, 114); - String::append_char(__local_15, 117); - String::append_char(__local_15, 110); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_cross_module.wado"), used: 67 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_15, 114); + String::push(__local_15, 117); + String::push(__local_15, 110); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_cross_module.wado"), used: 67 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(12, __local_16); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: c matches { Some(30) } "), used: 35 }); break __tmpl: __local_15; @@ -272,19 +272,19 @@ condition: c matches { Some(30) } if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_17, 114); - String::append_char(__local_17, 117); - String::append_char(__local_17, 110); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_cross_module.wado"), used: 67 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_17, 114); + String::push(__local_17, 117); + String::push(__local_17, 110); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_cross_module.wado"), used: 67 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; i32::fmt_decimal(14, __local_18); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: d matches { None } "), used: 31 }); break __tmpl: __local_17; @@ -489,7 +489,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -504,7 +504,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -557,7 +557,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -614,7 +614,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l38; }; @@ -648,20 +648,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -671,10 +671,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -684,10 +684,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -695,10 +695,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/iterator_generic_map_test.wir.wado b/wado-compiler/tests/fixtures.golden/iterator_generic_map_test.wir.wado index 1488e3eb1..a08851444 100644 --- a/wado-compiler/tests/fixtures.golden/iterator_generic_map_test.wir.wado +++ b/wado-compiler/tests/fixtures.golden/iterator_generic_map_test.wir.wado @@ -129,15 +129,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/GenericMapIter,char>^Iterator::next" = fn(ref GenericMapIter,char>) -> ref Option; type "functype/GenericMapIter,i32>^Iterator::next" = fn(ref GenericMapIter,i32>) -> ref Option; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -205,17 +205,17 @@ fn __test_0_generic_map_iterator_doubles_values() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_0_generic_map_iterator_doubles_values"), used: 44 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_0_generic_map_iterator_doubles_values"), used: 44 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(22, __local_8); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: iter.next() matches { Some(2) } "), used: 44 }); break __tmpl: __local_7; @@ -234,17 +234,17 @@ condition: iter.next() matches { Some(2) } if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_0_generic_map_iterator_doubles_values"), used: 44 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_0_generic_map_iterator_doubles_values"), used: 44 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(23, __local_10); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: iter.next() matches { Some(4) } "), used: 44 }); break __tmpl: __local_9; @@ -263,17 +263,17 @@ condition: iter.next() matches { Some(4) } if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_0_generic_map_iterator_doubles_values"), used: 44 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_0_generic_map_iterator_doubles_values"), used: 44 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(24, __local_12); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: iter.next() matches { Some(6) } "), used: 44 }); break __tmpl: __local_11; @@ -290,17 +290,17 @@ condition: iter.next() matches { Some(6) } if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_0_generic_map_iterator_doubles_values"), used: 44 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_0_generic_map_iterator_doubles_values"), used: 44 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(25, __local_14); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: iter.next() matches { None } "), used: 41 }); break __tmpl: __local_13; @@ -339,17 +339,17 @@ fn __test_1_generic_map_iterator_type_conversion() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_1_generic_map_iterator_type_conversion"), used: 45 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_1_generic_map_iterator_type_conversion"), used: 45 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(31, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: iter.next() matches { Some('A') } "), used: 46 }); break __tmpl: __local_6; @@ -368,17 +368,17 @@ condition: iter.next() matches { Some('A') } if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_1_generic_map_iterator_type_conversion"), used: 45 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_1_generic_map_iterator_type_conversion"), used: 45 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(32, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: iter.next() matches { Some('B') } "), used: 46 }); break __tmpl: __local_8; @@ -397,17 +397,17 @@ condition: iter.next() matches { Some('B') } if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_1_generic_map_iterator_type_conversion"), used: 45 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_1_generic_map_iterator_type_conversion"), used: 45 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_generic_map_test.wado"), used: 59 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(33, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: iter.next() matches { Some('C') } "), used: 46 }); break __tmpl: __local_10; @@ -617,7 +617,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -632,7 +632,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -701,7 +701,7 @@ fn GenericMapIter,i32>^Iterator::next(self) { return Option { 1 }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -766,7 +766,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l46; }; @@ -800,20 +800,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -823,10 +823,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -836,10 +836,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -847,10 +847,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/iterator_merged.wir.wado b/wado-compiler/tests/fixtures.golden/iterator_merged.wir.wado index 03ec93df5..628bd389c 100644 --- a/wado-compiler/tests/fixtures.golden/iterator_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/iterator_merged.wir.wado @@ -52,13 +52,13 @@ struct Option::Some { payload_0: i32, } -struct Array { // Array with T=i32 - mut repr: ref array, +struct Array { // Array with T=String + mut repr: ref array, mut used: i32, } -struct Array { // Array with T=String - mut repr: ref array, +struct Array { // Array with T=i32 + mut repr: ref array, mut used: i32, } @@ -118,23 +118,23 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref null String; -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref Option; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -213,27 +213,27 @@ fn __test_0_basic_next() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_47 = __local_17; i32::fmt_decimal(6, __local_47); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: a == 10 "), used: 20 }); - String::append_char(__local_16, 97); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_52 = __local_17; i32::fmt_decimal(a, __local_52); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -241,20 +241,20 @@ condition: a == 10 } else { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(8, __local_19); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("expected Some"), used: 13 }); - String::append(__local_18, String { repr: array.new_data(" + String::push(__local_18, 58); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("expected Some"), used: 13 }); + String::push_str(__local_18, String { repr: array.new_data(" condition: false "), used: 18 }); break __tmpl: __local_18; @@ -268,27 +268,27 @@ condition: false if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_64 = __local_21; i32::fmt_decimal(12, __local_64); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: b == 20 "), used: 20 }); - String::append_char(__local_20, 98); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 98); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_69 = __local_21; i32::fmt_decimal(b, __local_69); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -296,20 +296,20 @@ condition: b == 20 } else { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i32::fmt_decimal(14, __local_23); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("expected Some"), used: 13 }); - String::append(__local_22, String { repr: array.new_data(" + String::push(__local_22, 58); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("expected Some"), used: 13 }); + String::push_str(__local_22, String { repr: array.new_data(" condition: false "), used: 18 }); break __tmpl: __local_22; @@ -323,27 +323,27 @@ condition: false if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_81 = __local_25; i32::fmt_decimal(18, __local_81); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: c == 30 "), used: 20 }); - String::append_char(__local_24, 99); - String::append_char(__local_24, 58); - String::append_char(__local_24, 32); + String::push(__local_24, 99); + String::push(__local_24, 58); + String::push(__local_24, 32); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_86 = __local_25; i32::fmt_decimal(c, __local_86); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -351,20 +351,20 @@ condition: c == 30 } else { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_26, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_26, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; i32::fmt_decimal(20, __local_27); - String::append_char(__local_26, 58); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("expected Some"), used: 13 }); - String::append(__local_26, String { repr: array.new_data(" + String::push(__local_26, 58); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("expected Some"), used: 13 }); + String::push_str(__local_26, String { repr: array.new_data(" condition: false "), used: 18 }); break __tmpl: __local_26; @@ -381,17 +381,17 @@ condition: false if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("__test_0_basic_next"), used: 19 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; i32::fmt_decimal(23, __local_29); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: iter.next() matches { None } "), used: 41 }); break __tmpl: __local_28; @@ -425,17 +425,17 @@ fn __test_1_empty() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_1_empty"), used: 14 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_1_empty"), used: 14 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(29, __local_6); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: iter.next() matches { None } "), used: 41 }); break __tmpl: __local_5; @@ -452,17 +452,17 @@ condition: iter.next() matches { None } if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_1_empty"), used: 14 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_1_empty"), used: 14 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(30, __local_8); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: iter.next() matches { None } "), used: 41 }); break __tmpl: __local_7; @@ -507,29 +507,29 @@ fn __test_2_into_iter() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_2_into_iter"), used: 18 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_2_into_iter"), used: 18 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_24 = __local_8; i32::fmt_decimal(44, __local_24); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: sum == 6 "), used: 21 }); - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_29 = __local_8; i32::fmt_decimal(__v0, __local_29); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -577,26 +577,26 @@ fn __test_3_strings() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_3_strings"), used: 16 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_3_strings"), used: 16 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_38 = __local_14; i32::fmt_decimal(52, __local_38); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: s == \"hello\" "), used: 25 }); - String::append_char(__local_13, 115); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 115); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; String^Inspect::inspect(__v0_4, __local_14); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -610,26 +610,26 @@ condition: s == \"hello\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_3_strings"), used: 16 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_3_strings"), used: 16 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_45 = __local_16; i32::fmt_decimal(55, __local_45); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: s == \"world\" "), used: 25 }); - String::append_char(__local_15, 115); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 115); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; String^Inspect::inspect(__v0_7, __local_16); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -643,26 +643,26 @@ condition: s == \"world\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_3_strings"), used: 16 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_3_strings"), used: 16 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_52 = __local_18; i32::fmt_decimal(58, __local_52); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: s == \"!\" "), used: 21 }); - String::append_char(__local_17, 115); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 115); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; String^Inspect::inspect(__v0_10, __local_18); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -678,17 +678,17 @@ condition: s == \"!\" if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_3_strings"), used: 16 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_3_strings"), used: 16 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_merged.wado"), used: 49 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; i32::fmt_decimal(60, __local_20); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: iter.next() matches { None } "), used: 41 }); break __tmpl: __local_19; @@ -908,7 +908,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -996,7 +996,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1033,7 +1033,7 @@ fn ArrayIter^Iterator::next(self) { return item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1085,7 +1085,7 @@ fn ArrayIter^Iterator::next(self) { return Option::Some { discriminant: 0, payload_0: item }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1138,7 +1138,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l66; }; @@ -1172,20 +1172,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1195,10 +1195,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1208,10 +1208,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1219,10 +1219,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1234,7 +1234,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1251,22 +1251,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b85; @@ -1274,7 +1274,7 @@ fn String^Inspect::inspect(self, f) { continue l86; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_basic_next as "__test_0_basic_next" diff --git a/wado-compiler/tests/fixtures.golden/iterator_trait_map.wir.wado b/wado-compiler/tests/fixtures.golden/iterator_trait_map.wir.wado index 006b57bff..f8b89d16c 100644 --- a/wado-compiler/tests/fixtures.golden/iterator_trait_map.wir.wado +++ b/wado-compiler/tests/fixtures.golden/iterator_trait_map.wir.wado @@ -86,13 +86,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/String::from_iter>" = fn(ref "core:allocator/IterMap") -> ref String; @@ -182,26 +182,26 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(172), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_32 = __local_13; i32::fmt_decimal(6, __local_32); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: \"HELLO\".to_ascii_lowercase() == \"hello\" "), used: 52 }); - String::append(__local_12, String { repr: array.new_data("\"HELLO\".to_ascii_lowercase(): "), used: 30 }); + String::push_str(__local_12, String { repr: array.new_data("\"HELLO\".to_ascii_lowercase(): "), used: 30 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_0, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -216,26 +216,26 @@ condition: \"HELLO\".to_ascii_lowercase() == \"hello\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(190), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_43 = __local_15; i32::fmt_decimal(7, __local_43); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: \"Hello World\".to_ascii_lowercase() == \"hello world\" "), used: 64 }); - String::append(__local_14, String { repr: array.new_data("\"Hello World\".to_ascii_lowercase(): "), used: 36 }); + String::push_str(__local_14, String { repr: array.new_data("\"Hello World\".to_ascii_lowercase(): "), used: 36 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; String^Inspect::inspect(__v0_2, __local_15); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -250,26 +250,26 @@ condition: \"Hello World\".to_ascii_lowercase() == \"hello world\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(196), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_54 = __local_17; i32::fmt_decimal(8, __local_54); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: \"already lower\".to_ascii_lowercase() == \"already lower\" "), used: 68 }); - String::append(__local_16, String { repr: array.new_data("\"already lower\".to_ascii_lowercase(): "), used: 38 }); + String::push_str(__local_16, String { repr: array.new_data("\"already lower\".to_ascii_lowercase(): "), used: 38 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_4, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -284,26 +284,26 @@ condition: \"already lower\".to_ascii_lowercase() == \"already lower\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(172), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_65 = __local_19; i32::fmt_decimal(11, __local_65); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: \"hello\".to_ascii_uppercase() == \"HELLO\" "), used: 52 }); - String::append(__local_18, String { repr: array.new_data("\"hello\".to_ascii_uppercase(): "), used: 30 }); + String::push_str(__local_18, String { repr: array.new_data("\"hello\".to_ascii_uppercase(): "), used: 30 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; String^Inspect::inspect(__v0_6, __local_19); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -318,26 +318,26 @@ condition: \"hello\".to_ascii_uppercase() == \"HELLO\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(190), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_76 = __local_21; i32::fmt_decimal(12, __local_76); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: \"Hello World\".to_ascii_uppercase() == \"HELLO WORLD\" "), used: 64 }); - String::append(__local_20, String { repr: array.new_data("\"Hello World\".to_ascii_uppercase(): "), used: 36 }); + String::push_str(__local_20, String { repr: array.new_data("\"Hello World\".to_ascii_uppercase(): "), used: 36 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; String^Inspect::inspect(__v0_8, __local_21); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -352,26 +352,26 @@ condition: \"Hello World\".to_ascii_uppercase() == \"HELLO WORLD\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(196), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/iterator_trait_map.wado"), used: 52 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_87 = __local_23; i32::fmt_decimal(13, __local_87); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: \"ALREADY UPPER\".to_ascii_uppercase() == \"ALREADY UPPER\" "), used: 68 }); - String::append(__local_22, String { repr: array.new_data("\"ALREADY UPPER\".to_ascii_uppercase(): "), used: 38 }); + String::push_str(__local_22, String { repr: array.new_data("\"ALREADY UPPER\".to_ascii_uppercase(): "), used: 38 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; String^Inspect::inspect(__v0_10, __local_23); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -604,7 +604,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -692,7 +692,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -732,7 +732,7 @@ fn String::from_iter>(iter) { multivalue_bind [__sroa___pattern_temp_0_discriminant, __sroa___pattern_temp_0_payload_0] = IterMap^Iterator::next(__iter_2); if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; - String::append_char(s, c); + String::push(s, c); } else { break b41; }; @@ -777,7 +777,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l47; }; @@ -811,20 +811,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -834,10 +834,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -847,10 +847,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -858,10 +858,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -873,7 +873,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -890,22 +890,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b66; @@ -913,7 +913,7 @@ fn String^Inspect::inspect(self, f) { continue l67; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/core:prelude/string.wado/__closure_wrapper_0"(__env, __p0) { diff --git a/wado-compiler/tests/fixtures.golden/key-value-literal-blanket-impl.wir.wado b/wado-compiler/tests/fixtures.golden/key-value-literal-blanket-impl.wir.wado index 54cfc16b4..a3fa8f80c 100644 --- a/wado-compiler/tests/fixtures.golden/key-value-literal-blanket-impl.wir.wado +++ b/wado-compiler/tests/fixtures.golden/key-value-literal-blanket-impl.wir.wado @@ -91,15 +91,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -158,11 +158,11 @@ fn run() with Stdout { break __seq_lit: __local_13; }) }; key_21 = String { repr: array.new_data("x"), used: 1 }; - Array::append(b.keys, key_21); - Array::append(b.values, 1); + Array::push(b.keys, key_21); + Array::push(b.values, 1); key_24 = String { repr: array.new_data("y"), used: 1 }; - Array::append(b.keys, key_24); - Array::append(b.values, 2); + Array::push(b.keys, key_24); + Array::push(b.values, 2); bag = value_copy Bag(b); __v0_2 = __inline_Array_String___len_12: block -> i32 { __local_27 = bag.keys; @@ -172,27 +172,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-blanket-impl.wado"), used: 64 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-blanket-impl.wado"), used: 64 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_31 = __local_7; i32::fmt_decimal(56, __local_31); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: bag.keys.len() == 2 "), used: 32 }); - String::append(__local_6, String { repr: array.new_data("bag.keys.len(): "), used: 16 }); + String::push_str(__local_6, String { repr: array.new_data("bag.keys.len(): "), used: 16 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_36 = __local_7; i32::fmt_decimal(__v0_2, __local_36); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -209,27 +209,27 @@ condition: bag.keys.len() == 2 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-blanket-impl.wado"), used: 64 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-blanket-impl.wado"), used: 64 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_44 = __local_9; i32::fmt_decimal(57, __local_44); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: bag.values[0] == 1 "), used: 31 }); - String::append(__local_8, String { repr: array.new_data("bag.values[0]: "), used: 15 }); + String::push_str(__local_8, String { repr: array.new_data("bag.values[0]: "), used: 15 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_49 = __local_9; i32::fmt_decimal(__v0_4, __local_49); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -469,7 +469,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -484,7 +484,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -511,7 +511,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -553,7 +553,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -606,7 +606,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -640,20 +640,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -663,10 +663,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -676,10 +676,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -687,10 +687,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/key-value-literal-both-traits.wir.wado b/wado-compiler/tests/fixtures.golden/key-value-literal-both-traits.wir.wado index 5390fb240..2ba7c1ce0 100644 --- a/wado-compiler/tests/fixtures.golden/key-value-literal-both-traits.wir.wado +++ b/wado-compiler/tests/fixtures.golden/key-value-literal-both-traits.wir.wado @@ -91,19 +91,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -197,14 +197,14 @@ fn run() with Stdout { break __seq_lit: __local_33; }) }; __local_41 = String { repr: array.new_data("x"), used: 1 }; - Array::append(__local_0.keys, __local_41); - Array::append(__local_0.values, 10); + Array::push(__local_0.keys, __local_41); + Array::push(__local_0.values, 10); __local_44 = String { repr: array.new_data("y"), used: 1 }; - Array::append(__local_0.keys, __local_44); - Array::append(__local_0.values, 20); + Array::push(__local_0.keys, __local_44); + Array::push(__local_0.values, 20); __local_47 = String { repr: array.new_data("z"), used: 1 }; - Array::append(__local_0.keys, __local_47); - Array::append(__local_0.values, 30); + Array::push(__local_0.keys, __local_47); + Array::push(__local_0.values, 30); break __kv_lit: __local_0; }; __v0_2 = __inline_Array_i32___len_14: block -> i32 { @@ -215,27 +215,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_17, 114); - String::append_char(__local_17, 117); - String::append_char(__local_17, 110); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_17, 114); + String::push(__local_17, 117); + String::push(__local_17, 110); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_55 = __local_18; i32::fmt_decimal(75, __local_55); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: named.len() == 3 "), used: 29 }); - String::append(__local_17, String { repr: array.new_data("named.len(): "), used: 13 }); + String::push_str(__local_17, String { repr: array.new_data("named.len(): "), used: 13 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_60 = __local_18; i32::fmt_decimal(__v0_2, __local_60); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -247,23 +247,23 @@ condition: named.len() == 3 if __v0_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 114); - String::append_char(__local_19, 117); - String::append_char(__local_19, 110); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 114); + String::push(__local_19, 117); + String::push(__local_19, 110); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_68 = __local_20; i32::fmt_decimal(76, __local_68); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: named.is_named() "), used: 29 }); - String::append(__local_19, String { repr: array.new_data("named.is_named(): "), used: 18 }); + String::push_str(__local_19, String { repr: array.new_data("named.is_named(): "), used: 18 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_73 = __local_20; Formatter::pad(__local_73, if __v0_4 -> ref String { @@ -271,7 +271,7 @@ condition: named.is_named() } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -285,29 +285,29 @@ condition: named.is_named() if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 114); - String::append_char(__local_21, 117); - String::append_char(__local_21, 110); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 114); + String::push(__local_21, 117); + String::push(__local_21, 110); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_79 = __local_22; i32::fmt_decimal(78, __local_79); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: v == 20 "), used: 20 }); - String::append_char(__local_21, 118); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 118); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_84 = __local_22; i32::fmt_decimal(v, __local_84); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -328,27 +328,27 @@ condition: v == 20 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_23, 114); - String::append_char(__local_23, 117); - String::append_char(__local_23, 110); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_23, 114); + String::push(__local_23, 117); + String::push(__local_23, 110); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_105 = __local_24; i32::fmt_decimal(83, __local_105); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: indexed.len() == 3 "), used: 31 }); - String::append(__local_23, String { repr: array.new_data("indexed.len(): "), used: 15 }); + String::push_str(__local_23, String { repr: array.new_data("indexed.len(): "), used: 15 }); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_110 = __local_24; i32::fmt_decimal(__v0_11, __local_110); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -365,27 +365,27 @@ condition: indexed.len() == 3 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_25, 114); - String::append_char(__local_25, 117); - String::append_char(__local_25, 110); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_25, 114); + String::push(__local_25, 117); + String::push(__local_25, 110); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_120 = __local_26; i32::fmt_decimal(84, __local_120); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: indexed.get_by_index(0) == 100 "), used: 43 }); - String::append(__local_25, String { repr: array.new_data("indexed.get_by_index(0): "), used: 25 }); + String::push_str(__local_25, String { repr: array.new_data("indexed.get_by_index(0): "), used: 25 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_125 = __local_26; i32::fmt_decimal(__v0_13, __local_125); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -402,27 +402,27 @@ condition: indexed.get_by_index(0) == 100 if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_27, 114); - String::append_char(__local_27, 117); - String::append_char(__local_27, 110); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_27, 114); + String::push(__local_27, 117); + String::push(__local_27, 110); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-both-traits.wado"), used: 63 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_135 = __local_28; i32::fmt_decimal(85, __local_135); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: indexed.get_by_index(2) == 300 "), used: 43 }); - String::append(__local_27, String { repr: array.new_data("indexed.get_by_index(2): "), used: 25 }); + String::push_str(__local_27, String { repr: array.new_data("indexed.get_by_index(2): "), used: 25 }); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_140 = __local_28; i32::fmt_decimal(__v0_15, __local_140); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -662,7 +662,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -706,7 +706,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -733,7 +733,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -775,7 +775,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -870,7 +870,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l52; }; @@ -890,7 +890,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -898,17 +898,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -938,20 +938,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -961,10 +961,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -974,10 +974,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -985,10 +985,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/key-value-literal-conditional.wir.wado b/wado-compiler/tests/fixtures.golden/key-value-literal-conditional.wir.wado index c1aea8dc7..c79eec426 100644 --- a/wado-compiler/tests/fixtures.golden/key-value-literal-conditional.wir.wado +++ b/wado-compiler/tests/fixtures.golden/key-value-literal-conditional.wir.wado @@ -113,7 +113,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -121,7 +121,7 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/TreeMap^IndexValue::index_value" = fn(ref "core:allocator/TreeMap", ref String) -> i32; @@ -135,7 +135,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -204,34 +204,34 @@ fn run() with Stdout { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_11, 114); - String::append_char(__local_11, 117); - String::append_char(__local_11, 110); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-conditional.wado"), used: 63 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_11, 114); + String::push(__local_11, 117); + String::push(__local_11, 110); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-conditional.wado"), used: 63 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_31 = __local_12; i32::fmt_decimal(15, __local_31); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: m[\"a\"] == 1 "), used: 24 }); - String::append_char(__local_11, 109); - String::append_char(__local_11, 91); - String::append_char(__local_11, 34); - String::append_char(__local_11, 97); - String::append_char(__local_11, 34); - String::append_char(__local_11, 93); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 109); + String::push(__local_11, 91); + String::push(__local_11, 34); + String::push(__local_11, 97); + String::push(__local_11, 34); + String::push(__local_11, 93); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_36 = __local_12; i32::fmt_decimal(__v0_4, __local_36); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -250,27 +250,27 @@ condition: m[\"a\"] == 1 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_13, 114); - String::append_char(__local_13, 117); - String::append_char(__local_13, 110); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-conditional.wado"), used: 63 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_13, 114); + String::push(__local_13, 117); + String::push(__local_13, 110); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-conditional.wado"), used: 63 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_54 = __local_14; i32::fmt_decimal(23, __local_54); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: m2[\"b\"] == 2 "), used: 25 }); - String::append(__local_13, String { repr: array.new_data("m2[\"b\"]: "), used: 9 }); + String::push_str(__local_13, String { repr: array.new_data("m2[\"b\"]: "), used: 9 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_59 = __local_14; i32::fmt_decimal(__v0_9, __local_59); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -510,7 +510,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -641,7 +641,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -677,7 +677,7 @@ fn TreeMap^IndexValue::index_value(self, key) { if index < 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -763,7 +763,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_i32____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -837,7 +837,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -890,7 +890,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l67; }; @@ -924,20 +924,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -947,10 +947,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -960,10 +960,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -971,10 +971,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -986,7 +986,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1003,22 +1003,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b86; @@ -1026,7 +1026,7 @@ fn String^Inspect::inspect(self, f) { continue l87; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/key-value-literal-immutable.wir.wado b/wado-compiler/tests/fixtures.golden/key-value-literal-immutable.wir.wado index f9f1e6c9e..ddb048847 100644 --- a/wado-compiler/tests/fixtures.golden/key-value-literal-immutable.wir.wado +++ b/wado-compiler/tests/fixtures.golden/key-value-literal-immutable.wir.wado @@ -96,19 +96,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -197,14 +197,14 @@ fn run() with Stdout { break __seq_lit: __local_33; }) }; __local_41 = String { repr: array.new_data("x"), used: 1 }; - Array::append(__local_0.keys, __local_41); - Array::append(__local_0.values, 10); + Array::push(__local_0.keys, __local_41); + Array::push(__local_0.values, 10); __local_44 = String { repr: array.new_data("y"), used: 1 }; - Array::append(__local_0.keys, __local_44); - Array::append(__local_0.values, 20); + Array::push(__local_0.keys, __local_44); + Array::push(__local_0.values, 20); __local_47 = String { repr: array.new_data("z"), used: 1 }; - Array::append(__local_0.keys, __local_47); - Array::append(__local_0.values, 30); + Array::push(__local_0.keys, __local_47); + Array::push(__local_0.values, 30); __inline_FrozenMapBuilder_i32__KeyValueLiteralBuilder__build_12: block -> ref FrozenMap { __local_49 = value_copy FrozenMapBuilder(__local_0); break __inline_FrozenMapBuilder_i32__KeyValueLiteralBuilder__build_12: FrozenMap { keys: __local_49.keys, values: __local_49.values }; @@ -219,27 +219,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_17, 114); - String::append_char(__local_17, 117); - String::append_char(__local_17, 110); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-immutable.wado"), used: 61 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_17, 114); + String::push(__local_17, 117); + String::push(__local_17, 110); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-immutable.wado"), used: 61 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_55 = __local_18; i32::fmt_decimal(58, __local_55); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: m.len() == 3 "), used: 25 }); - String::append(__local_17, String { repr: array.new_data("m.len(): "), used: 9 }); + String::push_str(__local_17, String { repr: array.new_data("m.len(): "), used: 9 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_60 = __local_18; i32::fmt_decimal(__v0_2, __local_60); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -253,29 +253,29 @@ condition: m.len() == 3 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 114); - String::append_char(__local_19, 117); - String::append_char(__local_19, 110); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-immutable.wado"), used: 61 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 114); + String::push(__local_19, 117); + String::push(__local_19, 110); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-immutable.wado"), used: 61 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_66 = __local_20; i32::fmt_decimal(60, __local_66); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: v == 10 "), used: 20 }); - String::append_char(__local_19, 118); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 118); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_71 = __local_20; i32::fmt_decimal(v_4, __local_71); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -290,29 +290,29 @@ condition: v == 10 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 114); - String::append_char(__local_21, 117); - String::append_char(__local_21, 110); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-immutable.wado"), used: 61 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 114); + String::push(__local_21, 117); + String::push(__local_21, 110); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-immutable.wado"), used: 61 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_77 = __local_22; i32::fmt_decimal(63, __local_77); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: v == 20 "), used: 20 }); - String::append_char(__local_21, 118); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 118); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_82 = __local_22; i32::fmt_decimal(v_7, __local_82); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -327,29 +327,29 @@ condition: v == 20 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_23, 114); - String::append_char(__local_23, 117); - String::append_char(__local_23, 110); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-immutable.wado"), used: 61 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_23, 114); + String::push(__local_23, 117); + String::push(__local_23, 110); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-immutable.wado"), used: 61 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_88 = __local_24; i32::fmt_decimal(66, __local_88); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: v == 30 "), used: 20 }); - String::append_char(__local_23, 118); - String::append_char(__local_23, 58); - String::append_char(__local_23, 32); + String::push(__local_23, 118); + String::push(__local_23, 58); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_93 = __local_24; i32::fmt_decimal(v_10, __local_93); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -364,11 +364,11 @@ condition: v == 30 break __seq_lit: __local_98; }) }; __local_106 = String { repr: array.new_data("a"), used: 1 }; - Array::append(__local_13.keys, __local_106); - Array::append(__local_13.values, 1); + Array::push(__local_13.keys, __local_106); + Array::push(__local_13.values, 1); __local_109 = String { repr: array.new_data("b"), used: 1 }; - Array::append(__local_13.keys, __local_109); - Array::append(__local_13.values, 2); + Array::push(__local_13.keys, __local_109); + Array::push(__local_13.values, 2); __inline_FrozenMapBuilder_i32__KeyValueLiteralBuilder__build_52: block -> ref FrozenMap { __local_111 = value_copy FrozenMapBuilder(__local_13); break __inline_FrozenMapBuilder_i32__KeyValueLiteralBuilder__build_52: FrozenMap { keys: __local_111.keys, values: __local_111.values }; @@ -383,27 +383,27 @@ condition: v == 30 if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_25, 114); - String::append_char(__local_25, 117); - String::append_char(__local_25, 110); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-immutable.wado"), used: 61 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_25, 114); + String::push(__local_25, 117); + String::push(__local_25, 110); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/key-value-literal-immutable.wado"), used: 61 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_117 = __local_26; i32::fmt_decimal(71, __local_117); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: m2.len() == 2 "), used: 26 }); - String::append(__local_25, String { repr: array.new_data("m2.len(): "), used: 10 }); + String::push_str(__local_25, String { repr: array.new_data("m2.len(): "), used: 10 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_122 = __local_26; i32::fmt_decimal(__v0_15, __local_122); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -643,7 +643,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -687,7 +687,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -714,7 +714,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -798,7 +798,7 @@ fn FrozenMap::get(self, key) { return 1; 0; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -851,7 +851,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l50; }; @@ -885,20 +885,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -908,10 +908,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -921,10 +921,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -932,10 +932,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/labeled_block.wir.wado b/wado-compiler/tests/fixtures.golden/labeled_block.wir.wado index 8aa8f4a04..a109fdd9f 100644 --- a/wado-compiler/tests/fixtures.golden/labeled_block.wir.wado +++ b/wado-compiler/tests/fixtures.golden/labeled_block.wir.wado @@ -107,13 +107,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref Option; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -154,38 +154,38 @@ fn labeled_block_basic() with Stdout { let __local_12: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_5, String { repr: array.new_data("x in scope: "), used: 12 }); + String::push_str(__local_5, String { repr: array.new_data("x in scope: "), used: 12 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(20, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_7, String { repr: array.new_data("x after scope: "), used: 15 }); + String::push_str(__local_7, String { repr: array.new_data("x after scope: "), used: 15 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(10, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_9, 97); - String::append_char(__local_9, 32); - String::append_char(__local_9, 43); - String::append_char(__local_9, 32); - String::append_char(__local_9, 98); - String::append_char(__local_9, 32); - String::append_char(__local_9, 61); - String::append_char(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 32); + String::push(__local_9, 43); + String::push(__local_9, 32); + String::push(__local_9, 98); + String::push(__local_9, 32); + String::push(__local_9, 61); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(3, __local_10); break __tmpl: __local_9; }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_11, 97); - String::append_char(__local_11, 32); - String::append_char(__local_11, 61); - String::append_char(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 32); + String::push(__local_11, 61); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(1, __local_12); break __tmpl: __local_11; @@ -212,31 +212,31 @@ fn labeled_block_break_label() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("labeled_block_break_label"), used: 25 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/labeled_block.wado"), used: 47 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("labeled_block_break_label"), used: 25 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/labeled_block.wado"), used: 47 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_8 = __local_4; i32::fmt_decimal(42, __local_8); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: count == 1 "), used: 23 }); - String::append_char(__local_3, 99); - String::append_char(__local_3, 111); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 116); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 99); + String::push(__local_3, 111); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 116); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_13 = __local_4; i32::fmt_decimal(__v0, __local_13); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -259,32 +259,32 @@ fn labeled_block_expr_simple() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("labeled_block_expr_simple"), used: 25 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/labeled_block.wado"), used: 47 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("labeled_block_expr_simple"), used: 25 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/labeled_block.wado"), used: 47 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_10 = __local_6; i32::fmt_decimal(75, __local_10); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: result == 30 "), used: 25 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 101); - String::append_char(__local_5, 115); - String::append_char(__local_5, 117); - String::append_char(__local_5, 108); - String::append_char(__local_5, 116); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 114); + String::push(__local_5, 101); + String::push(__local_5, 115); + String::push(__local_5, 117); + String::push(__local_5, 108); + String::push(__local_5, 116); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_15 = __local_6; i32::fmt_decimal(result, __local_15); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -327,8 +327,8 @@ fn labeled_block_expr_value() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_5, 120); - String::append_char(__local_5, 61); + String::push(__local_5, 120); + String::push(__local_5, 61); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(x, __local_6); break __tmpl: __local_5; @@ -369,29 +369,29 @@ fn labeled_block_in_loop() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("labeled_block_in_loop"), used: 21 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/labeled_block.wado"), used: 47 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("labeled_block_in_loop"), used: 21 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/labeled_block.wado"), used: 47 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_9 = __local_5; i32::fmt_decimal(111, __local_9); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: sum == 23 "), used: 22 }); - String::append_char(__local_4, 115); - String::append_char(__local_4, 117); - String::append_char(__local_4, 109); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 115); + String::push(__local_4, 117); + String::push(__local_4, 109); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_14 = __local_5; i32::fmt_decimal(__v0, __local_14); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -420,32 +420,32 @@ fn labeled_block_nested() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("labeled_block_nested"), used: 20 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/labeled_block.wado"), used: 47 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("labeled_block_nested"), used: 20 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/labeled_block.wado"), used: 47 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_8 = __local_4; i32::fmt_decimal(129, __local_8); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: result == 2 "), used: 24 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 101); - String::append_char(__local_3, 115); - String::append_char(__local_3, 117); - String::append_char(__local_3, 108); - String::append_char(__local_3, 116); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 114); + String::push(__local_3, 101); + String::push(__local_3, 115); + String::push(__local_3, 117); + String::push(__local_3, 108); + String::push(__local_3, 116); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_13 = __local_4; i32::fmt_decimal(__v0, __local_13); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -701,7 +701,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -716,7 +716,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -753,7 +753,7 @@ fn ArrayIter^Iterator::next(self) { return Option::Some { discriminant: 0, payload_0: item }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -806,7 +806,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l41; }; @@ -840,20 +840,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -863,10 +863,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -876,10 +876,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -887,10 +887,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/licm_alias_mut_ref_loop.wir.wado b/wado-compiler/tests/fixtures.golden/licm_alias_mut_ref_loop.wir.wado index 9167f3458..3db6f1835 100644 --- a/wado-compiler/tests/fixtures.golden/licm_alias_mut_ref_loop.wir.wado +++ b/wado-compiler/tests/fixtures.golden/licm_alias_mut_ref_loop.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -122,31 +122,31 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/licm_alias_mut_ref_loop.wado"), used: 57 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_3, 114); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/licm_alias_mut_ref_loop.wado"), used: 57 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_10 = __local_4; i32::fmt_decimal(15, __local_10); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: pos == 3 "), used: 21 }); - String::append_char(__local_3, 112); - String::append_char(__local_3, 111); - String::append_char(__local_3, 115); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 112); + String::push(__local_3, 111); + String::push(__local_3, 115); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_15 = __local_4; i32::fmt_decimal(__v0, __local_15); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -349,7 +349,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -364,7 +364,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -402,7 +402,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -436,20 +436,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -459,10 +459,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -472,10 +472,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -483,10 +483,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/likely_unlikely.wir.wado b/wado-compiler/tests/fixtures.golden/likely_unlikely.wir.wado index a57ed2ed6..0c6ccad71 100644 --- a/wado-compiler/tests/fixtures.golden/likely_unlikely.wir.wado +++ b/wado-compiler/tests/fixtures.golden/likely_unlikely.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -130,33 +130,33 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(82), used: 0 }; - String::append_char(__local_4, 114); - String::append_char(__local_4, 49); - String::append_char(__local_4, 61); + String::push(__local_4, 114); + String::push(__local_4, 49); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_14 = __local_5; i32::fmt_decimal(r1, __local_14); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); - String::append_char(__local_4, 114); - String::append_char(__local_4, 50); - String::append_char(__local_4, 61); + String::push(__local_4, 44); + String::push(__local_4, 32); + String::push(__local_4, 114); + String::push(__local_4, 50); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_19 = __local_5; i32::fmt_decimal(r2, __local_19); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); - String::append_char(__local_4, 114); - String::append_char(__local_4, 51); - String::append_char(__local_4, 61); + String::push(__local_4, 44); + String::push(__local_4, 32); + String::push(__local_4, 114); + String::push(__local_4, 51); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_24 = __local_5; i32::fmt_decimal(r3, __local_24); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); - String::append_char(__local_4, 114); - String::append_char(__local_4, 52); - String::append_char(__local_4, 61); + String::push(__local_4, 44); + String::push(__local_4, 32); + String::push(__local_4, 114); + String::push(__local_4, 52); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_29 = __local_5; i32::fmt_decimal(r4, __local_29); @@ -359,7 +359,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -374,7 +374,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -412,7 +412,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -446,20 +446,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -469,10 +469,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -482,10 +482,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -493,10 +493,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/local_merged.wir.wado b/wado-compiler/tests/fixtures.golden/local_merged.wir.wado index 733878ce2..700185cdc 100644 --- a/wado-compiler/tests/fixtures.golden/local_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/local_merged.wir.wado @@ -95,7 +95,7 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -103,13 +103,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -223,28 +223,28 @@ fn __test_5_let_and_let_mut() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_5_let_and_let_mut"), used: 24 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/local_merged.wado"), used: 46 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_5_let_and_let_mut"), used: 24 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/local_merged.wado"), used: 46 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_17 = __local_9; i32::fmt_decimal(40, __local_17); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: msg == \"Hello from let!\" "), used: 37 }); - String::append_char(__local_8, 109); - String::append_char(__local_8, 115); - String::append_char(__local_8, 103); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 109); + String::push(__local_8, 115); + String::push(__local_8, 103); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0_1, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -255,29 +255,29 @@ condition: msg == \"Hello from let!\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_5_let_and_let_mut"), used: 24 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/local_merged.wado"), used: 46 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_5_let_and_let_mut"), used: 24 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/local_merged.wado"), used: 46 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_24 = __local_11; i32::fmt_decimal(42, __local_24); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: msg2 == \"First message\" "), used: 36 }); - String::append_char(__local_10, 109); - String::append_char(__local_10, 115); - String::append_char(__local_10, 103); - String::append_char(__local_10, 50); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 109); + String::push(__local_10, 115); + String::push(__local_10, 103); + String::push(__local_10, 50); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_4, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -288,29 +288,29 @@ condition: msg2 == \"First message\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_5_let_and_let_mut"), used: 24 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/local_merged.wado"), used: 46 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_5_let_and_let_mut"), used: 24 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/local_merged.wado"), used: 46 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_31 = __local_13; i32::fmt_decimal(44, __local_31); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: msg2 == \"Second message\" "), used: 37 }); - String::append_char(__local_12, 109); - String::append_char(__local_12, 115); - String::append_char(__local_12, 103); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 109); + String::push(__local_12, 115); + String::push(__local_12, 103); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_6, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -517,7 +517,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -613,7 +613,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -701,7 +701,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -739,7 +739,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l50; }; @@ -773,20 +773,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -796,10 +796,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -809,10 +809,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -820,10 +820,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -835,7 +835,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -852,22 +852,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b69; @@ -875,7 +875,7 @@ fn String^Inspect::inspect(self, f) { continue l70; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_bools as "__test_0_bools" diff --git a/wado-compiler/tests/fixtures.golden/location_literal_submodule.wir.wado b/wado-compiler/tests/fixtures.golden/location_literal_submodule.wir.wado index 270b9e994..7a59fb271 100644 --- a/wado-compiler/tests/fixtures.golden/location_literal_submodule.wir.wado +++ b/wado-compiler/tests/fixtures.golden/location_literal_submodule.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -314,7 +314,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -329,7 +329,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -367,7 +367,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -401,20 +401,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -424,10 +424,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -437,10 +437,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -448,10 +448,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/location_merged.wir.wado b/wado-compiler/tests/fixtures.golden/location_merged.wir.wado index fe14cdd03..68bcb6747 100644 --- a/wado-compiler/tests/fixtures.golden/location_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/location_merged.wir.wado @@ -66,9 +66,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,12 +100,12 @@ fn test_line_template() with Stdout { let __local_1: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_0, 108); - String::append_char(__local_0, 105); - String::append_char(__local_0, 110); - String::append_char(__local_0, 101); - String::append_char(__local_0, 58); - String::append_char(__local_0, 32); + String::push(__local_0, 108); + String::push(__local_0, 105); + String::push(__local_0, 110); + String::push(__local_0, 101); + String::push(__local_0, 58); + String::push(__local_0, 32); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(34, __local_1); break __tmpl: __local_0; @@ -121,13 +121,13 @@ fn run() with Stdout { "), used: 136 }); s = __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_2, 100); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 97); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("{\"stdout_contains\": [\"LOCATION_DATA_MARKER\", \"data: \", \"LOCATION_DATA_MARKER\", \"location_merged.wado\", \"test_function\", \"LocFoo::bar\"]} + String::push(__local_2, 100); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 97); + String::push(__local_2, 58); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("{\"stdout_contains\": [\"LOCATION_DATA_MARKER\", \"data: \", \"LOCATION_DATA_MARKER\", \"location_merged.wado\", \"test_function\", \"LocFoo::bar\"]} "), used: 136 }); break __tmpl: __local_2; }; @@ -157,13 +157,13 @@ fn __cm_export__run() { "), used: 136 }); s = __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_2, 100); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 97); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("{\"stdout_contains\": [\"LOCATION_DATA_MARKER\", \"data: \", \"LOCATION_DATA_MARKER\", \"location_merged.wado\", \"test_function\", \"LocFoo::bar\"]} + String::push(__local_2, 100); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 97); + String::push(__local_2, 58); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("{\"stdout_contains\": [\"LOCATION_DATA_MARKER\", \"data: \", \"LOCATION_DATA_MARKER\", \"location_merged.wado\", \"test_function\", \"LocFoo::bar\"]} "), used: 136 }); break __tmpl: __local_2; }; @@ -367,7 +367,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -382,7 +382,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -420,7 +420,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -454,20 +454,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -477,10 +477,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -490,10 +490,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -501,10 +501,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/loop_basic.wir.wado b/wado-compiler/tests/fixtures.golden/loop_basic.wir.wado index 9bd53cd19..aba1b99a9 100644 --- a/wado-compiler/tests/fixtures.golden/loop_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/loop_basic.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,13 +102,13 @@ fn run() with Stdout { l1: loop { "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_1, 99); - String::append_char(__local_1, 111); - String::append_char(__local_1, 117); - String::append_char(__local_1, 110); - String::append_char(__local_1, 116); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 99); + String::push(__local_1, 111); + String::push(__local_1, 117); + String::push(__local_1, 110); + String::push(__local_1, 116); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(count, __local_2); break __tmpl: __local_1; @@ -318,7 +318,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -333,7 +333,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -371,7 +371,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -405,20 +405,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -428,10 +428,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -441,10 +441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -452,10 +452,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/loop_continue.wir.wado b/wado-compiler/tests/fixtures.golden/loop_continue.wir.wado index ffe298fa6..e1eb8a5ee 100644 --- a/wado-compiler/tests/fixtures.golden/loop_continue.wir.wado +++ b/wado-compiler/tests/fixtures.golden/loop_continue.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -109,13 +109,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_1, 99); - String::append_char(__local_1, 111); - String::append_char(__local_1, 117); - String::append_char(__local_1, 110); - String::append_char(__local_1, 116); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 99); + String::push(__local_1, 111); + String::push(__local_1, 117); + String::push(__local_1, 110); + String::push(__local_1, 116); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(count, __local_2); break __tmpl: __local_1; @@ -321,7 +321,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -336,7 +336,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -374,7 +374,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -408,20 +408,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -431,10 +431,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -444,10 +444,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -455,10 +455,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/loop_nested.wir.wado b/wado-compiler/tests/fixtures.golden/loop_nested.wir.wado index 0a21b629a..f181bff18 100644 --- a/wado-compiler/tests/fixtures.golden/loop_nested.wir.wado +++ b/wado-compiler/tests/fixtures.golden/loop_nested.wir.wado @@ -70,9 +70,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -140,15 +140,15 @@ fn loop_nested_deep() with Stdout { __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_9 = __local_5; i32::fmt_decimal(i, __local_9); - String::append_char(__local_4, 45); + String::push(__local_4, 45); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_14 = __local_5; i32::fmt_decimal(j, __local_14); - String::append_char(__local_4, 45); + String::push(__local_4, 45); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_19 = __local_5; i32::fmt_decimal(k, __local_19); - String::append_char(__local_4, 45); + String::push(__local_4, 45); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_24 = __local_5; i32::fmt_decimal(l, __local_24); @@ -193,22 +193,22 @@ fn loop_nested_loop() with Stdout { inner = inner + 1; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(45), used: 0 }; - String::append_char(__local_2, 111); - String::append_char(__local_2, 117); - String::append_char(__local_2, 116); - String::append_char(__local_2, 101); - String::append_char(__local_2, 114); - String::append_char(__local_2, 58); + String::push(__local_2, 111); + String::push(__local_2, 117); + String::push(__local_2, 116); + String::push(__local_2, 101); + String::push(__local_2, 114); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_7 = __local_3; i32::fmt_decimal(outer, __local_7); - String::append_char(__local_2, 32); - String::append_char(__local_2, 105); - String::append_char(__local_2, 110); - String::append_char(__local_2, 110); - String::append_char(__local_2, 101); - String::append_char(__local_2, 114); - String::append_char(__local_2, 58); + String::push(__local_2, 32); + String::push(__local_2, 105); + String::push(__local_2, 110); + String::push(__local_2, 110); + String::push(__local_2, 101); + String::push(__local_2, 114); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_12 = __local_3; i32::fmt_decimal(inner, __local_12); @@ -259,20 +259,20 @@ fn loop_nested_mixed() with Stdout { __for_2_body: block { "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(56), used: 0 }; - String::append_char(__local_3, 97); - String::append_char(__local_3, 58); + String::push(__local_3, 97); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_8 = __local_4; i32::fmt_decimal(a, __local_8); - String::append_char(__local_3, 32); - String::append_char(__local_3, 98); - String::append_char(__local_3, 58); + String::push(__local_3, 32); + String::push(__local_3, 98); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_13 = __local_4; i32::fmt_decimal(b, __local_13); - String::append_char(__local_3, 32); - String::append_char(__local_3, 99); - String::append_char(__local_3, 58); + String::push(__local_3, 32); + String::push(__local_3, 99); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_18 = __local_4; i32::fmt_decimal(c, __local_18); @@ -505,7 +505,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -520,7 +520,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -558,7 +558,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l52; }; @@ -592,20 +592,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -615,10 +615,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -628,10 +628,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -639,10 +639,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/match_1.wir.wado b/wado-compiler/tests/fixtures.golden/match_1.wir.wado index 3c527e800..9854ff27c 100644 --- a/wado-compiler/tests/fixtures.golden/match_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_1.wir.wado @@ -108,13 +108,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -170,9 +170,9 @@ fn classify_builder(x) { return let __match_scrut_0: i32; __match_scrut_0 = x; if x > 0 -> ref String { if x > 10 -> ref String { __local_1 = String { repr: builtin::array_new(8), used: 0 }; - String::append_char(__local_1, 98); - String::append_char(__local_1, 105); - String::append_char(__local_1, 103); + String::push(__local_1, 98); + String::push(__local_1, 105); + String::push(__local_1, 103); __local_1; } else { String { repr: array.new_data("small"), used: 5 }; @@ -217,27 +217,27 @@ fn __test_0_option_basic() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_0_option_basic"), used: 21 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_0_option_basic"), used: 21 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_18 = __local_11; i32::fmt_decimal(52, __local_18); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: x == 84 "), used: 20 }); - String::append_char(__local_10, 120); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 120); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_23 = __local_11; i32::fmt_decimal(x, __local_23); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -258,27 +258,27 @@ condition: x == 84 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_0_option_basic"), used: 21 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_0_option_basic"), used: 21 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_29 = __local_13; i32::fmt_decimal(57, __local_29); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: y == -1 "), used: 20 }); - String::append_char(__local_12, 121); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 121); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_34 = __local_13; i32::fmt_decimal(y, __local_34); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -306,24 +306,24 @@ fn __test_1_return_in_arms() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_1_return_in_arms"), used: 23 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_1_return_in_arms"), used: 23 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_16 = __local_7; i32::fmt_decimal(61, __local_16); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: classify(1) == \"positive\" "), used: 38 }); - String::append(__local_6, String { repr: array.new_data("classify(1): "), used: 13 }); + String::push_str(__local_6, String { repr: array.new_data("classify(1): "), used: 13 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0_0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -333,24 +333,24 @@ condition: classify(1) == \"positive\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_1_return_in_arms"), used: 23 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_1_return_in_arms"), used: 23 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_23 = __local_9; i32::fmt_decimal(62, __local_23); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: classify(-1) == \"negative\" "), used: 39 }); - String::append(__local_8, String { repr: array.new_data("classify(-1): "), used: 14 }); + String::push_str(__local_8, String { repr: array.new_data("classify(-1): "), used: 14 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0_2, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -360,24 +360,24 @@ condition: classify(-1) == \"negative\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_1_return_in_arms"), used: 23 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_1_return_in_arms"), used: 23 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_30 = __local_11; i32::fmt_decimal(63, __local_30); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: classify(0) == \"zero\" "), used: 34 }); - String::append(__local_10, String { repr: array.new_data("classify(0): "), used: 13 }); + String::push_str(__local_10, String { repr: array.new_data("classify(0): "), used: 13 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_4, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -395,24 +395,24 @@ fn __test_2_stmt_no_semi() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_2_stmt_no_semi"), used: 21 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_2_stmt_no_semi"), used: 21 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_8 = __local_3; i32::fmt_decimal(67, __local_8); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: classify(1) == \"positive\" "), used: 38 }); - String::append(__local_2, String { repr: array.new_data("classify(1): "), used: 13 }); + String::push_str(__local_2, String { repr: array.new_data("classify(1): "), used: 13 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; String^Inspect::inspect(__v0, __local_3); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -455,32 +455,32 @@ fn __test_3_string_literal() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_3_string_literal"), used: 23 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_3_string_literal"), used: 23 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_20 = __local_9; i32::fmt_decimal(77, __local_20); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: result == 1 "), used: 24 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 101); - String::append_char(__local_8, 115); - String::append_char(__local_8, 117); - String::append_char(__local_8, 108); - String::append_char(__local_8, 116); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 114); + String::push(__local_8, 101); + String::push(__local_8, 115); + String::push(__local_8, 117); + String::push(__local_8, 108); + String::push(__local_8, 116); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_25 = __local_9; i32::fmt_decimal(result, __local_25); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -502,25 +502,25 @@ condition: result == 1 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_3_string_literal"), used: 23 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_3_string_literal"), used: 23 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_31 = __local_11; i32::fmt_decimal(84, __local_31); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: result2 == 0 "), used: 25 }); - String::append(__local_10, String { repr: array.new_data("result2: "), used: 9 }); + String::push_str(__local_10, String { repr: array.new_data("result2: "), used: 9 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_36 = __local_11; i32::fmt_decimal(result2, __local_36); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -562,27 +562,27 @@ fn __test_4_never_arm() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_4_never_arm"), used: 18 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_4_never_arm"), used: 18 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_18 = __local_11; i32::fmt_decimal(93, __local_18); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: x == 1 "), used: 19 }); - String::append_char(__local_10, 120); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 120); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_23 = __local_11; i32::fmt_decimal(x, __local_23); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -605,27 +605,27 @@ condition: x == 1 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_4_never_arm"), used: 18 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_4_never_arm"), used: 18 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_29 = __local_13; i32::fmt_decimal(99, __local_29); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: y == 2 "), used: 19 }); - String::append_char(__local_12, 121); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 121); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_34 = __local_13; i32::fmt_decimal(y, __local_34); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -664,25 +664,25 @@ fn __test_5_never_type() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(160), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_5_never_type"), used: 19 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_5_never_type"), used: 19 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(103, __local_15); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: first_non_negative(5, 10) == 5 "), used: 43 }); - String::append(__local_4, String { repr: array.new_data("first_non_negative(5, 10): "), used: 27 }); + String::push_str(__local_4, String { repr: array.new_data("first_non_negative(5, 10): "), used: 27 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_20 = __local_5; i32::fmt_decimal(__v0_0, __local_20); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -704,25 +704,25 @@ condition: first_non_negative(5, 10) == 5 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(163), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_5_never_type"), used: 19 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_5_never_type"), used: 19 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_29 = __local_7; i32::fmt_decimal(104, __local_29); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: first_non_negative(-1, 10) == 10 "), used: 45 }); - String::append(__local_6, String { repr: array.new_data("first_non_negative(-1, 10): "), used: 28 }); + String::push_str(__local_6, String { repr: array.new_data("first_non_negative(-1, 10): "), used: 28 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_34 = __local_7; i32::fmt_decimal(__v0_2, __local_34); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -767,24 +767,24 @@ fn __test_6_arm_nested_if_value() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_29 = __local_13; i32::fmt_decimal(108, __local_29); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: classify_nested(5) == \"small\" "), used: 42 }); - String::append(__local_12, String { repr: array.new_data("classify_nested(5): "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("classify_nested(5): "), used: 20 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_0, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -796,24 +796,24 @@ condition: classify_nested(5) == \"small\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_37 = __local_15; i32::fmt_decimal(109, __local_37); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: classify_nested(15) == \"big\" "), used: 41 }); - String::append(__local_14, String { repr: array.new_data("classify_nested(15): "), used: 21 }); + String::push_str(__local_14, String { repr: array.new_data("classify_nested(15): "), used: 21 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; String^Inspect::inspect(__v0_2, __local_15); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -825,24 +825,24 @@ condition: classify_nested(15) == \"big\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(151), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_45 = __local_17; i32::fmt_decimal(110, __local_45); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: classify_nested(0) == \"zero\" "), used: 41 }); - String::append(__local_16, String { repr: array.new_data("classify_nested(0): "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("classify_nested(0): "), used: 20 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_4, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -852,24 +852,24 @@ condition: classify_nested(0) == \"zero\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_52 = __local_19; i32::fmt_decimal(111, __local_52); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: classify_builder(5) == \"small\" "), used: 43 }); - String::append(__local_18, String { repr: array.new_data("classify_builder(5): "), used: 21 }); + String::push_str(__local_18, String { repr: array.new_data("classify_builder(5): "), used: 21 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; String^Inspect::inspect(__v0_6, __local_19); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -879,24 +879,24 @@ condition: classify_builder(5) == \"small\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_59 = __local_21; i32::fmt_decimal(112, __local_59); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: classify_builder(15) == \"big\" "), used: 42 }); - String::append(__local_20, String { repr: array.new_data("classify_builder(15): "), used: 22 }); + String::push_str(__local_20, String { repr: array.new_data("classify_builder(15): "), used: 22 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; String^Inspect::inspect(__v0_8, __local_21); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -906,24 +906,24 @@ condition: classify_builder(15) == \"big\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(153), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_6_arm_nested_if_value"), used: 28 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/match_1.wado"), used: 41 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_66 = __local_23; i32::fmt_decimal(113, __local_66); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: classify_builder(0) == \"zero\" "), used: 42 }); - String::append(__local_22, String { repr: array.new_data("classify_builder(0): "), used: 21 }); + String::push_str(__local_22, String { repr: array.new_data("classify_builder(0): "), used: 21 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; String^Inspect::inspect(__v0_10, __local_23); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -1156,7 +1156,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1244,7 +1244,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1282,7 +1282,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l73; }; @@ -1316,20 +1316,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1339,10 +1339,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1352,10 +1352,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1363,10 +1363,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1378,7 +1378,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1395,22 +1395,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b92; @@ -1418,7 +1418,7 @@ fn String^Inspect::inspect(self, f) { continue l93; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_option_basic as "__test_0_option_basic" diff --git a/wado-compiler/tests/fixtures.golden/match_2.wir.wado b/wado-compiler/tests/fixtures.golden/match_2.wir.wado index 86c440317..cc3a8ab29 100644 --- a/wado-compiler/tests/fixtures.golden/match_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_2.wir.wado @@ -168,7 +168,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -178,9 +178,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -717,7 +717,7 @@ fn match_variant_tuple_payload() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Rectangle area: "), used: 16 }); + String::push_str(__local_5, String { repr: array.new_data("Rectangle area: "), used: 16 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; f64::fmt_into(area, __local_6); break __tmpl: __local_5; @@ -1515,8 +1515,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1571,8 +1571,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1604,7 +1604,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1733,27 +1733,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1874,9 +1874,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1930,13 +1930,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1971,9 +1971,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2026,7 +2026,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2041,7 +2041,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2079,7 +2079,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l235; }; @@ -2237,20 +2237,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2260,10 +2260,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2273,10 +2273,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2284,10 +2284,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/match_break_in_while.wir.wado b/wado-compiler/tests/fixtures.golden/match_break_in_while.wir.wado index 3c3ebbcfb..ee196a75a 100644 --- a/wado-compiler/tests/fixtures.golden/match_break_in_while.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_break_in_while.wir.wado @@ -66,9 +66,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -356,7 +356,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -371,7 +371,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -409,7 +409,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l37; }; @@ -443,20 +443,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -466,10 +466,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -479,10 +479,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -490,10 +490,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/match_break_many_arms.wir.wado b/wado-compiler/tests/fixtures.golden/match_break_many_arms.wir.wado index 45855f215..58633ce68 100644 --- a/wado-compiler/tests/fixtures.golden/match_break_many_arms.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_break_many_arms.wir.wado @@ -66,9 +66,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -394,7 +394,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -409,7 +409,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -447,7 +447,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l44; }; @@ -481,20 +481,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -504,10 +504,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -517,10 +517,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -528,10 +528,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/match_comprehensive.wir.wado b/wado-compiler/tests/fixtures.golden/match_comprehensive.wir.wado index d2d1b61a1..069a8f8eb 100644 --- a/wado-compiler/tests/fixtures.golden/match_comprehensive.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_comprehensive.wir.wado @@ -137,19 +137,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayIter>^Iterator::next" = fn(ref "core:allocator/ArrayIter>") -> ref null Option; -type "functype/Array>::append" = fn(ref Array>, ref Option); +type "functype/Array>::push" = fn(ref Array>, ref Option); type "functype/Array>::grow" = fn(ref Array>); type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref null Tree; -type "functype/Array::append" = fn(ref Array, ref Tree); +type "functype/Array::push" = fn(ref Array, ref Tree); type "functype/Array::grow" = fn(ref Array); @@ -197,11 +197,11 @@ fn match_with_struct() with Stdout { y = 10; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(43), used: 0 }; - String::append(__local_5, String { repr: array.new_data("destruct: "), used: 10 }); + String::push_str(__local_5, String { repr: array.new_data("destruct: "), used: 10 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_14 = __local_6; i32::fmt_decimal(x, __local_14); - String::append_char(__local_5, 44); + String::push(__local_5, 44); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_19 = __local_6; i32::fmt_decimal(y, __local_19); @@ -211,18 +211,18 @@ fn match_with_struct() with Stdout { b = 10; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(41), used: 0 }; - String::append_char(__local_7, 114); - String::append_char(__local_7, 101); - String::append_char(__local_7, 110); - String::append_char(__local_7, 97); - String::append_char(__local_7, 109); - String::append_char(__local_7, 101); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 114); + String::push(__local_7, 101); + String::push(__local_7, 110); + String::push(__local_7, 97); + String::push(__local_7, 109); + String::push(__local_7, 101); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_25 = __local_8; i32::fmt_decimal(a, __local_25); - String::append_char(__local_7, 44); + String::push(__local_7, 44); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_30 = __local_8; i32::fmt_decimal(b, __local_30); @@ -245,11 +245,11 @@ fn match_option_chained() with Stdout { n = ref.cast Option::Some(val).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 103); - String::append_char(__local_7, 111); - String::append_char(__local_7, 116); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 103); + String::push(__local_7, 111); + String::push(__local_7, 116); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(n, __local_8); break __tmpl: __local_7; @@ -293,13 +293,13 @@ fn match_option_chained() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 100); - String::append_char(__local_9, 101); - String::append_char(__local_9, 115); - String::append_char(__local_9, 99); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); - String::append(__local_9, desc); + String::push(__local_9, 100); + String::push(__local_9, 101); + String::push(__local_9, 115); + String::push(__local_9, 99); + String::push(__local_9, 58); + String::push(__local_9, 32); + String::push_str(__local_9, desc); break __tmpl: __local_9; }); } @@ -347,10 +347,10 @@ fn match_variant_comprehensive() with Stdout { __local_4 = __cast_3.payload_0; __tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_8, String { repr: array.new_data("small leaf("), used: 11 }); + String::push_str(__local_8, String { repr: array.new_data("small leaf("), used: 11 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(__local_4, __local_9); - String::append_char(__local_8, 41); + String::push(__local_8, 41); break __tmpl: __local_8; }; } else if ref.test Tree::Leaf(__match_scrut_0) -> ref String { @@ -359,15 +359,15 @@ fn match_variant_comprehensive() with Stdout { __local_5 = __cast_2.payload_0; __tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_10, 108); - String::append_char(__local_10, 101); - String::append_char(__local_10, 97); - String::append_char(__local_10, 102); - String::append_char(__local_10, 40); + String::push(__local_10, 108); + String::push(__local_10, 101); + String::push(__local_10, 97); + String::push(__local_10, 102); + String::push(__local_10, 40); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_35 = "core:internal/Box" { value: __local_5 }; i32::fmt_decimal(__local_35.value, __local_11); - String::append_char(__local_10, 41); + String::push(__local_10, 41); break __tmpl: __local_10; }; } else if ref.test Tree::Node(__match_scrut_0) -> ref String { @@ -376,21 +376,21 @@ fn match_variant_comprehensive() with Stdout { __local_6 = __cast_1.payload_0; __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_12, 110); - String::append_char(__local_12, 111); - String::append_char(__local_12, 100); - String::append_char(__local_12, 101); - String::append_char(__local_12, 40); + String::push(__local_12, 110); + String::push(__local_12, 111); + String::push(__local_12, 100); + String::push(__local_12, 101); + String::push(__local_12, 40); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_41 = "core:internal/Box" { value: __local_6.0 }; __local_42 = __local_13; i32::fmt_decimal(__local_41.value, __local_42); - String::append_char(__local_12, 44); + String::push(__local_12, 44); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_46 = "core:internal/Box" { value: __local_6.1 }; __local_47 = __local_13; i32::fmt_decimal(__local_46.value, __local_47); - String::append_char(__local_12, 41); + String::push(__local_12, 41); break __tmpl: __local_12; }; } else if __match_scrut_0.discriminant == 2 -> ref String { @@ -404,15 +404,15 @@ fn match_variant_comprehensive() with Stdout { __local_5 = __cast_2.payload_0; __tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_10, 108); - String::append_char(__local_10, 101); - String::append_char(__local_10, 97); - String::append_char(__local_10, 102); - String::append_char(__local_10, 40); + String::push(__local_10, 108); + String::push(__local_10, 101); + String::push(__local_10, 97); + String::push(__local_10, 102); + String::push(__local_10, 40); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_35 = "core:internal/Box" { value: __local_5 }; i32::fmt_decimal(__local_35.value, __local_11); - String::append_char(__local_10, 41); + String::push(__local_10, 41); break __tmpl: __local_10; }; } else if ref.test Tree::Node(__match_scrut_0) -> ref String { @@ -421,21 +421,21 @@ fn match_variant_comprehensive() with Stdout { __local_6 = __cast_1.payload_0; __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_12, 110); - String::append_char(__local_12, 111); - String::append_char(__local_12, 100); - String::append_char(__local_12, 101); - String::append_char(__local_12, 40); + String::push(__local_12, 110); + String::push(__local_12, 111); + String::push(__local_12, 100); + String::push(__local_12, 101); + String::push(__local_12, 40); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_41 = "core:internal/Box" { value: __local_6.0 }; __local_42 = __local_13; i32::fmt_decimal(__local_41.value, __local_42); - String::append_char(__local_12, 44); + String::push(__local_12, 44); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_46 = "core:internal/Box" { value: __local_6.1 }; __local_47 = __local_13; i32::fmt_decimal(__local_46.value, __local_47); - String::append_char(__local_12, 41); + String::push(__local_12, 41); break __tmpl: __local_12; }; } else if __match_scrut_0.discriminant == 2 -> ref String { @@ -490,10 +490,10 @@ fn match_in_loop() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_6, 115); - String::append_char(__local_6, 117); - String::append_char(__local_6, 109); - String::append_char(__local_6, 61); + String::push(__local_6, 115); + String::push(__local_6, 117); + String::push(__local_6, 109); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(sum, __local_7); break __tmpl: __local_6; @@ -521,7 +521,7 @@ fn matches_operator() with Stdout { val = Option::Some { discriminant: 0, payload_0: 42 }; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_5, String { repr: array.new_data("is_some: "), used: 9 }); + String::push_str(__local_5, String { repr: array.new_data("is_some: "), used: 9 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; Formatter::pad(__local_6, if let __match_scrut_0: ref Option; __match_scrut_0 = val; if ref.test Option::Some(__match_scrut_0) -> bool { let __cast_1: ref Option::Some; @@ -538,7 +538,7 @@ fn matches_operator() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_7, String { repr: array.new_data("is_none: "), used: 9 }); + String::push_str(__local_7, String { repr: array.new_data("is_none: "), used: 9 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; Formatter::pad(__local_8, if let __match_scrut_1: ref Option; __match_scrut_1 = val; if __match_scrut_1.discriminant == 1 -> bool { 1; @@ -554,14 +554,14 @@ fn matches_operator() with Stdout { big = Option::Some { discriminant: 0, payload_0: 100 }; "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_9, 105); - String::append_char(__local_9, 115); - String::append_char(__local_9, 95); - String::append_char(__local_9, 98); - String::append_char(__local_9, 105); - String::append_char(__local_9, 103); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 105); + String::push(__local_9, 115); + String::push(__local_9, 95); + String::push(__local_9, 98); + String::push(__local_9, 105); + String::push(__local_9, 103); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; Formatter::pad(__local_10, if let __match_scrut_2: ref Option; __match_scrut_2 = big; if ref.test Option::Some(__match_scrut_2) -> bool { let __cast_2: ref Option::Some; @@ -579,7 +579,7 @@ fn matches_operator() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_11, String { repr: array.new_data("is_small: "), used: 10 }); + String::push_str(__local_11, String { repr: array.new_data("is_small: "), used: 10 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; Formatter::pad(__local_12, if let __match_scrut_3: ref Option; __match_scrut_3 = big; if ref.test Option::Some(__match_scrut_3) -> bool { let __cast_3: ref Option::Some; @@ -598,7 +598,7 @@ fn matches_operator() with Stdout { tree = Tree::Leaf { discriminant: 0, payload_0: 5 }; "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_13, String { repr: array.new_data("is_leaf: "), used: 9 }); + String::push_str(__local_13, String { repr: array.new_data("is_leaf: "), used: 9 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; Formatter::pad(__local_14, if let __match_scrut_4: ref Tree; __match_scrut_4 = tree; if ref.test Tree::Leaf(__match_scrut_4) -> bool { let __cast_4: ref Tree::Leaf; @@ -615,7 +615,7 @@ fn matches_operator() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_15, String { repr: array.new_data("is_empty: "), used: 10 }); + String::push_str(__local_15, String { repr: array.new_data("is_empty: "), used: 10 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; Formatter::pad(__local_16, if let __match_scrut_5: ref Tree; __match_scrut_5 = tree; if __match_scrut_5.discriminant == 2 -> bool { 1; @@ -653,10 +653,10 @@ fn if_let_with_else() with Stdout { n = ref.cast Option::Some(v).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_5, 103); - String::append_char(__local_5, 111); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); + String::push(__local_5, 103); + String::push(__local_5, 111); + String::push(__local_5, 116); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(n, __local_6); break __tmpl: __local_5; @@ -881,7 +881,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -896,7 +896,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -933,7 +933,7 @@ fn ArrayIter>^Iterator::next(self) { return item; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -985,7 +985,7 @@ fn ArrayIter^Iterator::next(self) { return item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1038,7 +1038,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l73; }; @@ -1058,7 +1058,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1066,17 +1066,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1106,20 +1106,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1129,10 +1129,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1142,10 +1142,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1153,10 +1153,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/match_ergonomics.wir.wado b/wado-compiler/tests/fixtures.golden/match_ergonomics.wir.wado index 6b31fe4c1..55a6259f6 100644 --- a/wado-compiler/tests/fixtures.golden/match_ergonomics.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_ergonomics.wir.wado @@ -98,13 +98,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -176,49 +176,49 @@ fn match_ergonomics_if_let() with Stdout { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("match_ergonomics_if_let"), used: 23 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("match_ergonomics_if_let"), used: 23 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_27 = __local_15; i32::fmt_decimal(17, __local_27); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: *x == 42 "), used: 21 }); - String::append_char(__local_14, 120); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 120); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_32 = __local_15; __local_35 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_32.buf, __local_35); + String::push_str(__local_32.buf, __local_35); __local_33 = __v0; i32::fmt_decimal(__local_33.value, __local_32); - String::append_char(__local_14, 10); - String::append_char(__local_14, 42); - String::append_char(__local_14, 120); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 10); + String::push(__local_14, 42); + String::push(__local_14, 120); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_42 = __local_15; i32::fmt_decimal(__v1, __local_42); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_16, 103); - String::append_char(__local_16, 111); - String::append_char(__local_16, 116); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 103); + String::push(__local_16, 111); + String::push(__local_16, 116); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_47 = "core:internal/Box" { value: x.value }; i32::fmt_decimal(__local_47.value, __local_17); @@ -242,21 +242,21 @@ condition: *x == 42 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("match_ergonomics_if_let"), used: 23 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("match_ergonomics_if_let"), used: 23 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_54 = __local_19; i32::fmt_decimal(30, __local_54); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: is_some == true "), used: 28 }); - String::append(__local_18, String { repr: array.new_data("is_some: "), used: 9 }); + String::push_str(__local_18, String { repr: array.new_data("is_some: "), used: 9 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_59 = __local_19; Formatter::pad(__local_59, if is_some -> ref String { @@ -264,7 +264,7 @@ condition: is_some == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -282,21 +282,21 @@ condition: is_some == true if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("match_ergonomics_if_let"), used: 23 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("match_ergonomics_if_let"), used: 23 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_65 = __local_21; i32::fmt_decimal(33, __local_65); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: is_none == false "), used: 29 }); - String::append(__local_20, String { repr: array.new_data("is_none: "), used: 9 }); + String::push_str(__local_20, String { repr: array.new_data("is_none: "), used: 9 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_70 = __local_21; Formatter::pad(__local_70, if is_none -> ref String { @@ -304,7 +304,7 @@ condition: is_none == false } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -350,29 +350,29 @@ fn match_ergonomics_match() with Stdout { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("match_ergonomics_match"), used: 22 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("match_ergonomics_match"), used: 22 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_25 = __local_17; i32::fmt_decimal(48, __local_25); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: name == \"red\" "), used: 26 }); - String::append_char(__local_16, 110); - String::append_char(__local_16, 97); - String::append_char(__local_16, 109); - String::append_char(__local_16, 101); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 110); + String::push(__local_16, 97); + String::push(__local_16, 109); + String::push(__local_16, 101); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_3, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -393,29 +393,29 @@ condition: name == \"red\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("match_ergonomics_match"), used: 22 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("match_ergonomics_match"), used: 22 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_32 = __local_19; i32::fmt_decimal(57, __local_32); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: val == 42 "), used: 22 }); - String::append_char(__local_18, 118); - String::append_char(__local_18, 97); - String::append_char(__local_18, 108); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 118); + String::push(__local_18, 97); + String::push(__local_18, 108); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_37 = __local_19; i32::fmt_decimal(val, __local_37); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -430,30 +430,30 @@ condition: val == 42 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("match_ergonomics_match"), used: 22 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("match_ergonomics_match"), used: 22 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics.wado"), used: 50 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_43 = __local_21; i32::fmt_decimal(67, __local_43); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: label == \"medium\" "), used: 30 }); - String::append_char(__local_20, 108); - String::append_char(__local_20, 97); - String::append_char(__local_20, 98); - String::append_char(__local_20, 101); - String::append_char(__local_20, 108); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 108); + String::push(__local_20, 97); + String::push(__local_20, 98); + String::push(__local_20, 101); + String::push(__local_20, 108); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; String^Inspect::inspect(__v0_14, __local_21); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -699,7 +699,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -787,7 +787,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -825,7 +825,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l52; }; @@ -845,7 +845,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -853,17 +853,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -893,20 +893,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -916,10 +916,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -929,10 +929,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -940,10 +940,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -955,7 +955,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -972,22 +972,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b75; @@ -995,7 +995,7 @@ fn String^Inspect::inspect(self, f) { continue l76; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/match_ergonomics_let_destructure.wir.wado b/wado-compiler/tests/fixtures.golden/match_ergonomics_let_destructure.wir.wado index 23179e750..ed6c752e7 100644 --- a/wado-compiler/tests/fixtures.golden/match_ergonomics_let_destructure.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_ergonomics_let_destructure.wir.wado @@ -82,9 +82,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -143,38 +143,38 @@ fn test_let_struct_ref() with Stdout { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("test_let_struct_ref"), used: 19 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("test_let_struct_ref"), used: 19 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_17 = __local_10; i32::fmt_decimal(12, __local_17); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: *x == 10 "), used: 21 }); - String::append_char(__local_9, 120); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 120); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_22 = __local_10; __local_25 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_22.buf, __local_25); + String::push_str(__local_22.buf, __local_25); __local_23 = __v0_3; i32::fmt_decimal(__local_23.value, __local_22); - String::append_char(__local_9, 10); - String::append_char(__local_9, 42); - String::append_char(__local_9, 120); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 10); + String::push(__local_9, 42); + String::push(__local_9, 120); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_32 = __local_10; i32::fmt_decimal(__v1_4, __local_32); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -185,38 +185,38 @@ condition: *x == 10 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("test_let_struct_ref"), used: 19 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("test_let_struct_ref"), used: 19 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_38 = __local_12; i32::fmt_decimal(13, __local_38); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: *y == 20 "), used: 21 }); - String::append_char(__local_11, 121); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 121); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_43 = __local_12; __local_46 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_43.buf, __local_46); + String::push_str(__local_43.buf, __local_46); __local_44 = __v0_6; i32::fmt_decimal(__local_44.value, __local_43); - String::append_char(__local_11, 10); - String::append_char(__local_11, 42); - String::append_char(__local_11, 121); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 10); + String::push(__local_11, 42); + String::push(__local_11, 121); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_53 = __local_12; i32::fmt_decimal(__v1_7, __local_53); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -268,39 +268,39 @@ fn test_let_struct_mut_ref() with Stdout { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("test_let_struct_mut_ref"), used: 23 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("test_let_struct_mut_ref"), used: 23 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_22 = __local_13; i32::fmt_decimal(22, __local_22); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: *x == 10 "), used: 21 }); - String::append_char(__local_12, 120); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 120); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_26 = __v0_3; __local_27 = __local_13; __local_30 = String { repr: array.new_data("&mut "), used: 5 }; - String::append(__local_27.buf, __local_30); + String::push_str(__local_27.buf, __local_30); __local_28 = __local_26; i32::fmt_decimal(__local_28.value, __local_27); - String::append_char(__local_12, 10); - String::append_char(__local_12, 42); - String::append_char(__local_12, 120); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 10); + String::push(__local_12, 42); + String::push(__local_12, 120); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_37 = __local_13; i32::fmt_decimal(__v1_4, __local_37); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -311,39 +311,39 @@ condition: *x == 10 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("test_let_struct_mut_ref"), used: 23 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("test_let_struct_mut_ref"), used: 23 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_43 = __local_15; i32::fmt_decimal(23, __local_43); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: *y == 20 "), used: 21 }); - String::append_char(__local_14, 121); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 121); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_47 = __v0_6; __local_48 = __local_15; __local_51 = String { repr: array.new_data("&mut "), used: 5 }; - String::append(__local_48.buf, __local_51); + String::push_str(__local_48.buf, __local_51); __local_49 = __local_47; i32::fmt_decimal(__local_49.value, __local_48); - String::append_char(__local_14, 10); - String::append_char(__local_14, 42); - String::append_char(__local_14, 121); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 10); + String::push(__local_14, 42); + String::push(__local_14, 121); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_58 = __local_15; i32::fmt_decimal(__v1_7, __local_58); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -355,39 +355,39 @@ condition: *y == 20 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("test_let_struct_mut_ref"), used: 23 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("test_let_struct_mut_ref"), used: 23 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_64 = __local_17; i32::fmt_decimal(25, __local_64); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: *x == 100 "), used: 22 }); - String::append_char(__local_16, 120); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 120); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_68 = __v0_9; __local_69 = __local_17; __local_72 = String { repr: array.new_data("&mut "), used: 5 }; - String::append(__local_69.buf, __local_72); + String::push_str(__local_69.buf, __local_72); __local_70 = __local_68; i32::fmt_decimal(__local_70.value, __local_69); - String::append_char(__local_16, 10); - String::append_char(__local_16, 42); - String::append_char(__local_16, 120); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 10); + String::push(__local_16, 42); + String::push(__local_16, 120); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_79 = __local_17; i32::fmt_decimal(__v1_10, __local_79); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -426,38 +426,38 @@ fn test_let_tuple_ref() with Stdout { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("test_let_tuple_ref"), used: 18 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("test_let_tuple_ref"), used: 18 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_17 = __local_10; i32::fmt_decimal(33, __local_17); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: *a == 10 "), used: 21 }); - String::append_char(__local_9, 97); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_22 = __local_10; __local_25 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_22.buf, __local_25); + String::push_str(__local_22.buf, __local_25); __local_23 = __v0_3; i32::fmt_decimal(__local_23.value, __local_22); - String::append_char(__local_9, 10); - String::append_char(__local_9, 42); - String::append_char(__local_9, 97); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 10); + String::push(__local_9, 42); + String::push(__local_9, 97); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_32 = __local_10; i32::fmt_decimal(__v1_4, __local_32); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -468,38 +468,38 @@ condition: *a == 10 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("test_let_tuple_ref"), used: 18 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("test_let_tuple_ref"), used: 18 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_let_destructure.wado"), used: 66 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_38 = __local_12; i32::fmt_decimal(34, __local_38); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: *b == 20 "), used: 21 }); - String::append_char(__local_11, 98); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 98); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_43 = __local_12; __local_46 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_43.buf, __local_46); + String::push_str(__local_43.buf, __local_46); __local_44 = __v0_6; i32::fmt_decimal(__local_44.value, __local_43); - String::append_char(__local_11, 10); - String::append_char(__local_11, 42); - String::append_char(__local_11, 98); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 10); + String::push(__local_11, 42); + String::push(__local_11, 98); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_53 = __local_12; i32::fmt_decimal(__v1_7, __local_53); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -747,7 +747,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -762,7 +762,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -800,7 +800,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -834,20 +834,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -857,10 +857,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -870,10 +870,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -881,10 +881,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/match_ergonomics_mut_ref.wir.wado b/wado-compiler/tests/fixtures.golden/match_ergonomics_mut_ref.wir.wado index 275c6e0ed..cb0837c2e 100644 --- a/wado-compiler/tests/fixtures.golden/match_ergonomics_mut_ref.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_ergonomics_mut_ref.wir.wado @@ -92,9 +92,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -156,39 +156,39 @@ fn test_mut_ref_if_let() with Stdout { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("test_mut_ref_if_let"), used: 19 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_mut_ref.wado"), used: 58 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("test_mut_ref_if_let"), used: 19 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_mut_ref.wado"), used: 58 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_17 = __local_10; i32::fmt_decimal(9, __local_17); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: *x == 42 "), used: 21 }); - String::append_char(__local_9, 120); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 120); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_21 = __v0_3; __local_22 = __local_10; __local_25 = String { repr: array.new_data("&mut "), used: 5 }; - String::append(__local_22.buf, __local_25); + String::push_str(__local_22.buf, __local_25); __local_23 = __local_21; i32::fmt_decimal(__local_23.value, __local_22); - String::append_char(__local_9, 10); - String::append_char(__local_9, 42); - String::append_char(__local_9, 120); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 10); + String::push(__local_9, 42); + String::push(__local_9, 120); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_32 = __local_10; i32::fmt_decimal(__v1_4, __local_32); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -200,39 +200,39 @@ condition: *x == 42 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("test_mut_ref_if_let"), used: 19 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_mut_ref.wado"), used: 58 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("test_mut_ref_if_let"), used: 19 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_mut_ref.wado"), used: 58 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_38 = __local_12; i32::fmt_decimal(11, __local_38); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: *x == 100 "), used: 22 }); - String::append_char(__local_11, 120); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 120); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_42 = __v0_6; __local_43 = __local_12; __local_46 = String { repr: array.new_data("&mut "), used: 5 }; - String::append(__local_43.buf, __local_46); + String::push_str(__local_43.buf, __local_46); __local_44 = __local_42; i32::fmt_decimal(__local_44.value, __local_43); - String::append_char(__local_11, 10); - String::append_char(__local_11, 42); - String::append_char(__local_11, 120); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 10); + String::push(__local_11, 42); + String::push(__local_11, 120); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_53 = __local_12; i32::fmt_decimal(__v1_7, __local_53); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -274,39 +274,39 @@ fn test_mut_ref_match() with Stdout { if __local_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("test_mut_ref_match"), used: 18 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_mut_ref.wado"), used: 58 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("test_mut_ref_match"), used: 18 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_mut_ref.wado"), used: 58 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_16 = __local_10; i32::fmt_decimal(22, __local_16); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: *x == 10 "), used: 21 }); - String::append_char(__local_9, 120); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 120); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_20 = __local_3; __local_21 = __local_10; __local_24 = String { repr: array.new_data("&mut "), used: 5 }; - String::append(__local_21.buf, __local_24); + String::push_str(__local_21.buf, __local_24); __local_22 = __local_20; i32::fmt_decimal(__local_22.value, __local_21); - String::append_char(__local_9, 10); - String::append_char(__local_9, 42); - String::append_char(__local_9, 120); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 10); + String::push(__local_9, 42); + String::push(__local_9, 120); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_31 = __local_10; i32::fmt_decimal(__local_4, __local_31); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -322,29 +322,29 @@ condition: *x == 10 if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("test_mut_ref_match"), used: 18 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_mut_ref.wado"), used: 58 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("test_mut_ref_match"), used: 18 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_mut_ref.wado"), used: 58 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_37 = __local_12; i32::fmt_decimal(28, __local_37); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: val == 20 "), used: 22 }); - String::append_char(__local_11, 118); - String::append_char(__local_11, 97); - String::append_char(__local_11, 108); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 118); + String::push(__local_11, 97); + String::push(__local_11, 108); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_42 = __local_12; i32::fmt_decimal(val, __local_42); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -374,38 +374,38 @@ fn test_ref_if_let_unchanged() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_ref_if_let_unchanged"), used: 25 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_mut_ref.wado"), used: 58 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_ref_if_let_unchanged"), used: 25 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_ergonomics_mut_ref.wado"), used: 58 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(37, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: *x == 42 "), used: 21 }); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; __local_20 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_17.buf, __local_20); + String::push_str(__local_17.buf, __local_20); __local_18 = __v0; i32::fmt_decimal(__local_18.value, __local_17); - String::append_char(__local_6, 10); - String::append_char(__local_6, 42); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 10); + String::push(__local_6, 42); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_27 = __local_7; i32::fmt_decimal(__v1, __local_27); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -654,7 +654,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -669,7 +669,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -707,7 +707,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l33; }; @@ -741,20 +741,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -764,10 +764,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -777,10 +777,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -788,10 +788,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/match_or_pattern_1.wir.wado b/wado-compiler/tests/fixtures.golden/match_or_pattern_1.wir.wado index 658010dea..6b747fa4f 100644 --- a/wado-compiler/tests/fixtures.golden/match_or_pattern_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_or_pattern_1.wir.wado @@ -72,13 +72,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -147,26 +147,26 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(155), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_1.wado"), used: 52 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_1.wado"), used: 52 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; i32::fmt_decimal(15, __local_17); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: describe(Color::Red) == \"cool\" "), used: 43 }); - String::append(__local_6, String { repr: array.new_data("describe(Color::Red): "), used: 22 }); + String::push_str(__local_6, String { repr: array.new_data("describe(Color::Red): "), used: 22 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0_0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -190,26 +190,26 @@ condition: describe(Color::Red) == \"cool\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_1.wado"), used: 52 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_1.wado"), used: 52 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_25 = __local_9; i32::fmt_decimal(16, __local_25); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: describe(Color::Blue) == \"cool\" "), used: 44 }); - String::append(__local_8, String { repr: array.new_data("describe(Color::Blue): "), used: 23 }); + String::push_str(__local_8, String { repr: array.new_data("describe(Color::Blue): "), used: 23 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0_2, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -233,26 +233,26 @@ condition: describe(Color::Blue) == \"cool\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(159), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_1.wado"), used: 52 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_1.wado"), used: 52 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_33 = __local_11; i32::fmt_decimal(17, __local_33); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: describe(Color::Green) == \"warm\" "), used: 45 }); - String::append(__local_10, String { repr: array.new_data("describe(Color::Green): "), used: 24 }); + String::push_str(__local_10, String { repr: array.new_data("describe(Color::Green): "), used: 24 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_4, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -455,7 +455,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -543,7 +543,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -581,7 +581,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l44; }; @@ -615,20 +615,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -638,10 +638,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -651,10 +651,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -662,10 +662,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -677,7 +677,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -694,22 +694,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b63; @@ -717,7 +717,7 @@ fn String^Inspect::inspect(self, f) { continue l64; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/match_or_pattern_2.wir.wado b/wado-compiler/tests/fixtures.golden/match_or_pattern_2.wir.wado index a021abe11..db86f3b0d 100644 --- a/wado-compiler/tests/fixtures.golden/match_or_pattern_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_or_pattern_2.wir.wado @@ -85,9 +85,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -156,23 +156,23 @@ fn run() { if __v0_0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(181), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_2.wado"), used: 52 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_2.wado"), used: 52 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; i32::fmt_decimal(12, __local_17); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: is_round_or_square(Shape::Circle(1.0)) "), used: 51 }); - String::append(__local_6, String { repr: array.new_data("is_round_or_square(Shape::Circle(1.0)): "), used: 40 }); + String::push_str(__local_6, String { repr: array.new_data("is_round_or_square(Shape::Circle(1.0)): "), used: 40 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_22 = __local_7; Formatter::pad(__local_22, if __v0_0 -> ref String { @@ -180,7 +180,7 @@ condition: is_round_or_square(Shape::Circle(1.0)) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -205,23 +205,23 @@ condition: is_round_or_square(Shape::Circle(1.0)) if __v0_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(181), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_2.wado"), used: 52 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_2.wado"), used: 52 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_29 = __local_9; i32::fmt_decimal(13, __local_29); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: is_round_or_square(Shape::Square(2.0)) "), used: 51 }); - String::append(__local_8, String { repr: array.new_data("is_round_or_square(Shape::Square(2.0)): "), used: 40 }); + String::push_str(__local_8, String { repr: array.new_data("is_round_or_square(Shape::Square(2.0)): "), used: 40 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_34 = __local_9; Formatter::pad(__local_34, if __v0_2 -> ref String { @@ -229,7 +229,7 @@ condition: is_round_or_square(Shape::Square(2.0)) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -255,23 +255,23 @@ condition: is_round_or_square(Shape::Square(2.0)) if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(186), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_2.wado"), used: 52 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_2.wado"), used: 52 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_41 = __local_11; i32::fmt_decimal(14, __local_41); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: !is_round_or_square(Shape::Triangle(3.0)) "), used: 54 }); - String::append(__local_10, String { repr: array.new_data("is_round_or_square(Shape::Triangle(3.0)): "), used: 42 }); + String::push_str(__local_10, String { repr: array.new_data("is_round_or_square(Shape::Triangle(3.0)): "), used: 42 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_46 = __local_11; Formatter::pad(__local_46, if __v0_4 -> ref String { @@ -279,7 +279,7 @@ condition: !is_round_or_square(Shape::Triangle(3.0)) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -482,7 +482,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -497,7 +497,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -535,7 +535,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -555,7 +555,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -563,17 +563,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -603,20 +603,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -626,10 +626,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -639,10 +639,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -650,10 +650,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/match_or_pattern_3.wir.wado b/wado-compiler/tests/fixtures.golden/match_or_pattern_3.wir.wado index 10779b241..d2cb33339 100644 --- a/wado-compiler/tests/fixtures.golden/match_or_pattern_3.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_or_pattern_3.wir.wado @@ -70,13 +70,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -164,26 +164,26 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_33 = __local_15; i32::fmt_decimal(10, __local_33); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: classify(1) == \"low\" "), used: 33 }); - String::append(__local_14, String { repr: array.new_data("classify(1): "), used: 13 }); + String::push_str(__local_14, String { repr: array.new_data("classify(1): "), used: 13 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; String^Inspect::inspect(__v0_0, __local_15); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -209,26 +209,26 @@ condition: classify(1) == \"low\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_41 = __local_17; i32::fmt_decimal(11, __local_41); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: classify(2) == \"low\" "), used: 33 }); - String::append(__local_16, String { repr: array.new_data("classify(2): "), used: 13 }); + String::push_str(__local_16, String { repr: array.new_data("classify(2): "), used: 13 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_2, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -254,26 +254,26 @@ condition: classify(2) == \"low\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_49 = __local_19; i32::fmt_decimal(12, __local_49); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: classify(3) == \"low\" "), used: 33 }); - String::append(__local_18, String { repr: array.new_data("classify(3): "), used: 13 }); + String::push_str(__local_18, String { repr: array.new_data("classify(3): "), used: 13 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; String^Inspect::inspect(__v0_4, __local_19); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -299,26 +299,26 @@ condition: classify(3) == \"low\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_57 = __local_21; i32::fmt_decimal(13, __local_57); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: classify(4) == \"mid\" "), used: 33 }); - String::append(__local_20, String { repr: array.new_data("classify(4): "), used: 13 }); + String::push_str(__local_20, String { repr: array.new_data("classify(4): "), used: 13 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; String^Inspect::inspect(__v0_6, __local_21); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -344,26 +344,26 @@ condition: classify(4) == \"mid\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_65 = __local_23; i32::fmt_decimal(14, __local_65); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: classify(5) == \"mid\" "), used: 33 }); - String::append(__local_22, String { repr: array.new_data("classify(5): "), used: 13 }); + String::push_str(__local_22, String { repr: array.new_data("classify(5): "), used: 13 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; String^Inspect::inspect(__v0_8, __local_23); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -389,26 +389,26 @@ condition: classify(5) == \"mid\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_73 = __local_25; i32::fmt_decimal(15, __local_73); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: classify(6) == \"mid\" "), used: 33 }); - String::append(__local_24, String { repr: array.new_data("classify(6): "), used: 13 }); + String::push_str(__local_24, String { repr: array.new_data("classify(6): "), used: 13 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; String^Inspect::inspect(__v0_10, __local_25); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -434,26 +434,26 @@ condition: classify(6) == \"mid\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_26, 114); - String::append_char(__local_26, 117); - String::append_char(__local_26, 110); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_26, 114); + String::push(__local_26, 117); + String::push(__local_26, 110); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_3.wado"), used: 52 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_81 = __local_27; i32::fmt_decimal(16, __local_81); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: classify(7) == \"high\" "), used: 34 }); - String::append(__local_26, String { repr: array.new_data("classify(7): "), used: 13 }); + String::push_str(__local_26, String { repr: array.new_data("classify(7): "), used: 13 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; String^Inspect::inspect(__v0_12, __local_27); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -656,7 +656,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -744,7 +744,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -782,7 +782,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l81; }; @@ -816,20 +816,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -839,10 +839,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -852,10 +852,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -863,10 +863,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -878,7 +878,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -895,22 +895,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b100; @@ -918,7 +918,7 @@ fn String^Inspect::inspect(self, f) { continue l101; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/match_or_pattern_5.wir.wado b/wado-compiler/tests/fixtures.golden/match_or_pattern_5.wir.wado index bea836cfb..b7e93791c 100644 --- a/wado-compiler/tests/fixtures.golden/match_or_pattern_5.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_or_pattern_5.wir.wado @@ -82,9 +82,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -162,27 +162,27 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_5.wado"), used: 52 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_5.wado"), used: 52 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_16 = __local_7; i32::fmt_decimal(18, __local_16); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: abs_value(Expr::Num(5)) == 5 "), used: 41 }); - String::append(__local_6, String { repr: array.new_data("abs_value(Expr::Num(5)): "), used: 25 }); + String::push_str(__local_6, String { repr: array.new_data("abs_value(Expr::Num(5)): "), used: 25 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_21 = __local_7; i32::fmt_decimal(__v0_0, __local_21); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -192,27 +192,27 @@ condition: abs_value(Expr::Num(5)) == 5 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_5.wado"), used: 52 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_5.wado"), used: 52 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_27 = __local_9; i32::fmt_decimal(19, __local_27); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: abs_value(Expr::Neg(-3)) == 3 "), used: 42 }); - String::append(__local_8, String { repr: array.new_data("abs_value(Expr::Neg(-3)): "), used: 26 }); + String::push_str(__local_8, String { repr: array.new_data("abs_value(Expr::Neg(-3)): "), used: 26 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_32 = __local_9; i32::fmt_decimal(__v0_2, __local_32); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -222,27 +222,27 @@ condition: abs_value(Expr::Neg(-3)) == 3 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_5.wado"), used: 52 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_5.wado"), used: 52 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_38 = __local_11; i32::fmt_decimal(20, __local_38); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: abs_value(Expr::Zero) == 0 "), used: 39 }); - String::append(__local_10, String { repr: array.new_data("abs_value(Expr::Zero): "), used: 23 }); + String::push_str(__local_10, String { repr: array.new_data("abs_value(Expr::Zero): "), used: 23 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_43 = __local_11; i32::fmt_decimal(__v0_4, __local_43); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -445,7 +445,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -460,7 +460,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -498,7 +498,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -532,20 +532,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -555,10 +555,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -568,10 +568,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -579,10 +579,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/match_or_pattern_6.wir.wado b/wado-compiler/tests/fixtures.golden/match_or_pattern_6.wir.wado index bdb0b62d9..0c19daf87 100644 --- a/wado-compiler/tests/fixtures.golden/match_or_pattern_6.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_or_pattern_6.wir.wado @@ -72,13 +72,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -170,23 +170,23 @@ fn run() { if __v0_0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(165), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_29 = __local_13; i32::fmt_decimal(23, __local_29); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: is_horizontal(Direction::East) "), used: 43 }); - String::append(__local_12, String { repr: array.new_data("is_horizontal(Direction::East): "), used: 32 }); + String::push_str(__local_12, String { repr: array.new_data("is_horizontal(Direction::East): "), used: 32 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_34 = __local_13; Formatter::pad(__local_34, if __v0_0 -> ref String { @@ -194,7 +194,7 @@ condition: is_horizontal(Direction::East) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -219,23 +219,23 @@ condition: is_horizontal(Direction::East) if __v0_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(165), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_41 = __local_15; i32::fmt_decimal(24, __local_41); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: is_horizontal(Direction::West) "), used: 43 }); - String::append(__local_14, String { repr: array.new_data("is_horizontal(Direction::West): "), used: 32 }); + String::push_str(__local_14, String { repr: array.new_data("is_horizontal(Direction::West): "), used: 32 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_46 = __local_15; Formatter::pad(__local_46, if __v0_2 -> ref String { @@ -243,7 +243,7 @@ condition: is_horizontal(Direction::West) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -269,23 +269,23 @@ condition: is_horizontal(Direction::West) if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(168), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_53 = __local_17; i32::fmt_decimal(25, __local_53); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: !is_horizontal(Direction::North) "), used: 45 }); - String::append(__local_16, String { repr: array.new_data("is_horizontal(Direction::North): "), used: 33 }); + String::push_str(__local_16, String { repr: array.new_data("is_horizontal(Direction::North): "), used: 33 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_58 = __local_17; Formatter::pad(__local_58, if __v0_4 -> ref String { @@ -293,7 +293,7 @@ condition: !is_horizontal(Direction::North) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -319,23 +319,23 @@ condition: !is_horizontal(Direction::North) if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(168), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_65 = __local_19; i32::fmt_decimal(26, __local_65); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: !is_horizontal(Direction::South) "), used: 45 }); - String::append(__local_18, String { repr: array.new_data("is_horizontal(Direction::South): "), used: 33 }); + String::push_str(__local_18, String { repr: array.new_data("is_horizontal(Direction::South): "), used: 33 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_70 = __local_19; Formatter::pad(__local_70, if __v0_6 -> ref String { @@ -343,7 +343,7 @@ condition: !is_horizontal(Direction::South) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -369,26 +369,26 @@ condition: !is_horizontal(Direction::South) if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(171), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_77 = __local_21; i32::fmt_decimal(28, __local_77); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: describe(Direction::North) == \"vertical\" "), used: 53 }); - String::append(__local_20, String { repr: array.new_data("describe(Direction::North): "), used: 28 }); + String::push_str(__local_20, String { repr: array.new_data("describe(Direction::North): "), used: 28 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; String^Inspect::inspect(__v0_8, __local_21); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -414,26 +414,26 @@ condition: describe(Direction::North) == \"vertical\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(171), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_6.wado"), used: 52 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_85 = __local_23; i32::fmt_decimal(29, __local_85); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: describe(Direction::East) == \"horizontal\" "), used: 54 }); - String::append(__local_22, String { repr: array.new_data("describe(Direction::East): "), used: 27 }); + String::push_str(__local_22, String { repr: array.new_data("describe(Direction::East): "), used: 27 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; String^Inspect::inspect(__v0_10, __local_23); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -636,7 +636,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -724,7 +724,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -762,7 +762,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l66; }; @@ -782,7 +782,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -790,17 +790,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -830,20 +830,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -853,10 +853,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -866,10 +866,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -877,10 +877,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -892,7 +892,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -909,22 +909,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b89; @@ -932,7 +932,7 @@ fn String^Inspect::inspect(self, f) { continue l90; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/match_or_pattern_iflet_1.wir.wado b/wado-compiler/tests/fixtures.golden/match_or_pattern_iflet_1.wir.wado index da744e439..ca4acb9ca 100644 --- a/wado-compiler/tests/fixtures.golden/match_or_pattern_iflet_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_or_pattern_iflet_1.wir.wado @@ -98,9 +98,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -198,23 +198,23 @@ fn run() { if __v0_0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(161), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_30 = __local_13; i32::fmt_decimal(27, __local_30); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: is_sized(Shape::Circle(1.0)) "), used: 41 }); - String::append(__local_12, String { repr: array.new_data("is_sized(Shape::Circle(1.0)): "), used: 30 }); + String::push_str(__local_12, String { repr: array.new_data("is_sized(Shape::Circle(1.0)): "), used: 30 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_35 = __local_13; Formatter::pad(__local_35, if __v0_0 -> ref String { @@ -222,7 +222,7 @@ condition: is_sized(Shape::Circle(1.0)) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -241,23 +241,23 @@ condition: is_sized(Shape::Circle(1.0)) if __v0_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(161), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_43 = __local_15; i32::fmt_decimal(28, __local_43); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: is_sized(Shape::Square(2.0)) "), used: 41 }); - String::append(__local_14, String { repr: array.new_data("is_sized(Shape::Square(2.0)): "), used: 30 }); + String::push_str(__local_14, String { repr: array.new_data("is_sized(Shape::Square(2.0)): "), used: 30 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_48 = __local_15; Formatter::pad(__local_48, if __v0_2 -> ref String { @@ -265,7 +265,7 @@ condition: is_sized(Shape::Square(2.0)) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -285,23 +285,23 @@ condition: is_sized(Shape::Square(2.0)) if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_56 = __local_17; i32::fmt_decimal(29, __local_56); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: !is_sized(Shape::Point) "), used: 36 }); - String::append(__local_16, String { repr: array.new_data("is_sized(Shape::Point): "), used: 24 }); + String::push_str(__local_16, String { repr: array.new_data("is_sized(Shape::Point): "), used: 24 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_61 = __local_17; Formatter::pad(__local_61, if __v0_4 -> ref String { @@ -309,7 +309,7 @@ condition: !is_sized(Shape::Point) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -319,27 +319,27 @@ condition: !is_sized(Shape::Point) if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(159), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_67 = __local_19; i32::fmt_decimal(32, __local_67); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: get_value(Expr::Num(42)) == 42 "), used: 43 }); - String::append(__local_18, String { repr: array.new_data("get_value(Expr::Num(42)): "), used: 26 }); + String::push_str(__local_18, String { repr: array.new_data("get_value(Expr::Num(42)): "), used: 26 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_72 = __local_19; i32::fmt_decimal(__v0_6, __local_72); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -349,27 +349,27 @@ condition: get_value(Expr::Num(42)) == 42 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(159), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_78 = __local_21; i32::fmt_decimal(33, __local_78); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: get_value(Expr::Neg(-5)) == -5 "), used: 43 }); - String::append(__local_20, String { repr: array.new_data("get_value(Expr::Neg(-5)): "), used: 26 }); + String::push_str(__local_20, String { repr: array.new_data("get_value(Expr::Neg(-5)): "), used: 26 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_83 = __local_21; i32::fmt_decimal(__v0_8, __local_83); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -379,27 +379,27 @@ condition: get_value(Expr::Neg(-5)) == -5 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/match_or_pattern_iflet_1.wado"), used: 58 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_89 = __local_23; i32::fmt_decimal(34, __local_89); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: get_value(Expr::Zero) == 0 "), used: 39 }); - String::append(__local_22, String { repr: array.new_data("get_value(Expr::Zero): "), used: 23 }); + String::push_str(__local_22, String { repr: array.new_data("get_value(Expr::Zero): "), used: 23 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_94 = __local_23; i32::fmt_decimal(__v0_10, __local_94); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -602,7 +602,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -617,7 +617,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -655,7 +655,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l42; }; @@ -675,7 +675,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -683,17 +683,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -723,20 +723,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -746,10 +746,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -759,10 +759,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -770,10 +770,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/match_return_from_arm.wir.wado b/wado-compiler/tests/fixtures.golden/match_return_from_arm.wir.wado index 56228ed8e..8d879293a 100644 --- a/wado-compiler/tests/fixtures.golden/match_return_from_arm.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_return_from_arm.wir.wado @@ -72,13 +72,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -182,26 +182,26 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_40 = __local_19; i32::fmt_decimal(38, __local_40); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: lookup(\"a\") == \"alpha\" "), used: 35 }); - String::append(__local_18, String { repr: array.new_data("lookup(\"a\"): "), used: 13 }); + String::push_str(__local_18, String { repr: array.new_data("lookup(\"a\"): "), used: 13 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; String^Inspect::inspect(__v0_0, __local_19); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -211,26 +211,26 @@ condition: lookup(\"a\") == \"alpha\" if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_47 = __local_21; i32::fmt_decimal(39, __local_47); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: lookup(\"b\") == \"beta\" "), used: 34 }); - String::append(__local_20, String { repr: array.new_data("lookup(\"b\"): "), used: 13 }); + String::push_str(__local_20, String { repr: array.new_data("lookup(\"b\"): "), used: 13 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; String^Inspect::inspect(__v0_2, __local_21); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -240,26 +240,26 @@ condition: lookup(\"b\") == \"beta\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_54 = __local_23; i32::fmt_decimal(40, __local_54); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: lookup(\"z\") == \"unknown\" "), used: 37 }); - String::append(__local_22, String { repr: array.new_data("lookup(\"z\"): "), used: 13 }); + String::push_str(__local_22, String { repr: array.new_data("lookup(\"z\"): "), used: 13 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; String^Inspect::inspect(__v0_4, __local_23); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -282,26 +282,26 @@ condition: lookup(\"z\") == \"unknown\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_63 = __local_25; i32::fmt_decimal(42, __local_63); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: classify(1) == \"one\" "), used: 33 }); - String::append(__local_24, String { repr: array.new_data("classify(1): "), used: 13 }); + String::push_str(__local_24, String { repr: array.new_data("classify(1): "), used: 13 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; String^Inspect::inspect(__v0_6, __local_25); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -324,26 +324,26 @@ condition: classify(1) == \"one\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_26, 114); - String::append_char(__local_26, 117); - String::append_char(__local_26, 110); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_26, 114); + String::push(__local_26, 117); + String::push(__local_26, 110); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_72 = __local_27; i32::fmt_decimal(43, __local_72); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: classify(2) == \"two\" "), used: 33 }); - String::append(__local_26, String { repr: array.new_data("classify(2): "), used: 13 }); + String::push_str(__local_26, String { repr: array.new_data("classify(2): "), used: 13 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; String^Inspect::inspect(__v0_8, __local_27); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -366,26 +366,26 @@ condition: classify(2) == \"two\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_28, 114); - String::append_char(__local_28, 117); - String::append_char(__local_28, 110); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_28, 114); + String::push(__local_28, 117); + String::push(__local_28, 110); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_81 = __local_29; i32::fmt_decimal(44, __local_81); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: classify(3) == \"other\" "), used: 35 }); - String::append(__local_28, String { repr: array.new_data("classify(3): "), used: 13 }); + String::push_str(__local_28, String { repr: array.new_data("classify(3): "), used: 13 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; String^Inspect::inspect(__v0_10, __local_29); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -408,26 +408,26 @@ condition: classify(3) == \"other\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_30, 114); - String::append_char(__local_30, 117); - String::append_char(__local_30, 110); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_30, 114); + String::push(__local_30, 117); + String::push(__local_30, 110); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_90 = __local_31; i32::fmt_decimal(46, __local_90); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: classify_inline(1) == \"one\" "), used: 40 }); - String::append(__local_30, String { repr: array.new_data("classify_inline(1): "), used: 20 }); + String::push_str(__local_30, String { repr: array.new_data("classify_inline(1): "), used: 20 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; String^Inspect::inspect(__v0_12, __local_31); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -450,26 +450,26 @@ condition: classify_inline(1) == \"one\" if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_32, 114); - String::append_char(__local_32, 117); - String::append_char(__local_32, 110); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_32, 114); + String::push(__local_32, 117); + String::push(__local_32, 110); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_99 = __local_33; i32::fmt_decimal(47, __local_99); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: classify_inline(2) == \"two\" "), used: 40 }); - String::append(__local_32, String { repr: array.new_data("classify_inline(2): "), used: 20 }); + String::push_str(__local_32, String { repr: array.new_data("classify_inline(2): "), used: 20 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; String^Inspect::inspect(__v0_14, __local_33); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -492,26 +492,26 @@ condition: classify_inline(2) == \"two\" if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_34, 114); - String::append_char(__local_34, 117); - String::append_char(__local_34, 110); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_34, 114); + String::push(__local_34, 117); + String::push(__local_34, 110); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/match_return_from_arm.wado"), used: 55 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_108 = __local_35; i32::fmt_decimal(48, __local_108); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: classify_inline(3) == \"other\" "), used: 42 }); - String::append(__local_34, String { repr: array.new_data("classify_inline(3): "), used: 20 }); + String::push_str(__local_34, String { repr: array.new_data("classify_inline(3): "), used: 20 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; String^Inspect::inspect(__v0_16, __local_35); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -714,7 +714,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -802,7 +802,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -840,7 +840,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l55; }; @@ -874,20 +874,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -897,10 +897,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -910,10 +910,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -921,10 +921,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -936,7 +936,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -953,22 +953,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b74; @@ -976,7 +976,7 @@ fn String^Inspect::inspect(self, f) { continue l75; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/match_variant_1.wir.wado b/wado-compiler/tests/fixtures.golden/match_variant_1.wir.wado index e649d19fa..f762dbb0c 100644 --- a/wado-compiler/tests/fixtures.golden/match_variant_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_variant_1.wir.wado @@ -111,7 +111,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -119,7 +119,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -208,7 +208,7 @@ fn match_variant_basic() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Circle area: "), used: 13 }); + String::push_str(__local_6, String { repr: array.new_data("Circle area: "), used: 13 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; f64::fmt_into(area1, __local_7); break __tmpl: __local_6; @@ -227,7 +227,7 @@ fn match_variant_basic() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Point area: "), used: 12 }); + String::push_str(__local_8, String { repr: array.new_data("Point area: "), used: 12 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; f64::fmt_into(area2, __local_9); break __tmpl: __local_8; @@ -1019,7 +1019,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1074,7 +1074,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1106,7 +1106,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1188,25 +1188,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1307,9 +1307,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1363,13 +1363,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1404,9 +1404,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1447,7 +1447,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/match_variant_2.wir.wado b/wado-compiler/tests/fixtures.golden/match_variant_2.wir.wado index eb653013d..53c384a6c 100644 --- a/wado-compiler/tests/fixtures.golden/match_variant_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_variant_2.wir.wado @@ -125,7 +125,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -133,9 +133,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -203,7 +203,7 @@ fn apply_padding(s, spec) { pad_len = width - s.used; result = String { repr: builtin::array_new(width), used: 0 }; return let __match_scrut_0: ref Align; __match_scrut_0 = spec.align; if __match_scrut_0.discriminant == 0 -> ref String { - String::append(result, s); + String::push_str(result, s); __for_0: block { __local_6 = 0; block { @@ -211,7 +211,7 @@ fn apply_padding(s, spec) { if (__local_6 < pad_len) == 0 { break __for_0; }; - String::append_char(result, fill); + String::push(result, fill); __local_6 = __local_6 + 1; continue l4; }; @@ -228,13 +228,13 @@ fn apply_padding(s, spec) { if (__local_9 < __local_7) == 0 { break __for_0; }; - String::append_char(result, fill); + String::push(result, fill); __local_9 = __local_9 + 1; continue l8; }; }; }; - String::append(result, s); + String::push_str(result, s); __for_1: block { __local_10 = 0; block { @@ -242,7 +242,7 @@ fn apply_padding(s, spec) { if (__local_10 < __local_8) == 0 { break __for_1; }; - String::append_char(result, fill); + String::push(result, fill); __local_10 = __local_10 + 1; continue l11; }; @@ -257,13 +257,13 @@ fn apply_padding(s, spec) { if (__local_11 < pad_len) == 0 { break __for_0; }; - String::append_char(result, fill); + String::push(result, fill); __local_11 = __local_11 + 1; continue l15; }; }; }; - String::append(result, s); + String::push_str(result, s); result; } else { unreachable; @@ -309,7 +309,7 @@ fn match_variant_simple() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Circle result: "), used: 15 }); + String::push_str(__local_6, String { repr: array.new_data("Circle result: "), used: 15 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; f64::fmt_into(result1, __local_7); break __tmpl: __local_6; @@ -328,7 +328,7 @@ fn match_variant_simple() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Point result: "), used: 14 }); + String::push_str(__local_8, String { repr: array.new_data("Point result: "), used: 14 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; f64::fmt_into(result2, __local_9); break __tmpl: __local_8; @@ -1140,8 +1140,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1196,8 +1196,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1229,7 +1229,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1311,27 +1311,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1432,9 +1432,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1488,13 +1488,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1529,9 +1529,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1572,7 +1572,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1587,7 +1587,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/match_variant_import.wir.wado b/wado-compiler/tests/fixtures.golden/match_variant_import.wir.wado index 5ee238660..1c5a40325 100644 --- a/wado-compiler/tests/fixtures.golden/match_variant_import.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_variant_import.wir.wado @@ -107,7 +107,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -115,9 +115,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -207,7 +207,7 @@ fn "./match_variant_import_module.wado/apply_padding"(s, spec) { // from ./matc pad_len = width - s.used; result = String { repr: builtin::array_new(width), used: 0 }; return let __match_scrut_0: ref "./match_variant_import_module.wado/Align"; __match_scrut_0 = spec.align; if __match_scrut_0.discriminant == 0 -> ref String { - String::append(result, s); + String::push_str(result, s); __for_0: block { __local_6 = 0; block { @@ -215,7 +215,7 @@ fn "./match_variant_import_module.wado/apply_padding"(s, spec) { // from ./matc if (__local_6 < pad_len) == 0 { break __for_0; }; - String::append_char(result, fill); + String::push(result, fill); __local_6 = __local_6 + 1; continue l5; }; @@ -232,13 +232,13 @@ fn "./match_variant_import_module.wado/apply_padding"(s, spec) { // from ./matc if (__local_9 < __local_7) == 0 { break __for_0; }; - String::append_char(result, fill); + String::push(result, fill); __local_9 = __local_9 + 1; continue l9; }; }; }; - String::append(result, s); + String::push_str(result, s); __for_1: block { __local_10 = 0; block { @@ -246,7 +246,7 @@ fn "./match_variant_import_module.wado/apply_padding"(s, spec) { // from ./matc if (__local_10 < __local_8) == 0 { break __for_1; }; - String::append_char(result, fill); + String::push(result, fill); __local_10 = __local_10 + 1; continue l12; }; @@ -261,13 +261,13 @@ fn "./match_variant_import_module.wado/apply_padding"(s, spec) { // from ./matc if (__local_11 < pad_len) == 0 { break __for_0; }; - String::append_char(result, fill); + String::push(result, fill); __local_11 = __local_11 + 1; continue l16; }; }; }; - String::append(result, s); + String::push_str(result, s); result; } else { unreachable; @@ -1041,8 +1041,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1097,8 +1097,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1130,7 +1130,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1212,27 +1212,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1333,9 +1333,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1389,13 +1389,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1430,9 +1430,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1473,7 +1473,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1488,7 +1488,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/match_variant_import_module.wir.wado b/wado-compiler/tests/fixtures.golden/match_variant_import_module.wir.wado index 6cceffc16..1176c29f9 100644 --- a/wado-compiler/tests/fixtures.golden/match_variant_import_module.wir.wado +++ b/wado-compiler/tests/fixtures.golden/match_variant_import_module.wir.wado @@ -107,7 +107,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -115,9 +115,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -185,7 +185,7 @@ fn apply_padding(s, spec) { pad_len = width - s.used; result = String { repr: builtin::array_new(width), used: 0 }; return let __match_scrut_0: ref Align; __match_scrut_0 = spec.align; if __match_scrut_0.discriminant == 0 -> ref String { - String::append(result, s); + String::push_str(result, s); __for_0: block { __local_6 = 0; block { @@ -193,7 +193,7 @@ fn apply_padding(s, spec) { if (__local_6 < pad_len) == 0 { break __for_0; }; - String::append_char(result, fill); + String::push(result, fill); __local_6 = __local_6 + 1; continue l4; }; @@ -210,13 +210,13 @@ fn apply_padding(s, spec) { if (__local_9 < __local_7) == 0 { break __for_0; }; - String::append_char(result, fill); + String::push(result, fill); __local_9 = __local_9 + 1; continue l8; }; }; }; - String::append(result, s); + String::push_str(result, s); __for_1: block { __local_10 = 0; block { @@ -224,7 +224,7 @@ fn apply_padding(s, spec) { if (__local_10 < __local_8) == 0 { break __for_1; }; - String::append_char(result, fill); + String::push(result, fill); __local_10 = __local_10 + 1; continue l11; }; @@ -239,13 +239,13 @@ fn apply_padding(s, spec) { if (__local_11 < pad_len) == 0 { break __for_0; }; - String::append_char(result, fill); + String::push(result, fill); __local_11 = __local_11 + 1; continue l15; }; }; }; - String::append(result, s); + String::push_str(result, s); result; } else { unreachable; @@ -1046,8 +1046,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1102,8 +1102,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1135,7 +1135,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1217,27 +1217,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1338,9 +1338,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1394,13 +1394,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1435,9 +1435,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1478,7 +1478,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1493,7 +1493,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/matches_merged.wir.wado b/wado-compiler/tests/fixtures.golden/matches_merged.wir.wado index 6fb37c454..f05e5d467 100644 --- a/wado-compiler/tests/fixtures.golden/matches_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/matches_merged.wir.wado @@ -108,9 +108,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -163,17 +163,17 @@ fn __test_0_basic() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_basic"), used: 14 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_basic"), used: 14 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(10, __local_6); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: opt matches { Some(_) } "), used: 36 }); break __tmpl: __local_5; @@ -190,17 +190,17 @@ condition: opt matches { Some(_) } if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_0_basic"), used: 14 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_0_basic"), used: 14 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(11, __local_8); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: none matches { None } "), used: 34 }); break __tmpl: __local_7; @@ -215,17 +215,17 @@ condition: none matches { None } if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_0_basic"), used: 14 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_0_basic"), used: 14 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(12, __local_10); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: !opt matches { None } "), used: 34 }); break __tmpl: __local_9; @@ -266,17 +266,17 @@ fn __test_1_guard() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_1_guard"), used: 14 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_1_guard"), used: 14 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(20, __local_10); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: opt1 matches { Some(x) && x > 5 } "), used: 46 }); break __tmpl: __local_9; @@ -294,17 +294,17 @@ condition: opt1 matches { Some(x) && x > 5 } if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_1_guard"), used: 14 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_1_guard"), used: 14 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(21, __local_12); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: !opt2 matches { Some(x) && x > 5 } "), used: 47 }); break __tmpl: __local_11; @@ -322,17 +322,17 @@ condition: !opt2 matches { Some(x) && x > 5 } if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_1_guard"), used: 14 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_1_guard"), used: 14 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(22, __local_14); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: !none matches { Some(x) && x > 5 } "), used: 47 }); break __tmpl: __local_13; @@ -366,17 +366,17 @@ fn __test_2_option_guard_char() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_2_option_guard_char"), used: 26 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_2_option_guard_char"), used: 26 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(27, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: c matches { Some(ch) && ch == '.' } "), used: 48 }); break __tmpl: __local_6; @@ -395,17 +395,17 @@ condition: c matches { Some(ch) && ch == '.' } if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_2_option_guard_char"), used: 26 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_2_option_guard_char"), used: 26 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(30, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: !d matches { Some(ch) && ch == '.' } "), used: 49 }); break __tmpl: __local_8; @@ -444,17 +444,17 @@ fn __test_3_variant() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_3_variant"), used: 16 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_3_variant"), used: 16 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(37, __local_8); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: circle matches { Circle(_) } "), used: 41 }); break __tmpl: __local_7; @@ -474,17 +474,17 @@ condition: circle matches { Circle(_) } if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_3_variant"), used: 16 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_3_variant"), used: 16 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(38, __local_10); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: circle matches { Circle(r) && r > 3.0 } "), used: 52 }); break __tmpl: __local_9; @@ -501,17 +501,17 @@ condition: circle matches { Circle(r) && r > 3.0 } if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_3_variant"), used: 16 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_3_variant"), used: 16 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(39, __local_12); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: !point matches { Circle(_) } "), used: 41 }); break __tmpl: __local_11; @@ -528,17 +528,17 @@ condition: !point matches { Circle(_) } if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_3_variant"), used: 16 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_3_variant"), used: 16 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/matches_merged.wado"), used: 48 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(40, __local_14); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: point matches { MatchPoint } "), used: 41 }); break __tmpl: __local_13; @@ -772,7 +772,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -787,7 +787,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -825,7 +825,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l50; }; @@ -859,20 +859,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -882,10 +882,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -895,10 +895,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -906,10 +906,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/method_turbofish_non_generic_struct.wir.wado b/wado-compiler/tests/fixtures.golden/method_turbofish_non_generic_struct.wir.wado index 261189eb3..004e9d742 100644 --- a/wado-compiler/tests/fixtures.golden/method_turbofish_non_generic_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/method_turbofish_non_generic_struct.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -306,7 +306,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -321,7 +321,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -359,7 +359,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -393,20 +393,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -416,10 +416,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -440,10 +440,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/mixed_int_float_arithmetic.wir.wado b/wado-compiler/tests/fixtures.golden/mixed_int_float_arithmetic.wir.wado index dc40f1422..c31325daa 100644 --- a/wado-compiler/tests/fixtures.golden/mixed_int_float_arithmetic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/mixed_int_float_arithmetic.wir.wado @@ -91,7 +91,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -99,7 +99,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -158,7 +158,7 @@ fn run() with Stdout { dx = 3.5 / builtin::f64_convert_i32_s(100); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(20), used: 0 }; - String::append(__local_4, String { repr: array.new_data("dx: "), used: 4 }); + String::push_str(__local_4, String { repr: array.new_data("dx: "), used: 4 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; f64::fmt_into(dx, __local_5); break __tmpl: __local_4; @@ -926,7 +926,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -981,7 +981,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1013,7 +1013,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1095,25 +1095,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1214,9 +1214,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1270,13 +1270,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1311,9 +1311,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1354,7 +1354,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/mut_param.wir.wado b/wado-compiler/tests/fixtures.golden/mut_param.wir.wado index 2328fb067..dd8e68ef6 100644 --- a/wado-compiler/tests/fixtures.golden/mut_param.wir.wado +++ b/wado-compiler/tests/fixtures.golden/mut_param.wir.wado @@ -98,15 +98,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -326,27 +326,27 @@ fn run() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_78 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_78, 114); - String::append_char(__local_78, 117); - String::append_char(__local_78, 110); - String::append_char(__local_78, 32); - String::append_char(__local_78, 97); - String::append_char(__local_78, 116); - String::append_char(__local_78, 32); - String::append(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_78, 58); + String::push_str(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_78, 114); + String::push(__local_78, 117); + String::push(__local_78, 110); + String::push(__local_78, 32); + String::push(__local_78, 97); + String::push(__local_78, 116); + String::push(__local_78, 32); + String::push_str(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_78, 58); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; __local_139 = __local_79; i32::fmt_decimal(80, __local_139); - String::append(__local_78, String { repr: array.new_data(" + String::push_str(__local_78, String { repr: array.new_data(" condition: increment(x) == 6 "), used: 30 }); - String::append(__local_78, String { repr: array.new_data("increment(x): "), used: 14 }); + String::push_str(__local_78, String { repr: array.new_data("increment(x): "), used: 14 }); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; __local_144 = __local_79; i32::fmt_decimal(__v0_1, __local_144); - String::append_char(__local_78, 10); + String::push(__local_78, 10); break __tmpl: __local_78; }); unreachable; @@ -362,31 +362,31 @@ condition: increment(x) == 6 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_82 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_82, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_82, 114); - String::append_char(__local_82, 117); - String::append_char(__local_82, 110); - String::append_char(__local_82, 32); - String::append_char(__local_82, 97); - String::append_char(__local_82, 116); - String::append_char(__local_82, 32); - String::append(__local_82, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_82, 58); + String::push_str(__local_82, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_82, 114); + String::push(__local_82, 117); + String::push(__local_82, 110); + String::push(__local_82, 32); + String::push(__local_82, 97); + String::push(__local_82, 116); + String::push(__local_82, 32); + String::push_str(__local_82, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_82, 58); __local_83 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_82 }; __local_162 = __local_83; i32::fmt_decimal(86, __local_162); - String::append(__local_82, String { repr: array.new_data(" + String::push_str(__local_82, String { repr: array.new_data(" condition: q.x == 0 "), used: 21 }); - String::append_char(__local_82, 113); - String::append_char(__local_82, 46); - String::append_char(__local_82, 120); - String::append_char(__local_82, 58); - String::append_char(__local_82, 32); + String::push(__local_82, 113); + String::push(__local_82, 46); + String::push(__local_82, 120); + String::push(__local_82, 58); + String::push(__local_82, 32); __local_83 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_82 }; __local_167 = __local_83; i32::fmt_decimal(__v0_7, __local_167); - String::append_char(__local_82, 10); + String::push(__local_82, 10); break __tmpl: __local_82; }); unreachable; @@ -396,31 +396,31 @@ condition: q.x == 0 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_84 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_84, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_84, 114); - String::append_char(__local_84, 117); - String::append_char(__local_84, 110); - String::append_char(__local_84, 32); - String::append_char(__local_84, 97); - String::append_char(__local_84, 116); - String::append_char(__local_84, 32); - String::append(__local_84, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_84, 58); + String::push_str(__local_84, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_84, 114); + String::push(__local_84, 117); + String::push(__local_84, 110); + String::push(__local_84, 32); + String::push(__local_84, 97); + String::push(__local_84, 116); + String::push(__local_84, 32); + String::push_str(__local_84, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_84, 58); __local_85 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_84 }; __local_173 = __local_85; i32::fmt_decimal(87, __local_173); - String::append(__local_84, String { repr: array.new_data(" + String::push_str(__local_84, String { repr: array.new_data(" condition: q.y == 0 "), used: 21 }); - String::append_char(__local_84, 113); - String::append_char(__local_84, 46); - String::append_char(__local_84, 121); - String::append_char(__local_84, 58); - String::append_char(__local_84, 32); + String::push(__local_84, 113); + String::push(__local_84, 46); + String::push(__local_84, 121); + String::push(__local_84, 58); + String::push(__local_84, 32); __local_85 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_84 }; __local_178 = __local_85; i32::fmt_decimal(__v0_9, __local_178); - String::append_char(__local_84, 10); + String::push(__local_84, 10); break __tmpl: __local_84; }); unreachable; @@ -430,31 +430,31 @@ condition: q.y == 0 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_86 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_86, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_86, 114); - String::append_char(__local_86, 117); - String::append_char(__local_86, 110); - String::append_char(__local_86, 32); - String::append_char(__local_86, 97); - String::append_char(__local_86, 116); - String::append_char(__local_86, 32); - String::append(__local_86, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_86, 58); + String::push_str(__local_86, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_86, 114); + String::push(__local_86, 117); + String::push(__local_86, 110); + String::push(__local_86, 32); + String::push(__local_86, 97); + String::push(__local_86, 116); + String::push(__local_86, 32); + String::push_str(__local_86, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_86, 58); __local_87 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_86 }; __local_184 = __local_87; i32::fmt_decimal(88, __local_184); - String::append(__local_86, String { repr: array.new_data(" + String::push_str(__local_86, String { repr: array.new_data(" condition: p.x == 5 "), used: 21 }); - String::append_char(__local_86, 112); - String::append_char(__local_86, 46); - String::append_char(__local_86, 120); - String::append_char(__local_86, 58); - String::append_char(__local_86, 32); + String::push(__local_86, 112); + String::push(__local_86, 46); + String::push(__local_86, 120); + String::push(__local_86, 58); + String::push(__local_86, 32); __local_87 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_86 }; __local_189 = __local_87; i32::fmt_decimal(__v0_11, __local_189); - String::append_char(__local_86, 10); + String::push(__local_86, 10); break __tmpl: __local_86; }); unreachable; @@ -464,31 +464,31 @@ condition: p.x == 5 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_88 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_88, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_88, 114); - String::append_char(__local_88, 117); - String::append_char(__local_88, 110); - String::append_char(__local_88, 32); - String::append_char(__local_88, 97); - String::append_char(__local_88, 116); - String::append_char(__local_88, 32); - String::append(__local_88, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_88, 58); + String::push_str(__local_88, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_88, 114); + String::push(__local_88, 117); + String::push(__local_88, 110); + String::push(__local_88, 32); + String::push(__local_88, 97); + String::push(__local_88, 116); + String::push(__local_88, 32); + String::push_str(__local_88, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_88, 58); __local_89 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_88 }; __local_195 = __local_89; i32::fmt_decimal(89, __local_195); - String::append(__local_88, String { repr: array.new_data(" + String::push_str(__local_88, String { repr: array.new_data(" condition: p.y == 10 "), used: 22 }); - String::append_char(__local_88, 112); - String::append_char(__local_88, 46); - String::append_char(__local_88, 121); - String::append_char(__local_88, 58); - String::append_char(__local_88, 32); + String::push(__local_88, 112); + String::push(__local_88, 46); + String::push(__local_88, 121); + String::push(__local_88, 58); + String::push(__local_88, 32); __local_89 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_88 }; __local_200 = __local_89; i32::fmt_decimal(__v0_13, __local_200); - String::append_char(__local_88, 10); + String::push(__local_88, 10); break __tmpl: __local_88; }); unreachable; @@ -500,31 +500,31 @@ condition: p.y == 10 if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_90 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_90, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_90, 114); - String::append_char(__local_90, 117); - String::append_char(__local_90, 110); - String::append_char(__local_90, 32); - String::append_char(__local_90, 97); - String::append_char(__local_90, 116); - String::append_char(__local_90, 32); - String::append(__local_90, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_90, 58); + String::push_str(__local_90, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_90, 114); + String::push(__local_90, 117); + String::push(__local_90, 110); + String::push(__local_90, 32); + String::push(__local_90, 97); + String::push(__local_90, 116); + String::push(__local_90, 32); + String::push_str(__local_90, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_90, 58); __local_91 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_90 }; __local_206 = __local_91; i32::fmt_decimal(94, __local_206); - String::append(__local_90, String { repr: array.new_data(" + String::push_str(__local_90, String { repr: array.new_data(" condition: t.x == 11 "), used: 22 }); - String::append_char(__local_90, 116); - String::append_char(__local_90, 46); - String::append_char(__local_90, 120); - String::append_char(__local_90, 58); - String::append_char(__local_90, 32); + String::push(__local_90, 116); + String::push(__local_90, 46); + String::push(__local_90, 120); + String::push(__local_90, 58); + String::push(__local_90, 32); __local_91 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_90 }; __local_211 = __local_91; i32::fmt_decimal(__v0_17, __local_211); - String::append_char(__local_90, 10); + String::push(__local_90, 10); break __tmpl: __local_90; }); unreachable; @@ -534,31 +534,31 @@ condition: t.x == 11 if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_92 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_92, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_92, 114); - String::append_char(__local_92, 117); - String::append_char(__local_92, 110); - String::append_char(__local_92, 32); - String::append_char(__local_92, 97); - String::append_char(__local_92, 116); - String::append_char(__local_92, 32); - String::append(__local_92, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_92, 58); + String::push_str(__local_92, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_92, 114); + String::push(__local_92, 117); + String::push(__local_92, 110); + String::push(__local_92, 32); + String::push(__local_92, 97); + String::push(__local_92, 116); + String::push(__local_92, 32); + String::push_str(__local_92, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_92, 58); __local_93 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_92 }; __local_217 = __local_93; i32::fmt_decimal(95, __local_217); - String::append(__local_92, String { repr: array.new_data(" + String::push_str(__local_92, String { repr: array.new_data(" condition: t.y == 22 "), used: 22 }); - String::append_char(__local_92, 116); - String::append_char(__local_92, 46); - String::append_char(__local_92, 121); - String::append_char(__local_92, 58); - String::append_char(__local_92, 32); + String::push(__local_92, 116); + String::push(__local_92, 46); + String::push(__local_92, 121); + String::push(__local_92, 58); + String::push(__local_92, 32); __local_93 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_92 }; __local_222 = __local_93; i32::fmt_decimal(__v0_19, __local_222); - String::append_char(__local_92, 10); + String::push(__local_92, 10); break __tmpl: __local_92; }); unreachable; @@ -568,31 +568,31 @@ condition: t.y == 22 if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_94 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_94, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_94, 114); - String::append_char(__local_94, 117); - String::append_char(__local_94, 110); - String::append_char(__local_94, 32); - String::append_char(__local_94, 97); - String::append_char(__local_94, 116); - String::append_char(__local_94, 32); - String::append(__local_94, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_94, 58); + String::push_str(__local_94, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_94, 114); + String::push(__local_94, 117); + String::push(__local_94, 110); + String::push(__local_94, 32); + String::push(__local_94, 97); + String::push(__local_94, 116); + String::push(__local_94, 32); + String::push_str(__local_94, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_94, 58); __local_95 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_94 }; __local_228 = __local_95; i32::fmt_decimal(96, __local_228); - String::append(__local_94, String { repr: array.new_data(" + String::push_str(__local_94, String { repr: array.new_data(" condition: r.x == 1 "), used: 21 }); - String::append_char(__local_94, 114); - String::append_char(__local_94, 46); - String::append_char(__local_94, 120); - String::append_char(__local_94, 58); - String::append_char(__local_94, 32); + String::push(__local_94, 114); + String::push(__local_94, 46); + String::push(__local_94, 120); + String::push(__local_94, 58); + String::push(__local_94, 32); __local_95 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_94 }; __local_233 = __local_95; i32::fmt_decimal(__v0_21, __local_233); - String::append_char(__local_94, 10); + String::push(__local_94, 10); break __tmpl: __local_94; }); unreachable; @@ -602,31 +602,31 @@ condition: r.x == 1 if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_96 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_96, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_96, 114); - String::append_char(__local_96, 117); - String::append_char(__local_96, 110); - String::append_char(__local_96, 32); - String::append_char(__local_96, 97); - String::append_char(__local_96, 116); - String::append_char(__local_96, 32); - String::append(__local_96, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_96, 58); + String::push_str(__local_96, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_96, 114); + String::push(__local_96, 117); + String::push(__local_96, 110); + String::push(__local_96, 32); + String::push(__local_96, 97); + String::push(__local_96, 116); + String::push(__local_96, 32); + String::push_str(__local_96, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_96, 58); __local_97 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_96 }; __local_239 = __local_97; i32::fmt_decimal(97, __local_239); - String::append(__local_96, String { repr: array.new_data(" + String::push_str(__local_96, String { repr: array.new_data(" condition: r.y == 2 "), used: 21 }); - String::append_char(__local_96, 114); - String::append_char(__local_96, 46); - String::append_char(__local_96, 121); - String::append_char(__local_96, 58); - String::append_char(__local_96, 32); + String::push(__local_96, 114); + String::push(__local_96, 46); + String::push(__local_96, 121); + String::push(__local_96, 58); + String::push(__local_96, 32); __local_97 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_96 }; __local_244 = __local_97; i32::fmt_decimal(__v0_23, __local_244); - String::append_char(__local_96, 10); + String::push(__local_96, 10); break __tmpl: __local_96; }); unreachable; @@ -641,26 +641,26 @@ condition: r.y == 2 if __cond_27 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_98 = String { repr: builtin::array_new(153), used: 0 }; - String::append(__local_98, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_98, 114); - String::append_char(__local_98, 117); - String::append_char(__local_98, 110); - String::append_char(__local_98, 32); - String::append_char(__local_98, 97); - String::append_char(__local_98, 116); - String::append_char(__local_98, 32); - String::append(__local_98, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_98, 58); + String::push_str(__local_98, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_98, 114); + String::push(__local_98, 117); + String::push(__local_98, 110); + String::push(__local_98, 32); + String::push(__local_98, 97); + String::push(__local_98, 116); + String::push(__local_98, 32); + String::push_str(__local_98, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_98, 58); __local_99 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_98 }; __local_251 = __local_99; i32::fmt_decimal(101, __local_251); - String::append(__local_98, String { repr: array.new_data(" + String::push_str(__local_98, String { repr: array.new_data(" condition: replace_string(s) == \"replaced\" "), used: 44 }); - String::append(__local_98, String { repr: array.new_data("replace_string(s): "), used: 19 }); + String::push_str(__local_98, String { repr: array.new_data("replace_string(s): "), used: 19 }); __local_99 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_98 }; String^Inspect::inspect(__v0_26, __local_99); - String::append_char(__local_98, 10); + String::push(__local_98, 10); break __tmpl: __local_98; }); unreachable; @@ -670,28 +670,28 @@ condition: replace_string(s) == \"replaced\" if __cond_29 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_100 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_100, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_100, 114); - String::append_char(__local_100, 117); - String::append_char(__local_100, 110); - String::append_char(__local_100, 32); - String::append_char(__local_100, 97); - String::append_char(__local_100, 116); - String::append_char(__local_100, 32); - String::append(__local_100, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_100, 58); + String::push_str(__local_100, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_100, 114); + String::push(__local_100, 117); + String::push(__local_100, 110); + String::push(__local_100, 32); + String::push(__local_100, 97); + String::push(__local_100, 116); + String::push(__local_100, 32); + String::push_str(__local_100, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_100, 58); __local_101 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_100 }; __local_258 = __local_101; i32::fmt_decimal(102, __local_258); - String::append(__local_100, String { repr: array.new_data(" + String::push_str(__local_100, String { repr: array.new_data(" condition: s == \"original\" "), used: 28 }); - String::append_char(__local_100, 115); - String::append_char(__local_100, 58); - String::append_char(__local_100, 32); + String::push(__local_100, 115); + String::push(__local_100, 58); + String::push(__local_100, 32); __local_101 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_100 }; String^Inspect::inspect(__v0_28, __local_101); - String::append_char(__local_100, 10); + String::push(__local_100, 10); break __tmpl: __local_100; }); unreachable; @@ -699,33 +699,33 @@ condition: s == \"original\" greeting = String { repr: array.new_data("hello"), used: 5 }; __v0_31 = value_copy String(__inline_append_bang_85: block -> ref String { __local_262 = value_copy String(greeting); - String::append_char(__local_262, 33); + String::push(__local_262, 33); break __inline_append_bang_85: __local_262; }); __cond_32 = String^Eq::eq(__v0_31, String { repr: array.new_data("hello!"), used: 6 }); if __cond_32 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_102 = String { repr: builtin::array_new(159), used: 0 }; - String::append(__local_102, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_102, 114); - String::append_char(__local_102, 117); - String::append_char(__local_102, 110); - String::append_char(__local_102, 32); - String::append_char(__local_102, 97); - String::append_char(__local_102, 116); - String::append_char(__local_102, 32); - String::append(__local_102, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_102, 58); + String::push_str(__local_102, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_102, 114); + String::push(__local_102, 117); + String::push(__local_102, 110); + String::push(__local_102, 32); + String::push(__local_102, 97); + String::push(__local_102, 116); + String::push(__local_102, 32); + String::push_str(__local_102, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_102, 58); __local_103 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_102 }; __local_266 = __local_103; i32::fmt_decimal(106, __local_266); - String::append(__local_102, String { repr: array.new_data(" + String::push_str(__local_102, String { repr: array.new_data(" condition: append_bang(greeting) == \"hello!\" "), used: 46 }); - String::append(__local_102, String { repr: array.new_data("append_bang(greeting): "), used: 23 }); + String::push_str(__local_102, String { repr: array.new_data("append_bang(greeting): "), used: 23 }); __local_103 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_102 }; String^Inspect::inspect(__v0_31, __local_103); - String::append_char(__local_102, 10); + String::push(__local_102, 10); break __tmpl: __local_102; }); unreachable; @@ -735,26 +735,26 @@ condition: append_bang(greeting) == \"hello!\" if __cond_34 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_104 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_104, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_104, 114); - String::append_char(__local_104, 117); - String::append_char(__local_104, 110); - String::append_char(__local_104, 32); - String::append_char(__local_104, 97); - String::append_char(__local_104, 116); - String::append_char(__local_104, 32); - String::append(__local_104, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_104, 58); + String::push_str(__local_104, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_104, 114); + String::push(__local_104, 117); + String::push(__local_104, 110); + String::push(__local_104, 32); + String::push(__local_104, 97); + String::push(__local_104, 116); + String::push(__local_104, 32); + String::push_str(__local_104, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_104, 58); __local_105 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_104 }; __local_273 = __local_105; i32::fmt_decimal(107, __local_273); - String::append(__local_104, String { repr: array.new_data(" + String::push_str(__local_104, String { repr: array.new_data(" condition: greeting == \"hello\" "), used: 32 }); - String::append(__local_104, String { repr: array.new_data("greeting: "), used: 10 }); + String::push_str(__local_104, String { repr: array.new_data("greeting: "), used: 10 }); __local_105 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_104 }; String^Inspect::inspect(__v0_33, __local_105); - String::append_char(__local_104, 10); + String::push(__local_104, 10); break __tmpl: __local_104; }); unreachable; @@ -775,32 +775,32 @@ condition: greeting == \"hello\" if __cond_39 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_106 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_106, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_106, 114); - String::append_char(__local_106, 117); - String::append_char(__local_106, 110); - String::append_char(__local_106, 32); - String::append_char(__local_106, 97); - String::append_char(__local_106, 116); - String::append_char(__local_106, 32); - String::append(__local_106, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_106, 58); + String::push_str(__local_106, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_106, 114); + String::push(__local_106, 117); + String::push(__local_106, 110); + String::push(__local_106, 32); + String::push(__local_106, 97); + String::push(__local_106, 116); + String::push(__local_106, 32); + String::push_str(__local_106, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_106, 58); __local_107 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_106 }; __local_291 = __local_107; i32::fmt_decimal(112, __local_291); - String::append(__local_106, String { repr: array.new_data(" + String::push_str(__local_106, String { repr: array.new_data(" condition: b[0] == 99 "), used: 23 }); - String::append_char(__local_106, 98); - String::append_char(__local_106, 91); - String::append_char(__local_106, 48); - String::append_char(__local_106, 93); - String::append_char(__local_106, 58); - String::append_char(__local_106, 32); + String::push(__local_106, 98); + String::push(__local_106, 91); + String::push(__local_106, 48); + String::push(__local_106, 93); + String::push(__local_106, 58); + String::push(__local_106, 32); __local_107 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_106 }; __local_296 = __local_107; i32::fmt_decimal(__v0_38, __local_296); - String::append_char(__local_106, 10); + String::push(__local_106, 10); break __tmpl: __local_106; }); unreachable; @@ -816,32 +816,32 @@ condition: b[0] == 99 if __cond_41 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_108 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_108, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_108, 114); - String::append_char(__local_108, 117); - String::append_char(__local_108, 110); - String::append_char(__local_108, 32); - String::append_char(__local_108, 97); - String::append_char(__local_108, 116); - String::append_char(__local_108, 32); - String::append(__local_108, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_108, 58); + String::push_str(__local_108, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_108, 114); + String::push(__local_108, 117); + String::push(__local_108, 110); + String::push(__local_108, 32); + String::push(__local_108, 97); + String::push(__local_108, 116); + String::push(__local_108, 32); + String::push_str(__local_108, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_108, 58); __local_109 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_108 }; __local_304 = __local_109; i32::fmt_decimal(113, __local_304); - String::append(__local_108, String { repr: array.new_data(" + String::push_str(__local_108, String { repr: array.new_data(" condition: a[0] == 1 "), used: 22 }); - String::append_char(__local_108, 97); - String::append_char(__local_108, 91); - String::append_char(__local_108, 48); - String::append_char(__local_108, 93); - String::append_char(__local_108, 58); - String::append_char(__local_108, 32); + String::push(__local_108, 97); + String::push(__local_108, 91); + String::push(__local_108, 48); + String::push(__local_108, 93); + String::push(__local_108, 58); + String::push(__local_108, 32); __local_109 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_108 }; __local_309 = __local_109; i32::fmt_decimal(__v0_40, __local_309); - String::append_char(__local_108, 10); + String::push(__local_108, 10); break __tmpl: __local_108; }); unreachable; @@ -877,32 +877,32 @@ condition: a[0] == 1 if __cond_46 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_110 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_110, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_110, 114); - String::append_char(__local_110, 117); - String::append_char(__local_110, 110); - String::append_char(__local_110, 32); - String::append_char(__local_110, 97); - String::append_char(__local_110, 116); - String::append_char(__local_110, 32); - String::append(__local_110, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_110, 58); + String::push_str(__local_110, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_110, 114); + String::push(__local_110, 117); + String::push(__local_110, 110); + String::push(__local_110, 32); + String::push(__local_110, 97); + String::push(__local_110, 116); + String::push(__local_110, 32); + String::push_str(__local_110, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_110, 58); __local_111 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_110 }; __local_332 = __local_111; i32::fmt_decimal(118, __local_332); - String::append(__local_110, String { repr: array.new_data(" + String::push_str(__local_110, String { repr: array.new_data(" condition: d[0] == 20 "), used: 23 }); - String::append_char(__local_110, 100); - String::append_char(__local_110, 91); - String::append_char(__local_110, 48); - String::append_char(__local_110, 93); - String::append_char(__local_110, 58); - String::append_char(__local_110, 32); + String::push(__local_110, 100); + String::push(__local_110, 91); + String::push(__local_110, 48); + String::push(__local_110, 93); + String::push(__local_110, 58); + String::push(__local_110, 32); __local_111 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_110 }; __local_337 = __local_111; i32::fmt_decimal(__v0_45, __local_337); - String::append_char(__local_110, 10); + String::push(__local_110, 10); break __tmpl: __local_110; }); unreachable; @@ -918,32 +918,32 @@ condition: d[0] == 20 if __cond_48 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_112 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_112, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_112, 114); - String::append_char(__local_112, 117); - String::append_char(__local_112, 110); - String::append_char(__local_112, 32); - String::append_char(__local_112, 97); - String::append_char(__local_112, 116); - String::append_char(__local_112, 32); - String::append(__local_112, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_112, 58); + String::push_str(__local_112, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_112, 114); + String::push(__local_112, 117); + String::push(__local_112, 110); + String::push(__local_112, 32); + String::push(__local_112, 97); + String::push(__local_112, 116); + String::push(__local_112, 32); + String::push_str(__local_112, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_112, 58); __local_113 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_112 }; __local_345 = __local_113; i32::fmt_decimal(119, __local_345); - String::append(__local_112, String { repr: array.new_data(" + String::push_str(__local_112, String { repr: array.new_data(" condition: c[0] == 10 "), used: 23 }); - String::append_char(__local_112, 99); - String::append_char(__local_112, 91); - String::append_char(__local_112, 48); - String::append_char(__local_112, 93); - String::append_char(__local_112, 58); - String::append_char(__local_112, 32); + String::push(__local_112, 99); + String::push(__local_112, 91); + String::push(__local_112, 48); + String::push(__local_112, 93); + String::push(__local_112, 58); + String::push(__local_112, 32); __local_113 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_112 }; __local_350 = __local_113; i32::fmt_decimal(__v0_47, __local_350); - String::append_char(__local_112, 10); + String::push(__local_112, 10); break __tmpl: __local_112; }); unreachable; @@ -957,27 +957,27 @@ condition: c[0] == 10 if __cond_52 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_114 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_114, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_114, 114); - String::append_char(__local_114, 117); - String::append_char(__local_114, 110); - String::append_char(__local_114, 32); - String::append_char(__local_114, 97); - String::append_char(__local_114, 116); - String::append_char(__local_114, 32); - String::append(__local_114, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_114, 58); + String::push_str(__local_114, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_114, 114); + String::push(__local_114, 117); + String::push(__local_114, 110); + String::push(__local_114, 32); + String::push(__local_114, 97); + String::push(__local_114, 116); + String::push(__local_114, 32); + String::push_str(__local_114, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_114, 58); __local_115 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_114 }; __local_358 = __local_115; i32::fmt_decimal(124, __local_358); - String::append(__local_114, String { repr: array.new_data(" + String::push_str(__local_114, String { repr: array.new_data(" condition: compute(px, py) == 13 "), used: 34 }); - String::append(__local_114, String { repr: array.new_data("compute(px, py): "), used: 17 }); + String::push_str(__local_114, String { repr: array.new_data("compute(px, py): "), used: 17 }); __local_115 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_114 }; __local_363 = __local_115; i32::fmt_decimal(__v0_51, __local_363); - String::append_char(__local_114, 10); + String::push(__local_114, 10); break __tmpl: __local_114; }); unreachable; @@ -992,27 +992,27 @@ condition: compute(px, py) == 13 if __cond_69 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_126 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_126, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_126, 114); - String::append_char(__local_126, 117); - String::append_char(__local_126, 110); - String::append_char(__local_126, 32); - String::append_char(__local_126, 97); - String::append_char(__local_126, 116); - String::append_char(__local_126, 32); - String::append(__local_126, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_126, 58); + String::push_str(__local_126, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_126, 114); + String::push(__local_126, 117); + String::push(__local_126, 110); + String::push(__local_126, 32); + String::push(__local_126, 97); + String::push(__local_126, 116); + String::push(__local_126, 32); + String::push_str(__local_126, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_126, 58); __local_127 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_126 }; __local_428 = __local_127; i32::fmt_decimal(146, __local_428); - String::append(__local_126, String { repr: array.new_data(" + String::push_str(__local_126, String { repr: array.new_data(" condition: add_one(y) == 11 "), used: 29 }); - String::append(__local_126, String { repr: array.new_data("add_one(y): "), used: 12 }); + String::push_str(__local_126, String { repr: array.new_data("add_one(y): "), used: 12 }); __local_127 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_126 }; __local_433 = __local_127; i32::fmt_decimal(__v0_68, __local_433); - String::append_char(__local_126, 10); + String::push(__local_126, 10); break __tmpl: __local_126; }); unreachable; @@ -1023,27 +1023,27 @@ condition: add_one(y) == 11 if __cond_75 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_130 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_130, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_130, 114); - String::append_char(__local_130, 117); - String::append_char(__local_130, 110); - String::append_char(__local_130, 32); - String::append_char(__local_130, 97); - String::append_char(__local_130, 116); - String::append_char(__local_130, 32); - String::append(__local_130, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); - String::append_char(__local_130, 58); + String::push_str(__local_130, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_130, 114); + String::push(__local_130, 117); + String::push(__local_130, 110); + String::push(__local_130, 32); + String::push(__local_130, 97); + String::push(__local_130, 116); + String::push(__local_130, 32); + String::push_str(__local_130, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param.wado"), used: 43 }); + String::push(__local_130, 58); __local_131 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_130 }; __local_450 = __local_131; i32::fmt_decimal(159, __local_450); - String::append(__local_130, String { repr: array.new_data(" + String::push_str(__local_130, String { repr: array.new_data(" condition: sum_to(limit) == 10 "), used: 32 }); - String::append(__local_130, String { repr: array.new_data("sum_to(limit): "), used: 15 }); + String::push_str(__local_130, String { repr: array.new_data("sum_to(limit): "), used: 15 }); __local_131 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_130 }; __local_455 = __local_131; i32::fmt_decimal(__v0_74, __local_455); - String::append_char(__local_130, 10); + String::push(__local_130, 10); break __tmpl: __local_130; }); unreachable; @@ -1283,7 +1283,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1371,7 +1371,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1398,7 +1398,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1467,7 +1467,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l69; }; @@ -1501,20 +1501,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1524,10 +1524,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1537,10 +1537,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1548,10 +1548,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1563,7 +1563,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1580,22 +1580,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b88; @@ -1603,7 +1603,7 @@ fn String^Inspect::inspect(self, f) { continue l89; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/mut_param.wado/__closure_wrapper_0"(__env, __p0) { diff --git a/wado-compiler/tests/fixtures.golden/mut_param_merged.wir.wado b/wado-compiler/tests/fixtures.golden/mut_param_merged.wir.wado index cfde7f0e3..ff652a450 100644 --- a/wado-compiler/tests/fixtures.golden/mut_param_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/mut_param_merged.wir.wado @@ -100,15 +100,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -174,32 +174,32 @@ fn mut_param_basic() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("mut_param_basic"), used: 15 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("mut_param_basic"), used: 15 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_18 = __local_9; i32::fmt_decimal(80, __local_18); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: result == 6 "), used: 24 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 101); - String::append_char(__local_8, 115); - String::append_char(__local_8, 117); - String::append_char(__local_8, 108); - String::append_char(__local_8, 116); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 114); + String::push(__local_8, 101); + String::push(__local_8, 115); + String::push(__local_8, 117); + String::push(__local_8, 108); + String::push(__local_8, 116); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_23 = __local_9; i32::fmt_decimal(result, __local_23); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -300,31 +300,31 @@ fn mut_param_string() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_41 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_41, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_41, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_41, 32); - String::append_char(__local_41, 97); - String::append_char(__local_41, 116); - String::append_char(__local_41, 32); - String::append(__local_41, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_41, 58); + String::push_str(__local_41, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_41, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_41, 32); + String::push(__local_41, 97); + String::push(__local_41, 116); + String::push(__local_41, 32); + String::push_str(__local_41, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_41, 58); __local_42 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_41 }; __local_71 = __local_42; i32::fmt_decimal(94, __local_71); - String::append(__local_41, String { repr: array.new_data(" + String::push_str(__local_41, String { repr: array.new_data(" condition: result == \"new value\" "), used: 34 }); - String::append_char(__local_41, 114); - String::append_char(__local_41, 101); - String::append_char(__local_41, 115); - String::append_char(__local_41, 117); - String::append_char(__local_41, 108); - String::append_char(__local_41, 116); - String::append_char(__local_41, 58); - String::append_char(__local_41, 32); + String::push(__local_41, 114); + String::push(__local_41, 101); + String::push(__local_41, 115); + String::push(__local_41, 117); + String::push(__local_41, 108); + String::push(__local_41, 116); + String::push(__local_41, 58); + String::push(__local_41, 32); __local_42 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_41 }; String^Inspect::inspect(__v0_2, __local_42); - String::append_char(__local_41, 10); + String::push(__local_41, 10); break __tmpl: __local_41; }); unreachable; @@ -334,24 +334,24 @@ condition: result == \"new value\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_43 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_43, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_43, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_43, 32); - String::append_char(__local_43, 97); - String::append_char(__local_43, 116); - String::append_char(__local_43, 32); - String::append(__local_43, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_43, 58); + String::push_str(__local_43, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_43, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_43, 32); + String::push(__local_43, 97); + String::push(__local_43, 116); + String::push(__local_43, 32); + String::push_str(__local_43, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_43, 58); __local_44 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_43 }; __local_78 = __local_44; i32::fmt_decimal(95, __local_78); - String::append(__local_43, String { repr: array.new_data(" + String::push_str(__local_43, String { repr: array.new_data(" condition: original == \"original\" "), used: 35 }); - String::append(__local_43, String { repr: array.new_data("original: "), used: 10 }); + String::push_str(__local_43, String { repr: array.new_data("original: "), used: 10 }); __local_44 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_43 }; String^Inspect::inspect(__v0_4, __local_44); - String::append_char(__local_43, 10); + String::push(__local_43, 10); break __tmpl: __local_43; }); unreachable; @@ -359,7 +359,7 @@ condition: original == \"original\" greeting = String { repr: array.new_data("hello"), used: 5 }; excited = value_copy String(__inline_append_bang_11: block -> ref String { __local_82 = value_copy String(greeting); - String::append_char(__local_82, 33); + String::push(__local_82, 33); break __inline_append_bang_11: __local_82; }); __v0_8 = excited; @@ -367,24 +367,24 @@ condition: original == \"original\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_45 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_45, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_45, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_45, 32); - String::append_char(__local_45, 97); - String::append_char(__local_45, 116); - String::append_char(__local_45, 32); - String::append(__local_45, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_45, 58); + String::push_str(__local_45, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_45, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_45, 32); + String::push(__local_45, 97); + String::push(__local_45, 116); + String::push(__local_45, 32); + String::push_str(__local_45, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_45, 58); __local_46 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_45 }; __local_86 = __local_46; i32::fmt_decimal(100, __local_86); - String::append(__local_45, String { repr: array.new_data(" + String::push_str(__local_45, String { repr: array.new_data(" condition: excited == \"hello!\" "), used: 32 }); - String::append(__local_45, String { repr: array.new_data("excited: "), used: 9 }); + String::push_str(__local_45, String { repr: array.new_data("excited: "), used: 9 }); __local_46 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_45 }; String^Inspect::inspect(__v0_8, __local_46); - String::append_char(__local_45, 10); + String::push(__local_45, 10); break __tmpl: __local_45; }); unreachable; @@ -394,24 +394,24 @@ condition: excited == \"hello!\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_47 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_47, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_47, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_47, 32); - String::append_char(__local_47, 97); - String::append_char(__local_47, 116); - String::append_char(__local_47, 32); - String::append(__local_47, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_47, 58); + String::push_str(__local_47, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_47, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_47, 32); + String::push(__local_47, 97); + String::push(__local_47, 116); + String::push(__local_47, 32); + String::push_str(__local_47, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_47, 58); __local_48 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_47 }; __local_93 = __local_48; i32::fmt_decimal(101, __local_93); - String::append(__local_47, String { repr: array.new_data(" + String::push_str(__local_47, String { repr: array.new_data(" condition: greeting == \"hello\" "), used: 32 }); - String::append(__local_47, String { repr: array.new_data("greeting: "), used: 10 }); + String::push_str(__local_47, String { repr: array.new_data("greeting: "), used: 10 }); __local_48 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_47 }; String^Inspect::inspect(__v0_10, __local_48); - String::append_char(__local_47, 10); + String::push(__local_47, 10); break __tmpl: __local_47; }); unreachable; @@ -432,30 +432,30 @@ condition: greeting == \"hello\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_49 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_49, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_49, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_49, 32); - String::append_char(__local_49, 97); - String::append_char(__local_49, 116); - String::append_char(__local_49, 32); - String::append(__local_49, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_49, 58); + String::push_str(__local_49, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_49, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_49, 32); + String::push(__local_49, 97); + String::push(__local_49, 116); + String::push(__local_49, 32); + String::push_str(__local_49, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_49, 58); __local_50 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_49 }; __local_111 = __local_50; i32::fmt_decimal(106, __local_111); - String::append(__local_49, String { repr: array.new_data(" + String::push_str(__local_49, String { repr: array.new_data(" condition: b[0] == 99 "), used: 23 }); - String::append_char(__local_49, 98); - String::append_char(__local_49, 91); - String::append_char(__local_49, 48); - String::append_char(__local_49, 93); - String::append_char(__local_49, 58); - String::append_char(__local_49, 32); + String::push(__local_49, 98); + String::push(__local_49, 91); + String::push(__local_49, 48); + String::push(__local_49, 93); + String::push(__local_49, 58); + String::push(__local_49, 32); __local_50 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_49 }; __local_116 = __local_50; i32::fmt_decimal(__v0_15, __local_116); - String::append_char(__local_49, 10); + String::push(__local_49, 10); break __tmpl: __local_49; }); unreachable; @@ -471,30 +471,30 @@ condition: b[0] == 99 if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_51 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_51, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_51, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_51, 32); - String::append_char(__local_51, 97); - String::append_char(__local_51, 116); - String::append_char(__local_51, 32); - String::append(__local_51, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_51, 58); + String::push_str(__local_51, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_51, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_51, 32); + String::push(__local_51, 97); + String::push(__local_51, 116); + String::push(__local_51, 32); + String::push_str(__local_51, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_51, 58); __local_52 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_51 }; __local_124 = __local_52; i32::fmt_decimal(107, __local_124); - String::append(__local_51, String { repr: array.new_data(" + String::push_str(__local_51, String { repr: array.new_data(" condition: a[0] == 1 "), used: 22 }); - String::append_char(__local_51, 97); - String::append_char(__local_51, 91); - String::append_char(__local_51, 48); - String::append_char(__local_51, 93); - String::append_char(__local_51, 58); - String::append_char(__local_51, 32); + String::push(__local_51, 97); + String::push(__local_51, 91); + String::push(__local_51, 48); + String::push(__local_51, 93); + String::push(__local_51, 58); + String::push(__local_51, 32); __local_52 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_51 }; __local_129 = __local_52; i32::fmt_decimal(__v0_17, __local_129); - String::append_char(__local_51, 10); + String::push(__local_51, 10); break __tmpl: __local_51; }); unreachable; @@ -530,30 +530,30 @@ condition: a[0] == 1 if __cond_23 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_53 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_53, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_53, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_53, 32); - String::append_char(__local_53, 97); - String::append_char(__local_53, 116); - String::append_char(__local_53, 32); - String::append(__local_53, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_53, 58); + String::push_str(__local_53, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_53, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_53, 32); + String::push(__local_53, 97); + String::push(__local_53, 116); + String::push(__local_53, 32); + String::push_str(__local_53, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_53, 58); __local_54 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_53 }; __local_152 = __local_54; i32::fmt_decimal(112, __local_152); - String::append(__local_53, String { repr: array.new_data(" + String::push_str(__local_53, String { repr: array.new_data(" condition: d[0] == 20 "), used: 23 }); - String::append_char(__local_53, 100); - String::append_char(__local_53, 91); - String::append_char(__local_53, 48); - String::append_char(__local_53, 93); - String::append_char(__local_53, 58); - String::append_char(__local_53, 32); + String::push(__local_53, 100); + String::push(__local_53, 91); + String::push(__local_53, 48); + String::push(__local_53, 93); + String::push(__local_53, 58); + String::push(__local_53, 32); __local_54 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_53 }; __local_157 = __local_54; i32::fmt_decimal(__v0_22, __local_157); - String::append_char(__local_53, 10); + String::push(__local_53, 10); break __tmpl: __local_53; }); unreachable; @@ -569,30 +569,30 @@ condition: d[0] == 20 if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_55 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_55, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_55, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_55, 32); - String::append_char(__local_55, 97); - String::append_char(__local_55, 116); - String::append_char(__local_55, 32); - String::append(__local_55, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_55, 58); + String::push_str(__local_55, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_55, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_55, 32); + String::push(__local_55, 97); + String::push(__local_55, 116); + String::push(__local_55, 32); + String::push_str(__local_55, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_55, 58); __local_56 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_55 }; __local_165 = __local_56; i32::fmt_decimal(113, __local_165); - String::append(__local_55, String { repr: array.new_data(" + String::push_str(__local_55, String { repr: array.new_data(" condition: c[0] == 10 "), used: 23 }); - String::append_char(__local_55, 99); - String::append_char(__local_55, 91); - String::append_char(__local_55, 48); - String::append_char(__local_55, 93); - String::append_char(__local_55, 58); - String::append_char(__local_55, 32); + String::push(__local_55, 99); + String::push(__local_55, 91); + String::push(__local_55, 48); + String::push(__local_55, 93); + String::push(__local_55, 58); + String::push(__local_55, 32); __local_56 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_55 }; __local_170 = __local_56; i32::fmt_decimal(__v0_24, __local_170); - String::append_char(__local_55, 10); + String::push(__local_55, 10); break __tmpl: __local_55; }); unreachable; @@ -603,7 +603,7 @@ condition: c[0] == 10 }; f = __inline_push_zero_75: block -> ref Array { __local_182 = value_copy Array(e); - Array::append(__local_182, 0); + Array::push(__local_182, 0); break __inline_push_zero_75: __local_182; }; __v0_29 = f.used; @@ -611,25 +611,25 @@ condition: c[0] == 10 if __cond_30 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_57 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_57, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_57, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_57, 32); - String::append_char(__local_57, 97); - String::append_char(__local_57, 116); - String::append_char(__local_57, 32); - String::append(__local_57, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_57, 58); + String::push_str(__local_57, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_57, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_57, 32); + String::push(__local_57, 97); + String::push(__local_57, 116); + String::push(__local_57, 32); + String::push_str(__local_57, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_57, 58); __local_58 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_57 }; __local_187 = __local_58; i32::fmt_decimal(118, __local_187); - String::append(__local_57, String { repr: array.new_data(" + String::push_str(__local_57, String { repr: array.new_data(" condition: f.len() == 4 "), used: 25 }); - String::append(__local_57, String { repr: array.new_data("f.len(): "), used: 9 }); + String::push_str(__local_57, String { repr: array.new_data("f.len(): "), used: 9 }); __local_58 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_57 }; __local_192 = __local_58; i32::fmt_decimal(__v0_29, __local_192); - String::append_char(__local_57, 10); + String::push(__local_57, 10); break __tmpl: __local_57; }); unreachable; @@ -639,25 +639,25 @@ condition: f.len() == 4 if __cond_32 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_59 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_59, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_59, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_59, 32); - String::append_char(__local_59, 97); - String::append_char(__local_59, 116); - String::append_char(__local_59, 32); - String::append(__local_59, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_59, 58); + String::push_str(__local_59, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_59, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_59, 32); + String::push(__local_59, 97); + String::push(__local_59, 116); + String::push(__local_59, 32); + String::push_str(__local_59, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_59, 58); __local_60 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_59 }; __local_199 = __local_60; i32::fmt_decimal(119, __local_199); - String::append(__local_59, String { repr: array.new_data(" + String::push_str(__local_59, String { repr: array.new_data(" condition: e.len() == 3 "), used: 25 }); - String::append(__local_59, String { repr: array.new_data("e.len(): "), used: 9 }); + String::push_str(__local_59, String { repr: array.new_data("e.len(): "), used: 9 }); __local_60 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_59 }; __local_204 = __local_60; i32::fmt_decimal(__v0_31, __local_204); - String::append_char(__local_59, 10); + String::push(__local_59, 10); break __tmpl: __local_59; }); unreachable; @@ -671,25 +671,25 @@ condition: e.len() == 3 if __cond_36 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_61 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_61, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_61, String { repr: array.new_data("mut_param_string"), used: 16 }); - String::append_char(__local_61, 32); - String::append_char(__local_61, 97); - String::append_char(__local_61, 116); - String::append_char(__local_61, 32); - String::append(__local_61, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_61, 58); + String::push_str(__local_61, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_61, String { repr: array.new_data("mut_param_string"), used: 16 }); + String::push(__local_61, 32); + String::push(__local_61, 97); + String::push(__local_61, 116); + String::push(__local_61, 32); + String::push_str(__local_61, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_61, 58); __local_62 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_61 }; __local_212 = __local_62; i32::fmt_decimal(124, __local_212); - String::append(__local_61, String { repr: array.new_data(" + String::push_str(__local_61, String { repr: array.new_data(" condition: compute(p, q) == 13 "), used: 32 }); - String::append(__local_61, String { repr: array.new_data("compute(p, q): "), used: 15 }); + String::push_str(__local_61, String { repr: array.new_data("compute(p, q): "), used: 15 }); __local_62 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_61 }; __local_217 = __local_62; i32::fmt_decimal(__v0_35, __local_217); - String::append_char(__local_61, 10); + String::push(__local_61, 10); break __tmpl: __local_61; }); unreachable; @@ -777,29 +777,29 @@ fn mut_param_struct() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_26, String { repr: array.new_data("mut_param_struct"), used: 16 }); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_26, String { repr: array.new_data("mut_param_struct"), used: 16 }); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_50 = __local_27; i32::fmt_decimal(136, __local_50); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: q.x == 0 "), used: 21 }); - String::append_char(__local_26, 113); - String::append_char(__local_26, 46); - String::append_char(__local_26, 120); - String::append_char(__local_26, 58); - String::append_char(__local_26, 32); + String::push(__local_26, 113); + String::push(__local_26, 46); + String::push(__local_26, 120); + String::push(__local_26, 58); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_55 = __local_27; i32::fmt_decimal(__v0_2, __local_55); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -809,29 +809,29 @@ condition: q.x == 0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("mut_param_struct"), used: 16 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("mut_param_struct"), used: 16 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_61 = __local_29; i32::fmt_decimal(137, __local_61); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: q.y == 0 "), used: 21 }); - String::append_char(__local_28, 113); - String::append_char(__local_28, 46); - String::append_char(__local_28, 121); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 113); + String::push(__local_28, 46); + String::push(__local_28, 121); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_66 = __local_29; i32::fmt_decimal(__v0_4, __local_66); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -841,29 +841,29 @@ condition: q.y == 0 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_30, String { repr: array.new_data("mut_param_struct"), used: 16 }); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_30, String { repr: array.new_data("mut_param_struct"), used: 16 }); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_72 = __local_31; i32::fmt_decimal(138, __local_72); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: p.x == 5 "), used: 21 }); - String::append_char(__local_30, 112); - String::append_char(__local_30, 46); - String::append_char(__local_30, 120); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 112); + String::push(__local_30, 46); + String::push(__local_30, 120); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_77 = __local_31; i32::fmt_decimal(__v0_6, __local_77); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -873,29 +873,29 @@ condition: p.x == 5 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_32, String { repr: array.new_data("mut_param_struct"), used: 16 }); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_32, String { repr: array.new_data("mut_param_struct"), used: 16 }); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_83 = __local_33; i32::fmt_decimal(139, __local_83); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: p.y == 10 "), used: 22 }); - String::append_char(__local_32, 112); - String::append_char(__local_32, 46); - String::append_char(__local_32, 121); - String::append_char(__local_32, 58); - String::append_char(__local_32, 32); + String::push(__local_32, 112); + String::push(__local_32, 46); + String::push(__local_32, 121); + String::push(__local_32, 58); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_88 = __local_33; i32::fmt_decimal(__v0_8, __local_88); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -907,29 +907,29 @@ condition: p.y == 10 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_34, String { repr: array.new_data("mut_param_struct"), used: 16 }); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_34, String { repr: array.new_data("mut_param_struct"), used: 16 }); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_94 = __local_35; i32::fmt_decimal(144, __local_94); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: b.x == 11 "), used: 22 }); - String::append_char(__local_34, 98); - String::append_char(__local_34, 46); - String::append_char(__local_34, 120); - String::append_char(__local_34, 58); - String::append_char(__local_34, 32); + String::push(__local_34, 98); + String::push(__local_34, 46); + String::push(__local_34, 120); + String::push(__local_34, 58); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_99 = __local_35; i32::fmt_decimal(__v0_12, __local_99); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -939,29 +939,29 @@ condition: b.x == 11 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_36, String { repr: array.new_data("mut_param_struct"), used: 16 }); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_36, String { repr: array.new_data("mut_param_struct"), used: 16 }); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_105 = __local_37; i32::fmt_decimal(145, __local_105); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: b.y == 22 "), used: 22 }); - String::append_char(__local_36, 98); - String::append_char(__local_36, 46); - String::append_char(__local_36, 121); - String::append_char(__local_36, 58); - String::append_char(__local_36, 32); + String::push(__local_36, 98); + String::push(__local_36, 46); + String::push(__local_36, 121); + String::push(__local_36, 58); + String::push(__local_36, 32); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_110 = __local_37; i32::fmt_decimal(__v0_14, __local_110); - String::append_char(__local_36, 10); + String::push(__local_36, 10); break __tmpl: __local_36; }); unreachable; @@ -971,29 +971,29 @@ condition: b.y == 22 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_38, String { repr: array.new_data("mut_param_struct"), used: 16 }); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_38, String { repr: array.new_data("mut_param_struct"), used: 16 }); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_116 = __local_39; i32::fmt_decimal(146, __local_116); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: a.x == 1 "), used: 21 }); - String::append_char(__local_38, 97); - String::append_char(__local_38, 46); - String::append_char(__local_38, 120); - String::append_char(__local_38, 58); - String::append_char(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 46); + String::push(__local_38, 120); + String::push(__local_38, 58); + String::push(__local_38, 32); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_121 = __local_39; i32::fmt_decimal(__v0_16, __local_121); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; @@ -1003,29 +1003,29 @@ condition: a.x == 1 if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_40, String { repr: array.new_data("mut_param_struct"), used: 16 }); - String::append_char(__local_40, 32); - String::append_char(__local_40, 97); - String::append_char(__local_40, 116); - String::append_char(__local_40, 32); - String::append(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_40, 58); + String::push_str(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_40, String { repr: array.new_data("mut_param_struct"), used: 16 }); + String::push(__local_40, 32); + String::push(__local_40, 97); + String::push(__local_40, 116); + String::push(__local_40, 32); + String::push_str(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_40, 58); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_127 = __local_41; i32::fmt_decimal(147, __local_127); - String::append(__local_40, String { repr: array.new_data(" + String::push_str(__local_40, String { repr: array.new_data(" condition: a.y == 2 "), used: 21 }); - String::append_char(__local_40, 97); - String::append_char(__local_40, 46); - String::append_char(__local_40, 121); - String::append_char(__local_40, 58); - String::append_char(__local_40, 32); + String::push(__local_40, 97); + String::push(__local_40, 46); + String::push(__local_40, 121); + String::push(__local_40, 58); + String::push(__local_40, 32); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_132 = __local_41; i32::fmt_decimal(__v0_18, __local_132); - String::append_char(__local_40, 10); + String::push(__local_40, 10); break __tmpl: __local_40; }); unreachable; @@ -1041,29 +1041,29 @@ condition: a.y == 2 if __cond_23 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_42, String { repr: array.new_data("mut_param_struct"), used: 16 }); - String::append_char(__local_42, 32); - String::append_char(__local_42, 97); - String::append_char(__local_42, 116); - String::append_char(__local_42, 32); - String::append(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_42, 58); + String::push_str(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_42, String { repr: array.new_data("mut_param_struct"), used: 16 }); + String::push(__local_42, 32); + String::push(__local_42, 97); + String::push(__local_42, 116); + String::push(__local_42, 32); + String::push_str(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_42, 58); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_140 = __local_43; i32::fmt_decimal(152, __local_140); - String::append(__local_42, String { repr: array.new_data(" + String::push_str(__local_42, String { repr: array.new_data(" condition: d.x == 4 "), used: 21 }); - String::append_char(__local_42, 100); - String::append_char(__local_42, 46); - String::append_char(__local_42, 120); - String::append_char(__local_42, 58); - String::append_char(__local_42, 32); + String::push(__local_42, 100); + String::push(__local_42, 46); + String::push(__local_42, 120); + String::push(__local_42, 58); + String::push(__local_42, 32); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_145 = __local_43; i32::fmt_decimal(__v0_22, __local_145); - String::append_char(__local_42, 10); + String::push(__local_42, 10); break __tmpl: __local_42; }); unreachable; @@ -1073,29 +1073,29 @@ condition: d.x == 4 if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_44, String { repr: array.new_data("mut_param_struct"), used: 16 }); - String::append_char(__local_44, 32); - String::append_char(__local_44, 97); - String::append_char(__local_44, 116); - String::append_char(__local_44, 32); - String::append(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); - String::append_char(__local_44, 58); + String::push_str(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_44, String { repr: array.new_data("mut_param_struct"), used: 16 }); + String::push(__local_44, 32); + String::push(__local_44, 97); + String::push(__local_44, 116); + String::push(__local_44, 32); + String::push_str(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_param_merged.wado"), used: 50 }); + String::push(__local_44, 58); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_151 = __local_45; i32::fmt_decimal(153, __local_151); - String::append(__local_44, String { repr: array.new_data(" + String::push_str(__local_44, String { repr: array.new_data(" condition: c.x == 3 "), used: 21 }); - String::append_char(__local_44, 99); - String::append_char(__local_44, 46); - String::append_char(__local_44, 120); - String::append_char(__local_44, 58); - String::append_char(__local_44, 32); + String::push(__local_44, 99); + String::push(__local_44, 46); + String::push(__local_44, 120); + String::push(__local_44, 58); + String::push(__local_44, 32); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_156 = __local_45; i32::fmt_decimal(__v0_24, __local_156); - String::append_char(__local_44, 10); + String::push(__local_44, 10); break __tmpl: __local_44; }); unreachable; @@ -1343,7 +1343,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1431,7 +1431,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1458,7 +1458,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1511,7 +1511,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l65; }; @@ -1545,20 +1545,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1568,10 +1568,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1581,10 +1581,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1592,10 +1592,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1607,7 +1607,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1624,22 +1624,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b84; @@ -1647,7 +1647,7 @@ fn String^Inspect::inspect(self, f) { continue l85; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/mut_ref_if_return.wir.wado b/wado-compiler/tests/fixtures.golden/mut_ref_if_return.wir.wado index 32ca95b43..ad1da0ccf 100644 --- a/wado-compiler/tests/fixtures.golden/mut_ref_if_return.wir.wado +++ b/wado-compiler/tests/fixtures.golden/mut_ref_if_return.wir.wado @@ -122,15 +122,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Parser::advance" = fn(ref Parser) -> ref Token; type "functype/Parser::expect" = fn(ref Parser, i32) -> ref Result; -type "functype/Array::append" = fn(ref Array, ref Token); +type "functype/Array::push" = fn(ref Array, ref Token); type "functype/Array::grow" = fn(ref Array); @@ -266,40 +266,40 @@ fn parse_root(p) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("parse_root"), used: 10 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_ref_if_return.wado"), used: 51 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("parse_root"), used: 10 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/mut_ref_if_return.wado"), used: 51 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_14 = __local_9; i32::fmt_decimal(53, __local_14); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); - String::append(__local_8, __tmpl: block -> ref String { + String::push(__local_8, 58); + String::push(__local_8, 32); + String::push_str(__local_8, __tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(40), used: 0 }; - String::append(__local_6, String { repr: array.new_data("expected pos=1, got pos="), used: 24 }); + String::push_str(__local_6, String { repr: array.new_data("expected pos=1, got pos="), used: 24 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(p.pos, __local_7); break __tmpl: __local_6; }); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p.pos == 1 "), used: 23 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 46); - String::append_char(__local_8, 112); - String::append_char(__local_8, 111); - String::append_char(__local_8, 115); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 46); + String::push(__local_8, 112); + String::push(__local_8, 111); + String::push(__local_8, 115); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_25 = __local_9; i32::fmt_decimal(__v0, __local_25); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -326,14 +326,14 @@ fn run() { e = __sroa___sroa_r_value_case1_payload_0; "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_5, 101); - String::append_char(__local_5, 114); - String::append_char(__local_5, 114); - String::append_char(__local_5, 111); - String::append_char(__local_5, 114); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); - String::append(__local_5, e); + String::push(__local_5, 101); + String::push(__local_5, 114); + String::push(__local_5, 114); + String::push(__local_5, 111); + String::push(__local_5, 114); + String::push(__local_5, 58); + String::push(__local_5, 32); + String::push_str(__local_5, e); break __tmpl: __local_5; }); unreachable; @@ -536,7 +536,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -551,7 +551,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -613,14 +613,14 @@ fn Parser::expect(self, kind) { }; return Result::Err { discriminant: 1, payload_0: ref.as_non_null(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_2, String { repr: array.new_data("expected "), used: 9 }); + String::push_str(__local_2, String { repr: array.new_data("expected "), used: 9 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(kind, __local_3); break __tmpl: __local_2; }) }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -673,7 +673,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l44; }; @@ -707,20 +707,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -730,10 +730,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -743,10 +743,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -754,10 +754,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/namespace_import.wir.wado b/wado-compiler/tests/fixtures.golden/namespace_import.wir.wado index 79cf79d60..dd0064f7f 100644 --- a/wado-compiler/tests/fixtures.golden/namespace_import.wir.wado +++ b/wado-compiler/tests/fixtures.golden/namespace_import.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,8 +102,8 @@ fn run() with Stdout { __local_2 = String { repr: builtin::array_new(33), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(30, __local_3); - String::append_char(__local_2, 32); - String::append(__local_2, msg); + String::push(__local_2, 32); + String::push_str(__local_2, msg); break __tmpl: __local_2; }); } @@ -303,7 +303,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -318,7 +318,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -356,7 +356,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -390,20 +390,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -413,10 +413,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -426,10 +426,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -437,10 +437,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/namespace_import_enum.wir.wado b/wado-compiler/tests/fixtures.golden/namespace_import_enum.wir.wado index 8d84fa224..55168a3fb 100644 --- a/wado-compiler/tests/fixtures.golden/namespace_import_enum.wir.wado +++ b/wado-compiler/tests/fixtures.golden/namespace_import_enum.wir.wado @@ -108,7 +108,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -116,7 +116,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -193,7 +193,7 @@ fn run() with Stdout { r = ref.cast "./sub/ns_enum_helper.wado/Shape::Circle"(s).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_4, String { repr: array.new_data("circle r="), used: 9 }); + String::push_str(__local_4, String { repr: array.new_data("circle r="), used: 9 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; f64::fmt_into(r, __local_5); break __tmpl: __local_4; @@ -962,7 +962,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1017,7 +1017,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1049,7 +1049,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1131,25 +1131,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1250,9 +1250,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1306,13 +1306,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1347,9 +1347,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1390,7 +1390,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/namespace_import_struct.wir.wado b/wado-compiler/tests/fixtures.golden/namespace_import_struct.wir.wado index 4bcbe2b38..119e9b3cc 100644 --- a/wado-compiler/tests/fixtures.golden/namespace_import_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/namespace_import_struct.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -299,7 +299,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -314,7 +314,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -352,7 +352,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -386,20 +386,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -409,10 +409,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -422,10 +422,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -433,10 +433,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/nested_array.wir.wado b/wado-compiler/tests/fixtures.golden/nested_array.wir.wado index 6b68e804b..17ba9f871 100644 --- a/wado-compiler/tests/fixtures.golden/nested_array.wir.wado +++ b/wado-compiler/tests/fixtures.golden/nested_array.wir.wado @@ -144,15 +144,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String::concat" = fn(ref String, ref String) -> ref String; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayIter>^Iterator::next" = fn(ref "core:allocator/ArrayIter>") -> ref null Option; -type "functype/Array>::append" = fn(ref Array>, ref Option); +type "functype/Array>::push" = fn(ref Array>, ref Option); type "functype/Array>::grow" = fn(ref Array>); @@ -160,7 +160,7 @@ type "functype/Array>^Inspect::inspect" = fn(ref Array>, r type "functype/Array^Inspect::inspect" = fn(ref Array, ref Formatter); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -168,11 +168,11 @@ type "functype/ArrayIter>^Iterator::next" = fn(ref "core:allocator/Ar type "functype/ArrayIter>>^Iterator::next" = fn(ref "core:allocator/ArrayIter>>") -> ref null Array>; -type "functype/Array>::append" = fn(ref Array>, ref Array); +type "functype/Array>::push" = fn(ref Array>, ref Array); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array>>::append" = fn(ref Array>>, ref Array>); +type "functype/Array>>::push" = fn(ref Array>>, ref Array>); type "functype/Array>>::grow" = fn(ref Array>>); @@ -415,7 +415,7 @@ fn nested_array_iterate_test() with Stdout { __local_12 = String { repr: builtin::array_new(17), used: 0 }; __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(val, __local_13); - String::append_char(__local_12, 32); + String::push(__local_12, 32); break __tmpl: __local_12; }); } else { @@ -517,7 +517,7 @@ fn nested_array_mutate_test() with Stdout { }; break __inline_Array_Array_i32___IndexValue__index_value_15: builtin::array_get>(matrix.repr, 0); }; - Array::append(row, 99); + Array::push(row, 99); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(16), used: 0 }; __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; @@ -578,13 +578,13 @@ fn nested_array_option_access_test() with Stdout { x = ref.cast Option::Some(__pattern_temp_0).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_10, 102); - String::append_char(__local_10, 105); - String::append_char(__local_10, 114); - String::append_char(__local_10, 115); - String::append_char(__local_10, 116); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 102); + String::push(__local_10, 105); + String::push(__local_10, 114); + String::push(__local_10, 115); + String::push(__local_10, 116); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(x, __local_11); break __tmpl: __local_10; @@ -614,14 +614,14 @@ fn nested_array_option_access_test() with Stdout { __local_8 = __cast_1.payload_0; __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_12, 83); - String::append_char(__local_12, 111); - String::append_char(__local_12, 109); - String::append_char(__local_12, 101); - String::append_char(__local_12, 40); + String::push(__local_12, 83); + String::push(__local_12, 111); + String::push(__local_12, 109); + String::push(__local_12, 101); + String::push(__local_12, 40); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(__local_8, __local_13); - String::append_char(__local_12, 41); + String::push(__local_12, 41); break __tmpl: __local_12; }; } else if __match_scrut_0.discriminant == 1 -> ref String { @@ -883,7 +883,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -912,7 +912,7 @@ fn String::concat(a, b) { return String { repr: repr, used: total }; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -949,7 +949,7 @@ fn ArrayIter>^Iterator::next(self) { return item; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -997,7 +997,7 @@ fn Array>^Inspect::inspect(self, f) { let __local_9: i32; let _licm_used_12: i32; let _licm_repr_13: ref array>; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_12 = self.used; @@ -1009,7 +1009,7 @@ fn Array>^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; Array^Inspect::inspect(__inline_Array_Array_i32___IndexValue__index_value_3: block -> ref Array { __local_9 = i; @@ -1020,7 +1020,7 @@ fn Array>^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } fn Array^Inspect::inspect(self, f) { @@ -1029,7 +1029,7 @@ fn Array^Inspect::inspect(self, f) { let __local_11: i32; let _licm_used_16: i32; let _licm_repr_17: ref array; - String::append_char(f.buf, 91); + String::push(f.buf, 91); __for_5: block { i = 0; _licm_used_16 = self.used; @@ -1041,7 +1041,7 @@ fn Array^Inspect::inspect(self, f) { }; if i > 0 { s = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s); + String::push_str(f.buf, s); }; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_4: block -> i32 { __local_11 = i; @@ -1052,10 +1052,10 @@ fn Array^Inspect::inspect(self, f) { }; }; }; - String::append_char(f.buf, 93); + String::push(f.buf, 93); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1127,7 +1127,7 @@ fn ArrayIter>>^Iterator::next(self) { return item; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1169,7 +1169,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array>>::append(self, value) { +fn Array>>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1222,7 +1222,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l88; }; @@ -1256,20 +1256,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1279,10 +1279,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1292,10 +1292,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1303,10 +1303,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/never_merged.wir.wado b/wado-compiler/tests/fixtures.golden/never_merged.wir.wado index e65619c22..bf2d0847d 100644 --- a/wado-compiler/tests/fixtures.golden/never_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/never_merged.wir.wado @@ -85,11 +85,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -172,27 +172,27 @@ fn __test_0_as_bottom_type() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_0_as_bottom_type"), used: 23 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/never_merged.wado"), used: 46 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_0_as_bottom_type"), used: 23 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/never_merged.wado"), used: 46 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_32 = __local_19; i32::fmt_decimal(18, __local_32); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: a == 15 "), used: 20 }); - String::append_char(__local_18, 97); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_37 = __local_19; i32::fmt_decimal(a, __local_37); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -214,29 +214,29 @@ condition: a == 15 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_0_as_bottom_type"), used: 23 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/never_merged.wado"), used: 46 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_0_as_bottom_type"), used: 23 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/never_merged.wado"), used: 46 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_43 = __local_21; i32::fmt_decimal(28, __local_43); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: p.x == 5 "), used: 21 }); - String::append_char(__local_20, 112); - String::append_char(__local_20, 46); - String::append_char(__local_20, 120); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 112); + String::push(__local_20, 46); + String::push(__local_20, 120); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_48 = __local_21; i32::fmt_decimal(__sroa_p_x, __local_48); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -266,32 +266,32 @@ condition: p.x == 5 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_0_as_bottom_type"), used: 23 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/never_merged.wado"), used: 46 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_0_as_bottom_type"), used: 23 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/never_merged.wado"), used: 46 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_63 = __local_23; i32::fmt_decimal(35, __local_63); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: arr[0] == 5 "), used: 24 }); - String::append_char(__local_22, 97); - String::append_char(__local_22, 114); - String::append_char(__local_22, 114); - String::append_char(__local_22, 91); - String::append_char(__local_22, 48); - String::append_char(__local_22, 93); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 114); + String::push(__local_22, 114); + String::push(__local_22, 91); + String::push(__local_22, 48); + String::push(__local_22, 93); + String::push(__local_22, 58); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_68 = __local_23; i32::fmt_decimal(__v0, __local_68); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -311,27 +311,27 @@ condition: arr[0] == 5 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("__test_0_as_bottom_type"), used: 23 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/never_merged.wado"), used: 46 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("__test_0_as_bottom_type"), used: 23 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/never_merged.wado"), used: 46 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_74 = __local_25; i32::fmt_decimal(42, __local_74); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: b == 8 "), used: 19 }); - String::append_char(__local_24, 98); - String::append_char(__local_24, 58); - String::append_char(__local_24, 32); + String::push(__local_24, 98); + String::push(__local_24, 58); + String::push(__local_24, 32); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_79 = __local_25; i32::fmt_decimal(b, __local_79); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -365,27 +365,27 @@ fn __test_1_let_binding() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_1_let_binding"), used: 20 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/never_merged.wado"), used: 46 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_1_let_binding"), used: 20 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/never_merged.wado"), used: 46 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(51, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: x == 42 "), used: 20 }); - String::append_char(__local_5, 120); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 120); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_16 = __local_6; i32::fmt_decimal(x, __local_16); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -593,7 +593,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -608,7 +608,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -635,7 +635,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -688,7 +688,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l43; }; @@ -722,20 +722,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -745,10 +745,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -758,10 +758,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -769,10 +769,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_array_sort.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_array_sort.wir.wado index 56b4e743e..44607c9ce 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_array_sort.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_array_sort.wir.wado @@ -87,13 +87,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Array::sorted" = fn(ref Array) -> ref Array; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -160,8 +160,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_13: builtin::array_get(scores.repr, 0); }, __local_25); - String::append_char(__local_5, 44); - String::append_char(__local_5, 32); + String::push(__local_5, 44); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_32 = __local_6; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_17: block -> i32 { @@ -171,8 +171,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_17: builtin::array_get(scores.repr, 1); }, __local_32); - String::append_char(__local_5, 44); - String::append_char(__local_5, 32); + String::push(__local_5, 44); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_39 = __local_6; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_21: block -> i32 { @@ -182,8 +182,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_21: builtin::array_get(scores.repr, 2); }, __local_39); - String::append_char(__local_5, 44); - String::append_char(__local_5, 32); + String::push(__local_5, 44); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_46 = __local_6; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_25: block -> i32 { @@ -202,14 +202,14 @@ fn run() with Stdout { sorted = Array::sorted(orig); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(60), used: 0 }; - String::append_char(__local_7, 115); - String::append_char(__local_7, 111); - String::append_char(__local_7, 114); - String::append_char(__local_7, 116); - String::append_char(__local_7, 101); - String::append_char(__local_7, 100); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 111); + String::push(__local_7, 114); + String::push(__local_7, 116); + String::push(__local_7, 101); + String::push(__local_7, 100); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_63 = __local_8; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_36: block -> i32 { @@ -219,8 +219,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_36: builtin::array_get(sorted.repr, 0); }, __local_63); - String::append_char(__local_7, 44); - String::append_char(__local_7, 32); + String::push(__local_7, 44); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_70 = __local_8; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_40: block -> i32 { @@ -230,8 +230,8 @@ fn run() with Stdout { }; break __inline_Array_i32__IndexValue__index_value_40: builtin::array_get(sorted.repr, 1); }, __local_70); - String::append_char(__local_7, 44); - String::append_char(__local_7, 32); + String::push(__local_7, 44); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_77 = __local_8; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_44: block -> i32 { @@ -487,7 +487,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -502,7 +502,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -541,7 +541,7 @@ fn Array::sorted(self) { return copy; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -605,18 +605,18 @@ fn Array::sort_by$__Closure_0(self, cmp) { src = self.repr; buf = builtin::array_new(n); width = 1; - __for_5: block { + __for_11: block { block { l38: loop { if (width < n) == 0 { - break __for_5; + break __for_11; }; - __for_6: block { + __for_12: block { start = 0; block { l41: loop { if (start < n) == 0 { - break __for_6; + break __for_12; }; mid = start + width; if mid < n { @@ -626,12 +626,12 @@ fn Array::sort_by$__Closure_0(self, cmp) { }; i = start; j = mid; - __for_7: block { + __for_13: block { k = start; block { l45: loop { if (k < end) == 0 { - break __for_7; + break __for_13; }; if i < mid { if j < end { @@ -683,7 +683,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l51; }; @@ -717,20 +717,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -740,10 +740,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -753,10 +753,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -764,10 +764,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_basic.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_basic.wir.wado index 8b5932c7c..433ffdd06 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_basic.wir.wado @@ -93,7 +93,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -101,9 +101,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -177,22 +177,22 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_7, String { repr: array.new_data("sum of meters: "), used: 15 }); + String::push_str(__local_7, String { repr: array.new_data("sum of meters: "), used: 15 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_20 = __local_8; f64::inspect_into(1500, __local_20); __local_24 = String { repr: array.new_data(" as Meters"), used: 10 }; - String::append(__local_20.buf, __local_24); + String::push_str(__local_20.buf, __local_24); break __tmpl: __local_7; }); raw = 1000; "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_9, 114); - String::append_char(__local_9, 97); - String::append_char(__local_9, 119); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 114); + String::push(__local_9, 97); + String::push(__local_9, 119); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; f64::fmt_into(raw, __local_10); break __tmpl: __local_9; @@ -200,23 +200,23 @@ fn run() with Stdout { from_raw = 100; "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_11, String { repr: array.new_data("from_raw: "), used: 10 }); + String::push_str(__local_11, String { repr: array.new_data("from_raw: "), used: 10 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_34 = __local_12; f64::inspect_into(from_raw, __local_34); __local_38 = String { repr: array.new_data(" as Meters"), used: 10 }; - String::append(__local_34.buf, __local_38); + String::push_str(__local_34.buf, __local_38); break __tmpl: __local_11; }); km_from_m = 1000 / 1000; "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_13, String { repr: array.new_data("km_from_m: "), used: 11 }); + String::push_str(__local_13, String { repr: array.new_data("km_from_m: "), used: 11 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_44 = __local_14; f64::inspect_into(km_from_m, __local_44); __local_48 = String { repr: array.new_data(" as Kilometers"), used: 14 }; - String::append(__local_44.buf, __local_48); + String::push_str(__local_44.buf, __local_48); break __tmpl: __local_13; }); } @@ -982,8 +982,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1038,13 +1038,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1052,25 +1052,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1078,7 +1078,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1120,8 +1120,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1153,7 +1153,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1235,27 +1235,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1356,9 +1356,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1425,9 +1425,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1437,8 +1437,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1493,13 +1493,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1534,9 +1534,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1577,7 +1577,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1592,7 +1592,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/newtype_chained.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_chained.wir.wado index 7452007b5..270af2bc5 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_chained.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_chained.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -114,41 +114,41 @@ fn run() with Stdout { let __local_81: ref String; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(78), used: 0 }; - String::append_char(__local_6, 99); - String::append_char(__local_6, 61); + String::push(__local_6, 99); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_14 = __local_7; i32::fmt_decimal(1, __local_14); __local_26 = String { repr: array.new_data(" as A"), used: 5 }; - String::append(__local_14.buf, __local_26); + String::push_str(__local_14.buf, __local_26); __local_28 = String { repr: array.new_data(" as B"), used: 5 }; - String::append(__local_14.buf, __local_28); + String::push_str(__local_14.buf, __local_28); __local_30 = String { repr: array.new_data(" as C"), used: 5 }; - String::append(__local_14.buf, __local_30); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); - String::append_char(__local_6, 98); - String::append_char(__local_6, 61); + String::push_str(__local_14.buf, __local_30); + String::push(__local_6, 44); + String::push(__local_6, 32); + String::push(__local_6, 98); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_33 = __local_7; i32::fmt_decimal(1, __local_33); __local_43 = String { repr: array.new_data(" as A"), used: 5 }; - String::append(__local_33.buf, __local_43); + String::push_str(__local_33.buf, __local_43); __local_45 = String { repr: array.new_data(" as B"), used: 5 }; - String::append(__local_33.buf, __local_45); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 61); + String::push_str(__local_33.buf, __local_45); + String::push(__local_6, 44); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_48 = __local_7; i32::fmt_decimal(1, __local_48); __local_56 = String { repr: array.new_data(" as A"), used: 5 }; - String::append(__local_48.buf, __local_56); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); - String::append_char(__local_6, 105); - String::append_char(__local_6, 61); + String::push_str(__local_48.buf, __local_56); + String::push(__local_6, 44); + String::push(__local_6, 32); + String::push(__local_6, 105); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_59 = __local_7; i32::fmt_decimal(1, __local_59); @@ -156,20 +156,20 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_8, 115); - String::append_char(__local_8, 117); - String::append_char(__local_8, 109); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 115); + String::push(__local_8, 117); + String::push(__local_8, 109); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_67 = __local_9; i32::fmt_decimal(3, __local_67); __local_77 = String { repr: array.new_data(" as A"), used: 5 }; - String::append(__local_67.buf, __local_77); + String::push_str(__local_67.buf, __local_77); __local_79 = String { repr: array.new_data(" as B"), used: 5 }; - String::append(__local_67.buf, __local_79); + String::push_str(__local_67.buf, __local_79); __local_81 = String { repr: array.new_data(" as C"), used: 5 }; - String::append(__local_67.buf, __local_81); + String::push_str(__local_67.buf, __local_81); break __tmpl: __local_8; }); } @@ -369,7 +369,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -384,7 +384,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -422,7 +422,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -456,20 +456,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -479,10 +479,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -492,10 +492,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -503,10 +503,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_chained_method.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_chained_method.wir.wado index 9f7b434be..c1ec3f499 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_chained_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_chained_method.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -104,17 +104,17 @@ fn run() with Stdout { __sroa_c3_y = 2 + 4; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(40), used: 0 }; - String::append_char(__local_3, 120); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 120); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_11 = __local_4; i32::fmt_decimal(__sroa_c3_x, __local_11); - String::append_char(__local_3, 44); - String::append_char(__local_3, 32); - String::append_char(__local_3, 121); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 44); + String::push(__local_3, 32); + String::push(__local_3, 121); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_16 = __local_4; i32::fmt_decimal(__sroa_c3_y, __local_16); @@ -317,7 +317,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -332,7 +332,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -370,7 +370,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -404,20 +404,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -427,10 +427,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -440,10 +440,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -451,10 +451,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_generic.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_generic.wir.wado index 68d18e053..f45e30e54 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_generic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_generic.wir.wado @@ -86,15 +86,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -145,24 +145,24 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_6, 108); - String::append_char(__local_6, 101); - String::append_char(__local_6, 110); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 108); + String::push(__local_6, 101); + String::push(__local_6, 110); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(arr.used, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_8, 102); - String::append_char(__local_8, 105); - String::append_char(__local_8, 114); - String::append_char(__local_8, 115); - String::append_char(__local_8, 116); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 102); + String::push(__local_8, 105); + String::push(__local_8, 114); + String::push(__local_8, 115); + String::push(__local_8, 116); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_16: block -> i32 { if 0 >= arr.used { @@ -177,10 +177,10 @@ fn run() with Stdout { __local_2 = Array { repr: array.new_fixed(10, 20), used: 2 }; break __seq_lit: __local_2; }; - Array::append(arr2, 30); + Array::push(arr2, 30); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_10, String { repr: array.new_data("after append: "), used: 14 }); + String::push_str(__local_10, String { repr: array.new_data("after append: "), used: 14 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(arr2.used, __local_11); break __tmpl: __local_10; @@ -191,12 +191,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_12, 115); - String::append_char(__local_12, 116); - String::append_char(__local_12, 114); - String::append_char(__local_12, 115); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 115); + String::push(__local_12, 116); + String::push(__local_12, 114); + String::push(__local_12, 115); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(strs.used, __local_13); break __tmpl: __local_12; @@ -435,7 +435,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -450,7 +450,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -477,7 +477,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -519,7 +519,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -572,7 +572,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l33; }; @@ -606,20 +606,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -629,10 +629,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -642,10 +642,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -653,10 +653,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_generic_container_return.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_generic_container_return.wir.wado index ef88b6128..11bf09814 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_generic_container_return.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_generic_container_return.wir.wado @@ -84,11 +84,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref Point); +type "functype/Array::push" = fn(ref Array, ref Point); type "functype/Array::grow" = fn(ref Array); @@ -142,16 +142,16 @@ fn run() with Stdout { l = value_copy Point(ref.as_non_null(opt)); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(44), used: 0 }; - String::append(__local_5, String { repr: array.new_data("option: ("), used: 9 }); + String::push_str(__local_5, String { repr: array.new_data("option: ("), used: 9 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_17 = __local_6; i32::fmt_decimal(l.x, __local_17); - String::append_char(__local_5, 44); - String::append_char(__local_5, 32); + String::push(__local_5, 44); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_22 = __local_6; i32::fmt_decimal(l.y, __local_22); - String::append_char(__local_5, 41); + String::push(__local_5, 41); break __tmpl: __local_5; }); }; @@ -160,12 +160,12 @@ fn run() with Stdout { __local_26 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_26; }; - Array::append(__local_27, Point { x: loc.x, y: loc.y }); + Array::push(__local_27, Point { x: loc.x, y: loc.y }); break __inline_Point__make_list_10: __local_27; }; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_7, String { repr: array.new_data("array len: "), used: 11 }); + String::push_str(__local_7, String { repr: array.new_data("array len: "), used: 11 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(arr.used, __local_8); break __tmpl: __local_7; @@ -179,16 +179,16 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(46), used: 0 }; - String::append(__local_9, String { repr: array.new_data("array[0]: ("), used: 11 }); + String::push_str(__local_9, String { repr: array.new_data("array[0]: ("), used: 11 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_43 = __local_10; i32::fmt_decimal(first.x, __local_43); - String::append_char(__local_9, 44); - String::append_char(__local_9, 32); + String::push(__local_9, 44); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_48 = __local_10; i32::fmt_decimal(first.y, __local_48); - String::append_char(__local_9, 41); + String::push(__local_9, 41); break __tmpl: __local_9; }); } @@ -425,7 +425,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -440,7 +440,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -467,7 +467,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -520,7 +520,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l30; }; @@ -554,20 +554,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -577,10 +577,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -590,10 +590,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -601,10 +601,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_impl.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_impl.wir.wado index b22f7953e..23f4c5360 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_impl.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_impl.wir.wado @@ -93,7 +93,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -101,9 +101,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -174,12 +174,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_4, String { repr: array.new_data("radians to degrees: "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("radians to degrees: "), used: 20 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_14 = __local_5; f64::inspect_into(d, __local_14); __local_18 = String { repr: array.new_data(" as Degrees"), used: 11 }; - String::append(__local_14.buf, __local_18); + String::push_str(__local_14.buf, __local_18); break __tmpl: __local_4; }); r2 = __inline_Degrees__to_radians_8: block -> f64 { @@ -188,12 +188,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_6, String { repr: array.new_data("degrees to radians: "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("degrees to radians: "), used: 20 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_25 = __local_7; f64::inspect_into(r2, __local_25); __local_29 = String { repr: array.new_data(" as Radians"), used: 11 }; - String::append(__local_25.buf, __local_29); + String::push_str(__local_25.buf, __local_29); break __tmpl: __local_6; }); } @@ -959,8 +959,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1015,13 +1015,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1029,25 +1029,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1055,7 +1055,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1097,8 +1097,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1130,7 +1130,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1212,27 +1212,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1335,9 +1335,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1347,8 +1347,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1403,13 +1403,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1444,9 +1444,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1487,7 +1487,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1502,7 +1502,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/newtype_index_trait.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_index_trait.wir.wado index 68e118c60..81f76e7b0 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_index_trait.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_index_trait.wir.wado @@ -78,9 +78,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/IntStore^IndexAssign::index_assign" = fn(ref IntStore, i32, i32); @@ -159,33 +159,33 @@ fn run() with Stdout { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_index_trait.wado"), used: 53 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_index_trait.wado"), used: 53 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_36 = __local_15; i32::fmt_decimal(44, __local_36); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: first == 10 "), used: 24 }); - String::append_char(__local_14, 102); - String::append_char(__local_14, 105); - String::append_char(__local_14, 114); - String::append_char(__local_14, 115); - String::append_char(__local_14, 116); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 102); + String::push(__local_14, 105); + String::push(__local_14, 114); + String::push(__local_14, 115); + String::push(__local_14, 116); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_41 = __local_15; i32::fmt_decimal(first, __local_41); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -194,46 +194,46 @@ condition: first == 10 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_index_trait.wado"), used: 53 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_index_trait.wado"), used: 53 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_47 = __local_17; i32::fmt_decimal(45, __local_47); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: second == 20 "), used: 25 }); - String::append_char(__local_16, 115); - String::append_char(__local_16, 101); - String::append_char(__local_16, 99); - String::append_char(__local_16, 111); - String::append_char(__local_16, 110); - String::append_char(__local_16, 100); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 115); + String::push(__local_16, 101); + String::push(__local_16, 99); + String::push(__local_16, 111); + String::push(__local_16, 110); + String::push(__local_16, 100); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_52 = __local_17; i32::fmt_decimal(second, __local_52); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(47), used: 0 }; - String::append(__local_18, String { repr: array.new_data("index_value: "), used: 13 }); + String::push_str(__local_18, String { repr: array.new_data("index_value: "), used: 13 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_58 = __local_19; i32::fmt_decimal(first, __local_58); - String::append_char(__local_18, 44); - String::append_char(__local_18, 32); + String::push(__local_18, 44); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_63 = __local_19; i32::fmt_decimal(second, __local_63); @@ -247,33 +247,33 @@ condition: second == 20 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_index_trait.wado"), used: 53 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_index_trait.wado"), used: 53 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_71 = __local_21; i32::fmt_decimal(52, __local_71); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: ms[0] == 100 "), used: 25 }); - String::append_char(__local_20, 109); - String::append_char(__local_20, 115); - String::append_char(__local_20, 91); - String::append_char(__local_20, 48); - String::append_char(__local_20, 93); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 109); + String::push(__local_20, 115); + String::push(__local_20, 91); + String::push(__local_20, 48); + String::push(__local_20, 93); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_76 = __local_21; i32::fmt_decimal(__v0_8, __local_76); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -283,33 +283,33 @@ condition: ms[0] == 100 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_index_trait.wado"), used: 53 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_index_trait.wado"), used: 53 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_84 = __local_23; i32::fmt_decimal(53, __local_84); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: ms[1] == 2 "), used: 23 }); - String::append_char(__local_22, 109); - String::append_char(__local_22, 115); - String::append_char(__local_22, 91); - String::append_char(__local_22, 49); - String::append_char(__local_22, 93); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); + String::push(__local_22, 109); + String::push(__local_22, 115); + String::push(__local_22, 91); + String::push(__local_22, 49); + String::push(__local_22, 93); + String::push(__local_22, 58); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_89 = __local_23; i32::fmt_decimal(__v0_10, __local_89); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -319,50 +319,50 @@ condition: ms[1] == 2 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_index_trait.wado"), used: 53 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_index_trait.wado"), used: 53 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_97 = __local_25; i32::fmt_decimal(54, __local_97); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: ms[2] == 300 "), used: 25 }); - String::append_char(__local_24, 109); - String::append_char(__local_24, 115); - String::append_char(__local_24, 91); - String::append_char(__local_24, 50); - String::append_char(__local_24, 93); - String::append_char(__local_24, 58); - String::append_char(__local_24, 32); + String::push(__local_24, 109); + String::push(__local_24, 115); + String::push(__local_24, 91); + String::push(__local_24, 50); + String::push(__local_24, 93); + String::push(__local_24, 58); + String::push(__local_24, 32); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_102 = __local_25; i32::fmt_decimal(__v0_12, __local_102); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(66), used: 0 }; - String::append(__local_26, String { repr: array.new_data("index_assign: "), used: 14 }); + String::push_str(__local_26, String { repr: array.new_data("index_assign: "), used: 14 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_108 = __local_27; i32::fmt_decimal(ms.a, __local_108); - String::append_char(__local_26, 44); - String::append_char(__local_26, 32); + String::push(__local_26, 44); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_115 = __local_27; i32::fmt_decimal(ms.b, __local_115); - String::append_char(__local_26, 44); - String::append_char(__local_26, 32); + String::push(__local_26, 44); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_122 = __local_27; i32::fmt_decimal(ms.c, __local_122); @@ -603,7 +603,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -618,7 +618,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -666,7 +666,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -700,20 +700,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -723,10 +723,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -736,10 +736,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -747,10 +747,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_integer_types.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_integer_types.wir.wado index a93cdc132..837ab1683 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_integer_types.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_integer_types.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -124,89 +124,89 @@ fn run() with Stdout { let __local_90: ref String; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_6, 117); - String::append_char(__local_6, 115); - String::append_char(__local_6, 101); - String::append_char(__local_6, 114); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 117); + String::push(__local_6, 115); + String::push(__local_6, 101); + String::push(__local_6, 114); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_24 = __local_7; i32::fmt_decimal(42, __local_24); __local_30 = String { repr: array.new_data(" as UserId"), used: 10 }; - String::append(__local_24.buf, __local_30); + String::push_str(__local_24.buf, __local_30); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_8, 116); - String::append_char(__local_8, 105); - String::append_char(__local_8, 109); - String::append_char(__local_8, 101); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 116); + String::push(__local_8, 105); + String::push(__local_8, 109); + String::push(__local_8, 101); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_36 = __local_9; i64::fmt_decimal(1706500000_i64, __local_36); __local_42 = String { repr: array.new_data(" as Timestamp"), used: 13 }; - String::append(__local_36.buf, __local_42); + String::push_str(__local_36.buf, __local_42); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_10, 99); - String::append_char(__local_10, 111); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 116); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 99); + String::push(__local_10, 111); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 116); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_48 = __local_11; u32::fmt_decimal(100, __local_48); __local_54 = String { repr: array.new_data(" as Count"), used: 9 }; - String::append(__local_48.buf, __local_54); + String::push_str(__local_48.buf, __local_54); break __tmpl: __local_10; }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_12, String { repr: array.new_data("next_user: "), used: 11 }); + String::push_str(__local_12, String { repr: array.new_data("next_user: "), used: 11 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_60 = __local_13; i32::fmt_decimal(43, __local_60); __local_66 = String { repr: array.new_data(" as UserId"), used: 10 }; - String::append(__local_60.buf, __local_66); + String::push_str(__local_60.buf, __local_66); break __tmpl: __local_12; }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_14, 108); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 101); - String::append_char(__local_14, 114); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 108); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 101); + String::push(__local_14, 114); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_72 = __local_15; i64::fmt_decimal(1706501000_i64, __local_72); __local_78 = String { repr: array.new_data(" as Timestamp"), used: 13 }; - String::append(__local_72.buf, __local_78); + String::push_str(__local_72.buf, __local_78); break __tmpl: __local_14; }); "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_16, 109); - String::append_char(__local_16, 111); - String::append_char(__local_16, 114); - String::append_char(__local_16, 101); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 109); + String::push(__local_16, 111); + String::push(__local_16, 114); + String::push(__local_16, 101); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_84 = __local_17; u32::fmt_decimal(150, __local_84); __local_90 = String { repr: array.new_data(" as Count"), used: 9 }; - String::append(__local_84.buf, __local_90); + String::push_str(__local_84.buf, __local_90); break __tmpl: __local_16; }); } @@ -465,7 +465,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -480,7 +480,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -518,7 +518,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -552,20 +552,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -575,10 +575,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -588,10 +588,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -599,10 +599,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_method_inheritance.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_method_inheritance.wir.wado index 3852a8edf..76e849304 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_method_inheritance.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_method_inheritance.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -113,11 +113,11 @@ fn run() with Stdout { s = loc1.x + loc1.y; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_4, 115); - String::append_char(__local_4, 117); - String::append_char(__local_4, 109); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 115); + String::push(__local_4, 117); + String::push(__local_4, 109); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(s, __local_5); break __tmpl: __local_4; @@ -126,23 +126,23 @@ fn run() with Stdout { __sroa_loc3_y = loc1.y + 5; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(43), used: 0 }; - String::append_char(__local_6, 97); - String::append_char(__local_6, 100); - String::append_char(__local_6, 100); - String::append_char(__local_6, 101); - String::append_char(__local_6, 100); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); - String::append_char(__local_6, 40); + String::push(__local_6, 97); + String::push(__local_6, 100); + String::push(__local_6, 100); + String::push(__local_6, 101); + String::push(__local_6, 100); + String::push(__local_6, 58); + String::push(__local_6, 32); + String::push(__local_6, 40); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_21 = __local_7; i32::fmt_decimal(__sroa_loc3_x, __local_21); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); + String::push(__local_6, 44); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_26 = __local_7; i32::fmt_decimal(__sroa_loc3_y, __local_26); - String::append_char(__local_6, 41); + String::push(__local_6, 41); break __tmpl: __local_6; }); } @@ -342,7 +342,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -357,7 +357,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -395,7 +395,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -429,20 +429,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -452,10 +452,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -465,10 +465,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -476,10 +476,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_multiple_params.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_multiple_params.wir.wado index ce0e43813..13459019c 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_multiple_params.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_multiple_params.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -315,7 +315,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -330,7 +330,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -372,7 +372,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -406,20 +406,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -442,10 +442,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -453,10 +453,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_operator_trait.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_operator_trait.wir.wado index 2f004760d..ffc3f98a8 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_operator_trait.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_operator_trait.wir.wado @@ -102,7 +102,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -112,9 +112,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Vec2^Inspect::inspect" = fn(ref Vec2, ref Formatter); @@ -263,32 +263,32 @@ fn run() with Stdout { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_30, 114); - String::append_char(__local_30, 117); - String::append_char(__local_30, 110); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_30, 114); + String::push(__local_30, 117); + String::push(__local_30, 110); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_61 = __local_31; i32::fmt_decimal(46, __local_61); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: p3.x == 4.0 "), used: 24 }); - String::append_char(__local_30, 112); - String::append_char(__local_30, 51); - String::append_char(__local_30, 46); - String::append_char(__local_30, 120); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 112); + String::push(__local_30, 51); + String::push(__local_30, 46); + String::push(__local_30, 120); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_66 = __local_31; f64::inspect_into(__sroa_p3_x, __local_66); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -297,48 +297,48 @@ condition: p3.x == 4.0 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_32, 114); - String::append_char(__local_32, 117); - String::append_char(__local_32, 110); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_32, 114); + String::push(__local_32, 117); + String::push(__local_32, 110); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_70 = __local_33; i32::fmt_decimal(47, __local_70); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: p3.y == 6.0 "), used: 24 }); - String::append_char(__local_32, 112); - String::append_char(__local_32, 51); - String::append_char(__local_32, 46); - String::append_char(__local_32, 121); - String::append_char(__local_32, 58); - String::append_char(__local_32, 32); + String::push(__local_32, 112); + String::push(__local_32, 51); + String::push(__local_32, 46); + String::push(__local_32, 121); + String::push(__local_32, 58); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_75 = __local_33; f64::inspect_into(__sroa_p3_y, __local_75); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_34, 97); - String::append_char(__local_34, 100); - String::append_char(__local_34, 100); - String::append_char(__local_34, 58); - String::append_char(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 100); + String::push(__local_34, 100); + String::push(__local_34, 58); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_79 = __local_35; f64::fmt_into(__sroa_p3_x, __local_79); - String::append_char(__local_34, 44); - String::append_char(__local_34, 32); + String::push(__local_34, 44); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_82 = __local_35; f64::fmt_into(__sroa_p3_y, __local_82); @@ -350,34 +350,34 @@ condition: p3.y == 6.0 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_36, 114); - String::append_char(__local_36, 117); - String::append_char(__local_36, 110); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_36, 114); + String::push(__local_36, 117); + String::push(__local_36, 110); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_88 = __local_37; i32::fmt_decimal(52, __local_88); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: diff.x == 2.0 "), used: 26 }); - String::append_char(__local_36, 100); - String::append_char(__local_36, 105); - String::append_char(__local_36, 102); - String::append_char(__local_36, 102); - String::append_char(__local_36, 46); - String::append_char(__local_36, 120); - String::append_char(__local_36, 58); - String::append_char(__local_36, 32); + String::push(__local_36, 100); + String::push(__local_36, 105); + String::push(__local_36, 102); + String::push(__local_36, 102); + String::push(__local_36, 46); + String::push(__local_36, 120); + String::push(__local_36, 58); + String::push(__local_36, 32); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_93 = __local_37; f64::inspect_into(__sroa_diff_x, __local_93); - String::append_char(__local_36, 10); + String::push(__local_36, 10); break __tmpl: __local_36; }); unreachable; @@ -386,50 +386,50 @@ condition: diff.x == 2.0 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_38, 114); - String::append_char(__local_38, 117); - String::append_char(__local_38, 110); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_38, 114); + String::push(__local_38, 117); + String::push(__local_38, 110); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_97 = __local_39; i32::fmt_decimal(53, __local_97); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: diff.y == 2.0 "), used: 26 }); - String::append_char(__local_38, 100); - String::append_char(__local_38, 105); - String::append_char(__local_38, 102); - String::append_char(__local_38, 102); - String::append_char(__local_38, 46); - String::append_char(__local_38, 121); - String::append_char(__local_38, 58); - String::append_char(__local_38, 32); + String::push(__local_38, 100); + String::push(__local_38, 105); + String::push(__local_38, 102); + String::push(__local_38, 102); + String::push(__local_38, 46); + String::push(__local_38, 121); + String::push(__local_38, 58); + String::push(__local_38, 32); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_102 = __local_39; f64::inspect_into(__sroa_diff_y, __local_102); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_40, 115); - String::append_char(__local_40, 117); - String::append_char(__local_40, 98); - String::append_char(__local_40, 58); - String::append_char(__local_40, 32); + String::push(__local_40, 115); + String::push(__local_40, 117); + String::push(__local_40, 98); + String::push(__local_40, 58); + String::push(__local_40, 32); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_106 = __local_41; f64::fmt_into(__sroa_diff_x, __local_106); - String::append_char(__local_40, 44); - String::append_char(__local_40, 32); + String::push(__local_40, 44); + String::push(__local_40, 32); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_109 = __local_41; f64::fmt_into(__sroa_diff_y, __local_109); @@ -441,33 +441,33 @@ condition: diff.y == 2.0 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_42, 114); - String::append_char(__local_42, 117); - String::append_char(__local_42, 110); - String::append_char(__local_42, 32); - String::append_char(__local_42, 97); - String::append_char(__local_42, 116); - String::append_char(__local_42, 32); - String::append(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); - String::append_char(__local_42, 58); + String::push_str(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_42, 114); + String::push(__local_42, 117); + String::push(__local_42, 110); + String::push(__local_42, 32); + String::push(__local_42, 97); + String::push(__local_42, 116); + String::push(__local_42, 32); + String::push_str(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); + String::push(__local_42, 58); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_114 = __local_43; i32::fmt_decimal(58, __local_114); - String::append(__local_42, String { repr: array.new_data(" + String::push_str(__local_42, String { repr: array.new_data(" condition: neg.x == -1.0 "), used: 26 }); - String::append_char(__local_42, 110); - String::append_char(__local_42, 101); - String::append_char(__local_42, 103); - String::append_char(__local_42, 46); - String::append_char(__local_42, 120); - String::append_char(__local_42, 58); - String::append_char(__local_42, 32); + String::push(__local_42, 110); + String::push(__local_42, 101); + String::push(__local_42, 103); + String::push(__local_42, 46); + String::push(__local_42, 120); + String::push(__local_42, 58); + String::push(__local_42, 32); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_119 = __local_43; f64::inspect_into(__sroa_neg_x, __local_119); - String::append_char(__local_42, 10); + String::push(__local_42, 10); break __tmpl: __local_42; }); unreachable; @@ -476,49 +476,49 @@ condition: neg.x == -1.0 if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_44, 114); - String::append_char(__local_44, 117); - String::append_char(__local_44, 110); - String::append_char(__local_44, 32); - String::append_char(__local_44, 97); - String::append_char(__local_44, 116); - String::append_char(__local_44, 32); - String::append(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); - String::append_char(__local_44, 58); + String::push_str(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_44, 114); + String::push(__local_44, 117); + String::push(__local_44, 110); + String::push(__local_44, 32); + String::push(__local_44, 97); + String::push(__local_44, 116); + String::push(__local_44, 32); + String::push_str(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); + String::push(__local_44, 58); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_123 = __local_45; i32::fmt_decimal(59, __local_123); - String::append(__local_44, String { repr: array.new_data(" + String::push_str(__local_44, String { repr: array.new_data(" condition: neg.y == -2.0 "), used: 26 }); - String::append_char(__local_44, 110); - String::append_char(__local_44, 101); - String::append_char(__local_44, 103); - String::append_char(__local_44, 46); - String::append_char(__local_44, 121); - String::append_char(__local_44, 58); - String::append_char(__local_44, 32); + String::push(__local_44, 110); + String::push(__local_44, 101); + String::push(__local_44, 103); + String::push(__local_44, 46); + String::push(__local_44, 121); + String::push(__local_44, 58); + String::push(__local_44, 32); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_128 = __local_45; f64::inspect_into(__sroa_neg_y, __local_128); - String::append_char(__local_44, 10); + String::push(__local_44, 10); break __tmpl: __local_44; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_46 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_46, 110); - String::append_char(__local_46, 101); - String::append_char(__local_46, 103); - String::append_char(__local_46, 58); - String::append_char(__local_46, 32); + String::push(__local_46, 110); + String::push(__local_46, 101); + String::push(__local_46, 103); + String::push(__local_46, 58); + String::push(__local_46, 32); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_132 = __local_47; f64::fmt_into(__sroa_neg_x, __local_132); - String::append_char(__local_46, 44); - String::append_char(__local_46, 32); + String::push(__local_46, 44); + String::push(__local_46, 32); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_135 = __local_47; f64::fmt_into(__sroa_neg_y, __local_135); @@ -535,38 +535,38 @@ condition: neg.y == -2.0 if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_48 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_48, 114); - String::append_char(__local_48, 117); - String::append_char(__local_48, 110); - String::append_char(__local_48, 32); - String::append_char(__local_48, 97); - String::append_char(__local_48, 116); - String::append_char(__local_48, 32); - String::append(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); - String::append_char(__local_48, 58); + String::push_str(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_48, 114); + String::push(__local_48, 117); + String::push(__local_48, 110); + String::push(__local_48, 32); + String::push(__local_48, 97); + String::push(__local_48, 116); + String::push(__local_48, 32); + String::push_str(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); + String::push(__local_48, 58); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_141 = __local_49; i32::fmt_decimal(64, __local_141); - String::append(__local_48, String { repr: array.new_data(" + String::push_str(__local_48, String { repr: array.new_data(" condition: p1 == same "), used: 23 }); - String::append_char(__local_48, 112); - String::append_char(__local_48, 49); - String::append_char(__local_48, 58); - String::append_char(__local_48, 32); + String::push(__local_48, 112); + String::push(__local_48, 49); + String::push(__local_48, 58); + String::push(__local_48, 32); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; Vec2^Inspect::inspect(__v0_18, __local_49); - String::append_char(__local_48, 10); - String::append_char(__local_48, 115); - String::append_char(__local_48, 97); - String::append_char(__local_48, 109); - String::append_char(__local_48, 101); - String::append_char(__local_48, 58); - String::append_char(__local_48, 32); + String::push(__local_48, 10); + String::push(__local_48, 115); + String::push(__local_48, 97); + String::push(__local_48, 109); + String::push(__local_48, 101); + String::push(__local_48, 58); + String::push(__local_48, 32); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; Vec2^Inspect::inspect(__v1_19, __local_49); - String::append_char(__local_48, 10); + String::push(__local_48, 10); break __tmpl: __local_48; }); unreachable; @@ -582,37 +582,37 @@ condition: p1 == same if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_50 = String { repr: builtin::array_new(164), used: 0 }; - String::append(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_50, 114); - String::append_char(__local_50, 117); - String::append_char(__local_50, 110); - String::append_char(__local_50, 32); - String::append_char(__local_50, 97); - String::append_char(__local_50, 116); - String::append_char(__local_50, 32); - String::append(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); - String::append_char(__local_50, 58); + String::push_str(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_50, 114); + String::push(__local_50, 117); + String::push(__local_50, 110); + String::push(__local_50, 32); + String::push(__local_50, 97); + String::push(__local_50, 116); + String::push(__local_50, 32); + String::push_str(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); + String::push(__local_50, 58); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_151 = __local_51; i32::fmt_decimal(65, __local_151); - String::append(__local_50, String { repr: array.new_data(" + String::push_str(__local_50, String { repr: array.new_data(" condition: !p1 == p2 "), used: 22 }); - String::append_char(__local_50, 112); - String::append_char(__local_50, 49); - String::append_char(__local_50, 58); - String::append_char(__local_50, 32); + String::push(__local_50, 112); + String::push(__local_50, 49); + String::push(__local_50, 58); + String::push(__local_50, 32); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; Vec2^Inspect::inspect(__v0_21, __local_51); - String::append_char(__local_50, 10); - String::append_char(__local_50, 112); - String::append_char(__local_50, 50); - String::append_char(__local_50, 58); - String::append_char(__local_50, 32); + String::push(__local_50, 10); + String::push(__local_50, 112); + String::push(__local_50, 50); + String::push(__local_50, 58); + String::push(__local_50, 32); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; Vec2^Inspect::inspect(__v1_22, __local_51); - String::append_char(__local_50, 10); - String::append(__local_50, String { repr: array.new_data("p1 == p2: "), used: 10 }); + String::push(__local_50, 10); + String::push_str(__local_50, String { repr: array.new_data("p1 == p2: "), used: 10 }); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_158 = __local_51; Formatter::pad(__local_158, if __v2 -> ref String { @@ -620,7 +620,7 @@ condition: !p1 == p2 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_50, 10); + String::push(__local_50, 10); break __tmpl: __local_50; }); unreachable; @@ -632,44 +632,44 @@ condition: !p1 == p2 if __cond_29 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_52 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_52, 114); - String::append_char(__local_52, 117); - String::append_char(__local_52, 110); - String::append_char(__local_52, 32); - String::append_char(__local_52, 97); - String::append_char(__local_52, 116); - String::append_char(__local_52, 32); - String::append(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); - String::append_char(__local_52, 58); + String::push_str(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_52, 114); + String::push(__local_52, 117); + String::push(__local_52, 110); + String::push(__local_52, 32); + String::push(__local_52, 97); + String::push(__local_52, 116); + String::push(__local_52, 32); + String::push_str(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/newtype_operator_trait.wado"), used: 56 }); + String::push(__local_52, 58); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_166 = __local_53; i32::fmt_decimal(74, __local_166); - String::append(__local_52, String { repr: array.new_data(" + String::push_str(__local_52, String { repr: array.new_data(" condition: v3.x == 6.0 "), used: 24 }); - String::append_char(__local_52, 118); - String::append_char(__local_52, 51); - String::append_char(__local_52, 46); - String::append_char(__local_52, 120); - String::append_char(__local_52, 58); - String::append_char(__local_52, 32); + String::push(__local_52, 118); + String::push(__local_52, 51); + String::push(__local_52, 46); + String::push(__local_52, 120); + String::push(__local_52, 58); + String::push(__local_52, 32); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_171 = __local_53; f64::inspect_into(__sroa_v3_x, __local_171); - String::append_char(__local_52, 10); + String::push(__local_52, 10); break __tmpl: __local_52; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_54 = String { repr: builtin::array_new(44), used: 0 }; - String::append(__local_54, String { repr: array.new_data("velocity: "), used: 10 }); + String::push_str(__local_54, String { repr: array.new_data("velocity: "), used: 10 }); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_175 = __local_55; f64::fmt_into(__sroa_v3_x, __local_175); - String::append_char(__local_54, 44); - String::append_char(__local_54, 32); + String::push(__local_54, 44); + String::push(__local_54, 32); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_178 = __local_55; f64::fmt_into(__sroa_v3_y, __local_178); @@ -1439,8 +1439,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1495,13 +1495,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1509,25 +1509,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1535,7 +1535,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1577,8 +1577,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1610,7 +1610,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1739,27 +1739,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1880,9 +1880,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1949,9 +1949,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1961,8 +1961,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2017,13 +2017,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2058,9 +2058,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2113,7 +2113,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2128,7 +2128,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2162,17 +2162,17 @@ fn Vec2^Inspect::inspect(self, f) { let s_11: ref String; let s_15: ref String; s_3 = String { repr: array.new_data("Vec2 { "), used: 7 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("x: "), used: 3 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); f64::inspect_into(self.x, f); s_9 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_9); + String::push_str(f.buf, s_9); s_11 = String { repr: array.new_data("y: "), used: 3 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); f64::inspect_into(self.y, f); s_15 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_15); + String::push_str(f.buf, s_15); } fn Formatter::write_char_n(self, c, n) { @@ -2186,7 +2186,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l180; }; @@ -2206,7 +2206,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2214,17 +2214,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2378,20 +2378,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2401,10 +2401,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2414,10 +2414,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2425,10 +2425,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_option_pattern.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_option_pattern.wir.wado index 563b69f4c..0f76ff7e0 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_option_pattern.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_option_pattern.wir.wado @@ -103,7 +103,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -111,9 +111,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -189,18 +189,18 @@ fn run() with Stdout { r_1 = ref.cast Option::Some(angle).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_6, 97); - String::append_char(__local_6, 110); - String::append_char(__local_6, 103); - String::append_char(__local_6, 108); - String::append_char(__local_6, 101); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 110); + String::push(__local_6, 103); + String::push(__local_6, 108); + String::push(__local_6, 101); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_19 = __local_7; f64::inspect_into(r_1, __local_19); __local_23 = String { repr: array.new_data(" as Radians"), used: 11 }; - String::append(__local_19.buf, __local_23); + String::push_str(__local_19.buf, __local_23); break __tmpl: __local_6; }); } else { @@ -211,12 +211,12 @@ fn run() with Stdout { r_3 = ref.cast Option::Some(empty).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_8, String { repr: array.new_data("unexpected: "), used: 12 }); + String::push_str(__local_8, String { repr: array.new_data("unexpected: "), used: 12 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_29 = __local_9; f64::inspect_into(r_3, __local_29); __local_33 = String { repr: array.new_data(" as Radians"), used: 11 }; - String::append(__local_29.buf, __local_33); + String::push_str(__local_29.buf, __local_33); break __tmpl: __local_8; }); } else { @@ -236,12 +236,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_10, String { repr: array.new_data("doubled: "), used: 9 }); + String::push_str(__local_10, String { repr: array.new_data("doubled: "), used: 9 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_39 = __local_11; f64::inspect_into(result, __local_39); __local_43 = String { repr: array.new_data(" as Radians"), used: 11 }; - String::append(__local_39.buf, __local_43); + String::push_str(__local_39.buf, __local_43); break __tmpl: __local_10; }); } @@ -1007,8 +1007,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1063,13 +1063,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1077,25 +1077,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1103,7 +1103,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1145,8 +1145,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1178,7 +1178,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1260,27 +1260,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1383,9 +1383,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1395,8 +1395,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1451,13 +1451,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1492,9 +1492,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1535,7 +1535,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1550,7 +1550,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/newtype_return_type.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_return_type.wir.wado index 845c5908b..d885d3b60 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_return_type.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_return_type.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -117,39 +117,39 @@ fn run() with Stdout { __sroa_loc2_y = loc.y; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(43), used: 0 }; - String::append_char(__local_5, 99); - String::append_char(__local_5, 108); - String::append_char(__local_5, 111); - String::append_char(__local_5, 110); - String::append_char(__local_5, 101); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); - String::append_char(__local_5, 40); + String::push(__local_5, 99); + String::push(__local_5, 108); + String::push(__local_5, 111); + String::push(__local_5, 110); + String::push(__local_5, 101); + String::push(__local_5, 58); + String::push(__local_5, 32); + String::push(__local_5, 40); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_14 = __local_6; i32::fmt_decimal(__sroa_loc2_x, __local_14); - String::append_char(__local_5, 44); - String::append_char(__local_5, 32); + String::push(__local_5, 44); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_19 = __local_6; i32::fmt_decimal(__sroa_loc2_y, __local_19); - String::append_char(__local_5, 41); + String::push(__local_5, 41); break __tmpl: __local_5; }); __sroa_loc4_x = loc.x + 5; __sroa_loc4_y = loc.y + 5; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(44), used: 0 }; - String::append(__local_7, String { repr: array.new_data("offset: ("), used: 9 }); + String::push_str(__local_7, String { repr: array.new_data("offset: ("), used: 9 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_28 = __local_8; i32::fmt_decimal(__sroa_loc4_x, __local_28); - String::append_char(__local_7, 44); - String::append_char(__local_7, 32); + String::push(__local_7, 44); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_33 = __local_8; i32::fmt_decimal(__sroa_loc4_y, __local_33); - String::append_char(__local_7, 41); + String::push(__local_7, 41); break __tmpl: __local_7; }); } @@ -349,7 +349,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -364,7 +364,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -402,7 +402,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -436,20 +436,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -459,10 +459,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -472,10 +472,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -483,10 +483,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_static_method.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_static_method.wir.wado index e821a47cf..5091f6793 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_static_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_static_method.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -306,7 +306,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -321,7 +321,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -359,7 +359,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -393,20 +393,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -416,10 +416,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -440,10 +440,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_string_coercion.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_string_coercion.wir.wado index 53b64a83e..cbe6343f8 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_string_coercion.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_string_coercion.wir.wado @@ -66,9 +66,9 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -104,19 +104,19 @@ fn greet(name) { let __local_10: ref String; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_1, 72); - String::append_char(__local_1, 101); - String::append_char(__local_1, 108); - String::append_char(__local_1, 108); - String::append_char(__local_1, 111); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push(__local_1, 72); + String::push(__local_1, 101); + String::push(__local_1, 108); + String::push(__local_1, 108); + String::push(__local_1, 111); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_8 = __local_2; String^Inspect::inspect(name, __local_8); __local_10 = String { repr: array.new_data(" as Name"), used: 8 }; - String::append(__local_8.buf, __local_10); - String::append_char(__local_1, 33); + String::push_str(__local_8.buf, __local_10); + String::push(__local_1, 33); break __tmpl: __local_1; }; } @@ -133,12 +133,12 @@ fn run() with Stdout { x = String { repr: array.new_data("world"), used: 5 }; label2 = __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_4, 104); - String::append_char(__local_4, 101); - String::append_char(__local_4, 108); - String::append_char(__local_4, 108); - String::append_char(__local_4, 111); - String::append_char(__local_4, 32); + String::push(__local_4, 104); + String::push(__local_4, 101); + String::push(__local_4, 108); + String::push(__local_4, 108); + String::push(__local_4, 111); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; Formatter::pad(__local_5, x); break __tmpl: __local_4; @@ -264,7 +264,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -323,7 +323,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -361,7 +361,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l17; }; @@ -381,7 +381,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -389,17 +389,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -409,7 +409,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -426,22 +426,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b23; @@ -449,7 +449,7 @@ fn String^Inspect::inspect(self, f) { continue l24; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/newtype_trait_bounds.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_trait_bounds.wir.wado index dd9cdfba1..c793df823 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_trait_bounds.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_trait_bounds.wir.wado @@ -66,9 +66,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -125,22 +125,22 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 109); - String::append_char(__local_7, 105); - String::append_char(__local_7, 110); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 109); + String::push(__local_7, 105); + String::push(__local_7, 110); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(min_score, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_9, 109); - String::append_char(__local_9, 97); - String::append_char(__local_9, 120); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 109); + String::push(__local_9, 97); + String::push(__local_9, 120); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(max_score, __local_10); break __tmpl: __local_9; @@ -153,7 +153,7 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_11, String { repr: array.new_data("earlier: "), used: 9 }); + String::push_str(__local_11, String { repr: array.new_data("earlier: "), used: 9 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; u64::fmt_decimal(earlier, __local_12); break __tmpl: __local_11; @@ -464,7 +464,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -479,7 +479,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -517,7 +517,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l42; }; @@ -551,20 +551,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -574,10 +574,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -587,10 +587,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -598,10 +598,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/newtype_trait_method.wir.wado b/wado-compiler/tests/fixtures.golden/newtype_trait_method.wir.wado index 59f2a1fec..10ecacbad 100644 --- a/wado-compiler/tests/fixtures.golden/newtype_trait_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/newtype_trait_method.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -301,7 +301,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -316,7 +316,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -354,7 +354,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -388,20 +388,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -411,10 +411,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -424,10 +424,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -435,10 +435,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/number_literal.wir.wado b/wado-compiler/tests/fixtures.golden/number_literal.wir.wado index 70063af84..3b627d7e8 100644 --- a/wado-compiler/tests/fixtures.golden/number_literal.wir.wado +++ b/wado-compiler/tests/fixtures.golden/number_literal.wir.wado @@ -104,7 +104,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -114,9 +114,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/core:simd/F32x4Builder^SequenceLiteralBuilder::push_literal" = fn(ref "core:simd/F32x4Builder", f32); @@ -201,22 +201,22 @@ fn number_literal_coercion() with Stdout { let __local_61: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(58), used: 0 }; - String::append_char(__local_11, 97); - String::append_char(__local_11, 61); + String::push(__local_11, 97); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_22 = __local_12; f64::fmt_into(1, __local_22); - String::append_char(__local_11, 44); - String::append_char(__local_11, 32); - String::append_char(__local_11, 98); - String::append_char(__local_11, 61); + String::push(__local_11, 44); + String::push(__local_11, 32); + String::push(__local_11, 98); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_25 = __local_12; f64::fmt_into(42, __local_25); - String::append_char(__local_11, 44); - String::append_char(__local_11, 32); - String::append_char(__local_11, 99); - String::append_char(__local_11, 61); + String::push(__local_11, 44); + String::push(__local_11, 32); + String::push(__local_11, 99); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_28 = __local_12; f32::fmt_into(100_f32, __local_28); @@ -224,22 +224,22 @@ fn number_literal_coercion() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(58), used: 0 }; - String::append_char(__local_13, 100); - String::append_char(__local_13, 61); + String::push(__local_13, 100); + String::push(__local_13, 61); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_32 = __local_14; i32::fmt_decimal(100, __local_32); - String::append_char(__local_13, 44); - String::append_char(__local_13, 32); - String::append_char(__local_13, 101); - String::append_char(__local_13, 61); + String::push(__local_13, 44); + String::push(__local_13, 32); + String::push(__local_13, 101); + String::push(__local_13, 61); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_37 = __local_14; i64::fmt_decimal(10000000000_i64, __local_37); - String::append_char(__local_13, 44); - String::append_char(__local_13, 32); - String::append_char(__local_13, 102); - String::append_char(__local_13, 61); + String::push(__local_13, 44); + String::push(__local_13, 32); + String::push(__local_13, 102); + String::push(__local_13, 61); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_42 = __local_14; i32::fmt_decimal(5000, __local_42); @@ -247,15 +247,15 @@ fn number_literal_coercion() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(38), used: 0 }; - String::append_char(__local_15, 103); - String::append_char(__local_15, 61); + String::push(__local_15, 103); + String::push(__local_15, 61); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_48 = __local_16; f64::fmt_into(100, __local_48); - String::append_char(__local_15, 44); - String::append_char(__local_15, 32); - String::append_char(__local_15, 104); - String::append_char(__local_15, 61); + String::push(__local_15, 44); + String::push(__local_15, 32); + String::push(__local_15, 104); + String::push(__local_15, 61); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_51 = __local_16; f64::fmt_into(602200000000000000000000, __local_51); @@ -263,22 +263,22 @@ fn number_literal_coercion() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(58), used: 0 }; - String::append_char(__local_17, 105); - String::append_char(__local_17, 61); + String::push(__local_17, 105); + String::push(__local_17, 61); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_55 = __local_18; f64::fmt_into(255, __local_55); - String::append_char(__local_17, 44); - String::append_char(__local_17, 32); - String::append_char(__local_17, 106); - String::append_char(__local_17, 61); + String::push(__local_17, 44); + String::push(__local_17, 32); + String::push(__local_17, 106); + String::push(__local_17, 61); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_58 = __local_18; f64::fmt_into(10, __local_58); - String::append_char(__local_17, 44); - String::append_char(__local_17, 32); - String::append_char(__local_17, 107); - String::append_char(__local_17, 61); + String::push(__local_17, 44); + String::push(__local_17, 32); + String::push(__local_17, 107); + String::push(__local_17, 61); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_61 = __local_18; f64::fmt_into(63, __local_61); @@ -309,17 +309,17 @@ fn number_literal_coercion_builtin() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("number_literal_coercion_builtin"), used: 31 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/number_literal.wado"), used: 48 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("number_literal_coercion_builtin"), used: 31 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/number_literal.wado"), used: 48 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(37, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: v.extract_lane(0) as f64 > 1.0 "), used: 43 }); break __tmpl: __local_6; @@ -338,17 +338,17 @@ condition: v.extract_lane(0) as f64 > 1.0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("number_literal_coercion_builtin"), used: 31 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/number_literal.wado"), used: 48 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("number_literal_coercion_builtin"), used: 31 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/number_literal.wado"), used: 48 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(41, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: w.extract_lane(3) as f64 > 0.3 "), used: 43 }); break __tmpl: __local_8; @@ -1268,8 +1268,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1324,8 +1324,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1357,7 +1357,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1486,27 +1486,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1668,9 +1668,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1735,9 +1735,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1791,13 +1791,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1832,9 +1832,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1887,7 +1887,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1902,7 +1902,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1967,7 +1967,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l177; }; @@ -2125,20 +2125,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2148,10 +2148,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2161,10 +2161,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2172,10 +2172,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_const.wir.wado b/wado-compiler/tests/fixtures.golden/opt_const.wir.wado index 897d5e467..f98596d92 100644 --- a/wado-compiler/tests/fixtures.golden/opt_const.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_const.wir.wado @@ -99,7 +99,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -109,9 +109,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -202,29 +202,29 @@ fn opt_const_fold() with Stdout { let __local_131: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(72), used: 0 }; - String::append_char(__local_22, 99); - String::append_char(__local_22, 109); - String::append_char(__local_22, 112); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); + String::push(__local_22, 99); + String::push(__local_22, 109); + String::push(__local_22, 112); + String::push(__local_22, 58); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_39 = __local_23; Formatter::pad(__local_39, block -> ref String { String { repr: array.new_data("true"), used: 4 }; }); - String::append_char(__local_22, 32); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_44 = __local_23; Formatter::pad(__local_44, block -> ref String { String { repr: array.new_data("true"), used: 4 }; }); - String::append_char(__local_22, 32); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_49 = __local_23; Formatter::pad(__local_49, block -> ref String { String { repr: array.new_data("true"), used: 4 }; }); - String::append_char(__local_22, 32); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_54 = __local_23; Formatter::pad(__local_54, block -> ref String { @@ -234,15 +234,15 @@ fn opt_const_fold() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(59), used: 0 }; - String::append(__local_24, String { repr: array.new_data("bitwise: "), used: 9 }); + String::push_str(__local_24, String { repr: array.new_data("bitwise: "), used: 9 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_60 = __local_25; i32::fmt_decimal(15, __local_60); - String::append_char(__local_24, 32); + String::push(__local_24, 32); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_65 = __local_25; i32::fmt_decimal(255, __local_65); - String::append_char(__local_24, 32); + String::push(__local_24, 32); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_70 = __local_25; i32::fmt_decimal(240, __local_70); @@ -250,17 +250,17 @@ fn opt_const_fold() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(40), used: 0 }; - String::append_char(__local_26, 115); - String::append_char(__local_26, 104); - String::append_char(__local_26, 105); - String::append_char(__local_26, 102); - String::append_char(__local_26, 116); - String::append_char(__local_26, 58); - String::append_char(__local_26, 32); + String::push(__local_26, 115); + String::push(__local_26, 104); + String::push(__local_26, 105); + String::push(__local_26, 102); + String::push(__local_26, 116); + String::push(__local_26, 58); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_76 = __local_27; i32::fmt_decimal(16, __local_76); - String::append_char(__local_26, 32); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_81 = __local_27; i32::fmt_decimal(16, __local_81); @@ -268,36 +268,36 @@ fn opt_const_fold() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(90), used: 0 }; - String::append_char(__local_28, 98); - String::append_char(__local_28, 111); - String::append_char(__local_28, 111); - String::append_char(__local_28, 108); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 98); + String::push(__local_28, 111); + String::push(__local_28, 111); + String::push(__local_28, 108); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_87 = __local_29; Formatter::pad(__local_87, block -> ref String { String { repr: array.new_data("true"), used: 4 }; }); - String::append_char(__local_28, 32); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_92 = __local_29; Formatter::pad(__local_92, block -> ref String { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_28, 32); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_97 = __local_29; Formatter::pad(__local_97, block -> ref String { String { repr: array.new_data("true"), used: 4 }; }); - String::append_char(__local_28, 32); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_102 = __local_29; Formatter::pad(__local_102, block -> ref String { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_28, 32); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_107 = __local_29; Formatter::pad(__local_107, block -> ref String { @@ -307,25 +307,25 @@ fn opt_const_fold() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(74), used: 0 }; - String::append_char(__local_30, 102); - String::append_char(__local_30, 108); - String::append_char(__local_30, 111); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 102); + String::push(__local_30, 108); + String::push(__local_30, 111); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_113 = __local_31; f64::fmt_into(4, __local_113); - String::append_char(__local_30, 32); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_116 = __local_31; f64::fmt_into(6.5, __local_116); - String::append_char(__local_30, 32); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_119 = __local_31; f64::fmt_into(6, __local_119); - String::append_char(__local_30, 32); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_122 = __local_31; f64::fmt_into(2.5, __local_122); @@ -333,18 +333,18 @@ fn opt_const_fold() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_32, 102); - String::append_char(__local_32, 99); - String::append_char(__local_32, 109); - String::append_char(__local_32, 112); - String::append_char(__local_32, 58); - String::append_char(__local_32, 32); + String::push(__local_32, 102); + String::push(__local_32, 99); + String::push(__local_32, 109); + String::push(__local_32, 112); + String::push(__local_32, 58); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_126 = __local_33; Formatter::pad(__local_126, block -> ref String { String { repr: array.new_data("true"), used: 4 }; }); - String::append_char(__local_32, 32); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_131 = __local_33; Formatter::pad(__local_131, block -> ref String { @@ -354,7 +354,7 @@ fn opt_const_fold() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_34, String { repr: array.new_data("combined: "), used: 10 }); + String::push_str(__local_34, String { repr: array.new_data("combined: "), used: 10 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; i32::fmt_decimal(60, __local_35); break __tmpl: __local_34; @@ -372,24 +372,24 @@ fn opt_const_prop() with Stdout { let __local_10: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_3, 97); - String::append_char(__local_3, 61); + String::push(__local_3, 97); + String::push(__local_3, 61); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(30, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_5, 98); - String::append_char(__local_5, 61); + String::push(__local_5, 98); + String::push(__local_5, 61); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; f64::fmt_into(3.14, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_7, 99); - String::append_char(__local_7, 61); + String::push(__local_7, 99); + String::push(__local_7, 61); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; Formatter::pad(__local_8, block -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -399,14 +399,14 @@ fn opt_const_prop() with Stdout { COUNTER = COUNTER + 1; "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_9, 67); - String::append_char(__local_9, 79); - String::append_char(__local_9, 85); - String::append_char(__local_9, 78); - String::append_char(__local_9, 84); - String::append_char(__local_9, 69); - String::append_char(__local_9, 82); - String::append_char(__local_9, 61); + String::push(__local_9, 67); + String::push(__local_9, 79); + String::push(__local_9, 85); + String::push(__local_9, 78); + String::push(__local_9, 84); + String::push(__local_9, 69); + String::push(__local_9, 82); + String::push(__local_9, 61); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(COUNTER, __local_10); break __tmpl: __local_9; @@ -1194,8 +1194,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1250,8 +1250,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1283,7 +1283,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1412,27 +1412,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1553,9 +1553,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1609,13 +1609,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1650,9 +1650,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1705,7 +1705,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1720,7 +1720,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1758,7 +1758,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l166; }; @@ -1778,7 +1778,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1786,17 +1786,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1950,20 +1950,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1973,10 +1973,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1986,10 +1986,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1997,10 +1997,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_const_fold_div_zero.wir.wado b/wado-compiler/tests/fixtures.golden/opt_const_fold_div_zero.wir.wado index d202a143b..e95cd57b5 100644 --- a/wado-compiler/tests/fixtures.golden/opt_const_fold_div_zero.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_const_fold_div_zero.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -301,7 +301,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -316,7 +316,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -354,7 +354,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -388,20 +388,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -411,10 +411,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -424,10 +424,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -435,10 +435,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_copy_prop_multi_field.wir.wado b/wado-compiler/tests/fixtures.golden/opt_copy_prop_multi_field.wir.wado index 78284c1cb..90da49990 100644 --- a/wado-compiler/tests/fixtures.golden/opt_copy_prop_multi_field.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_copy_prop_multi_field.wir.wado @@ -119,13 +119,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -296,27 +296,27 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_40 = __local_19; i32::fmt_decimal(111, __local_40); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: point_sum(5) == 15 "), used: 31 }); - String::append(__local_18, String { repr: array.new_data("point_sum(5): "), used: 14 }); + String::push_str(__local_18, String { repr: array.new_data("point_sum(5): "), used: 14 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_45 = __local_19; i32::fmt_decimal(__v0_0, __local_45); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -326,27 +326,27 @@ condition: point_sum(5) == 15 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_51 = __local_21; i32::fmt_decimal(112, __local_51); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: point_sum(-1) == -8 "), used: 32 }); - String::append(__local_20, String { repr: array.new_data("point_sum(-1): "), used: 15 }); + String::push_str(__local_20, String { repr: array.new_data("point_sum(-1): "), used: 15 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_56 = __local_21; i32::fmt_decimal(__v0_2, __local_56); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -356,27 +356,27 @@ condition: point_sum(-1) == -8 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_62 = __local_23; i32::fmt_decimal(115, __local_62); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: config_summary(3) == 34 "), used: 36 }); - String::append(__local_22, String { repr: array.new_data("config_summary(3): "), used: 19 }); + String::push_str(__local_22, String { repr: array.new_data("config_summary(3): "), used: 19 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_67 = __local_23; i32::fmt_decimal(__v0_4, __local_67); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -386,27 +386,27 @@ condition: config_summary(3) == 34 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_73 = __local_25; i32::fmt_decimal(116, __local_73); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: config_summary(-2) == -20 "), used: 38 }); - String::append(__local_24, String { repr: array.new_data("config_summary(-2): "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("config_summary(-2): "), used: 20 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_78 = __local_25; i32::fmt_decimal(__v0_6, __local_78); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -416,27 +416,27 @@ condition: config_summary(-2) == -20 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_26, 114); - String::append_char(__local_26, 117); - String::append_char(__local_26, 110); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_26, 114); + String::push(__local_26, 117); + String::push(__local_26, 110); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_84 = __local_27; i32::fmt_decimal(117, __local_84); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: config_summary(0) == -1 "), used: 36 }); - String::append(__local_26, String { repr: array.new_data("config_summary(0): "), used: 19 }); + String::push_str(__local_26, String { repr: array.new_data("config_summary(0): "), used: 19 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_89 = __local_27; i32::fmt_decimal(__v0_8, __local_89); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -465,27 +465,27 @@ condition: config_summary(0) == -1 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_28, 114); - String::append_char(__local_28, 117); - String::append_char(__local_28, 110); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_28, 114); + String::push(__local_28, 117); + String::push(__local_28, 110); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_95 = __local_29; i32::fmt_decimal(120, __local_95); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: pass_payload(5) == 11 "), used: 34 }); - String::append(__local_28, String { repr: array.new_data("pass_payload(5): "), used: 17 }); + String::push_str(__local_28, String { repr: array.new_data("pass_payload(5): "), used: 17 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_100 = __local_29; i32::fmt_decimal(__v0_10, __local_100); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -514,27 +514,27 @@ condition: pass_payload(5) == 11 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_30, 114); - String::append_char(__local_30, 117); - String::append_char(__local_30, 110); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_30, 114); + String::push(__local_30, 117); + String::push(__local_30, 110); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_106 = __local_31; i32::fmt_decimal(121, __local_106); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: pass_payload(-1) == -1 "), used: 35 }); - String::append(__local_30, String { repr: array.new_data("pass_payload(-1): "), used: 18 }); + String::push_str(__local_30, String { repr: array.new_data("pass_payload(-1): "), used: 18 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_111 = __local_31; i32::fmt_decimal(__v0_12, __local_111); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -564,26 +564,26 @@ condition: pass_payload(-1) == -1 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_32, 114); - String::append_char(__local_32, 117); - String::append_char(__local_32, 110); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_32, 114); + String::push(__local_32, 117); + String::push(__local_32, 110); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_121 = __local_33; i32::fmt_decimal(124, __local_121); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: both_branches(1) == \"test\" "), used: 39 }); - String::append(__local_32, String { repr: array.new_data("both_branches(1): "), used: 18 }); + String::push_str(__local_32, String { repr: array.new_data("both_branches(1): "), used: 18 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; String^Inspect::inspect(__v0_14, __local_33); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -613,26 +613,26 @@ condition: both_branches(1) == \"test\" if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_34, 114); - String::append_char(__local_34, 117); - String::append_char(__local_34, 110); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_34, 114); + String::push(__local_34, 117); + String::push(__local_34, 110); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_multi_field.wado"), used: 59 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_132 = __local_35; i32::fmt_decimal(125, __local_132); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: both_branches(0) == \"zero\" "), used: 39 }); - String::append(__local_34, String { repr: array.new_data("both_branches(0): "), used: 18 }); + String::push_str(__local_34, String { repr: array.new_data("both_branches(0): "), used: 18 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; String^Inspect::inspect(__v0_16, __local_35); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -835,7 +835,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -923,7 +923,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -961,7 +961,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l57; }; @@ -995,20 +995,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1018,10 +1018,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1031,10 +1031,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1042,10 +1042,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1057,7 +1057,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1074,22 +1074,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b76; @@ -1097,7 +1097,7 @@ fn String^Inspect::inspect(self, f) { continue l77; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/opt_copy_prop_nested_variant.wir.wado b/wado-compiler/tests/fixtures.golden/opt_copy_prop_nested_variant.wir.wado index 44def2172..ecd150e23 100644 --- a/wado-compiler/tests/fixtures.golden/opt_copy_prop_nested_variant.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_copy_prop_nested_variant.wir.wado @@ -157,7 +157,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -167,11 +167,11 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -529,27 +529,27 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_25, 114); - String::append_char(__local_25, 117); - String::append_char(__local_25, 110); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_25, 114); + String::push(__local_25, 117); + String::push(__local_25, 110); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_54 = __local_26; i32::fmt_decimal(127, __local_54); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: lookup_match(5) == 50 "), used: 34 }); - String::append(__local_25, String { repr: array.new_data("lookup_match(5): "), used: 17 }); + String::push_str(__local_25, String { repr: array.new_data("lookup_match(5): "), used: 17 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_59 = __local_26; i32::fmt_decimal(__v0_0, __local_59); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -591,27 +591,27 @@ condition: lookup_match(5) == 50 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_27, 114); - String::append_char(__local_27, 117); - String::append_char(__local_27, 110); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_27, 114); + String::push(__local_27, 117); + String::push(__local_27, 110); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_69 = __local_28; i32::fmt_decimal(128, __local_69); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: lookup_match(0) == -1 "), used: 34 }); - String::append(__local_27, String { repr: array.new_data("lookup_match(0): "), used: 17 }); + String::push_str(__local_27, String { repr: array.new_data("lookup_match(0): "), used: 17 }); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_74 = __local_28; i32::fmt_decimal(__v0_2, __local_74); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -653,27 +653,27 @@ condition: lookup_match(0) == -1 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_29, 114); - String::append_char(__local_29, 117); - String::append_char(__local_29, 110); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_29, 114); + String::push(__local_29, 117); + String::push(__local_29, 110); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_84 = __local_30; i32::fmt_decimal(129, __local_84); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: lookup_match(-1) == -2 "), used: 35 }); - String::append(__local_29, String { repr: array.new_data("lookup_match(-1): "), used: 18 }); + String::push_str(__local_29, String { repr: array.new_data("lookup_match(-1): "), used: 18 }); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_89 = __local_30; i32::fmt_decimal(__v0_4, __local_89); - String::append_char(__local_29, 10); + String::push(__local_29, 10); break __tmpl: __local_29; }); unreachable; @@ -683,27 +683,27 @@ condition: lookup_match(-1) == -2 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_31, 114); - String::append_char(__local_31, 117); - String::append_char(__local_31, 110); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_31, 114); + String::push(__local_31, 117); + String::push(__local_31, 110); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_95 = __local_32; i32::fmt_decimal(132, __local_95); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: lookup_if_let(5) == 50 "), used: 35 }); - String::append(__local_31, String { repr: array.new_data("lookup_if_let(5): "), used: 18 }); + String::push_str(__local_31, String { repr: array.new_data("lookup_if_let(5): "), used: 18 }); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_100 = __local_32; i32::fmt_decimal(__v0_6, __local_100); - String::append_char(__local_31, 10); + String::push(__local_31, 10); break __tmpl: __local_31; }); unreachable; @@ -713,27 +713,27 @@ condition: lookup_if_let(5) == 50 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_33, 114); - String::append_char(__local_33, 117); - String::append_char(__local_33, 110); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_33, 114); + String::push(__local_33, 117); + String::push(__local_33, 110); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_106 = __local_34; i32::fmt_decimal(133, __local_106); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: lookup_if_let(0) == -1 "), used: 35 }); - String::append(__local_33, String { repr: array.new_data("lookup_if_let(0): "), used: 18 }); + String::push_str(__local_33, String { repr: array.new_data("lookup_if_let(0): "), used: 18 }); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_111 = __local_34; i32::fmt_decimal(__v0_8, __local_111); - String::append_char(__local_33, 10); + String::push(__local_33, 10); break __tmpl: __local_33; }); unreachable; @@ -743,27 +743,27 @@ condition: lookup_if_let(0) == -1 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_35 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_35, 114); - String::append_char(__local_35, 117); - String::append_char(__local_35, 110); - String::append_char(__local_35, 32); - String::append_char(__local_35, 97); - String::append_char(__local_35, 116); - String::append_char(__local_35, 32); - String::append(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_35, 58); + String::push_str(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_35, 114); + String::push(__local_35, 117); + String::push(__local_35, 110); + String::push(__local_35, 32); + String::push(__local_35, 97); + String::push(__local_35, 116); + String::push(__local_35, 32); + String::push_str(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_35, 58); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_117 = __local_36; i32::fmt_decimal(134, __local_117); - String::append(__local_35, String { repr: array.new_data(" + String::push_str(__local_35, String { repr: array.new_data(" condition: lookup_if_let(-1) == -2 "), used: 36 }); - String::append(__local_35, String { repr: array.new_data("lookup_if_let(-1): "), used: 19 }); + String::push_str(__local_35, String { repr: array.new_data("lookup_if_let(-1): "), used: 19 }); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_122 = __local_36; i32::fmt_decimal(__v0_10, __local_122); - String::append_char(__local_35, 10); + String::push(__local_35, 10); break __tmpl: __local_35; }); unreachable; @@ -777,27 +777,27 @@ condition: lookup_if_let(-1) == -2 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_37 = String { repr: builtin::array_new(151), used: 0 }; - String::append(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_37, 114); - String::append_char(__local_37, 117); - String::append_char(__local_37, 110); - String::append_char(__local_37, 32); - String::append_char(__local_37, 97); - String::append_char(__local_37, 116); - String::append_char(__local_37, 32); - String::append(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_37, 58); + String::push_str(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_37, 114); + String::push(__local_37, 117); + String::push(__local_37, 110); + String::push(__local_37, 32); + String::push(__local_37, 97); + String::push(__local_37, 116); + String::push(__local_37, 32); + String::push_str(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_37, 58); __local_38 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_37 }; __local_139 = __local_38; i32::fmt_decimal(138, __local_139); - String::append(__local_37, String { repr: array.new_data(" + String::push_str(__local_37, String { repr: array.new_data(" condition: sum_until_none(keys) == 30 "), used: 39 }); - String::append(__local_37, String { repr: array.new_data("sum_until_none(keys): "), used: 22 }); + String::push_str(__local_37, String { repr: array.new_data("sum_until_none(keys): "), used: 22 }); __local_38 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_37 }; __local_144 = __local_38; i32::fmt_decimal(__v0_14, __local_144); - String::append_char(__local_37, 10); + String::push(__local_37, 10); break __tmpl: __local_37; }); unreachable; @@ -807,27 +807,27 @@ condition: sum_until_none(keys) == 30 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_39 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_39, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_39, 114); - String::append_char(__local_39, 117); - String::append_char(__local_39, 110); - String::append_char(__local_39, 32); - String::append_char(__local_39, 97); - String::append_char(__local_39, 116); - String::append_char(__local_39, 32); - String::append(__local_39, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_39, 58); + String::push_str(__local_39, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_39, 114); + String::push(__local_39, 117); + String::push(__local_39, 110); + String::push(__local_39, 32); + String::push(__local_39, 97); + String::push(__local_39, 116); + String::push(__local_39, 32); + String::push_str(__local_39, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_39, 58); __local_40 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_39 }; __local_150 = __local_40; i32::fmt_decimal(141, __local_150); - String::append(__local_39, String { repr: array.new_data(" + String::push_str(__local_39, String { repr: array.new_data(" condition: combine(1, 2) == 30 "), used: 32 }); - String::append(__local_39, String { repr: array.new_data("combine(1, 2): "), used: 15 }); + String::push_str(__local_39, String { repr: array.new_data("combine(1, 2): "), used: 15 }); __local_40 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_39 }; __local_155 = __local_40; i32::fmt_decimal(__v0_16, __local_155); - String::append_char(__local_39, 10); + String::push(__local_39, 10); break __tmpl: __local_39; }); unreachable; @@ -837,32 +837,32 @@ condition: combine(1, 2) == 30 if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_41 = String { repr: builtin::array_new(176), used: 0 }; - String::append(__local_41, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_41, 114); - String::append_char(__local_41, 117); - String::append_char(__local_41, 110); - String::append_char(__local_41, 32); - String::append_char(__local_41, 97); - String::append_char(__local_41, 116); - String::append_char(__local_41, 32); - String::append(__local_41, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_41, 58); + String::push_str(__local_41, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_41, 114); + String::push(__local_41, 117); + String::push(__local_41, 110); + String::push(__local_41, 32); + String::push(__local_41, 97); + String::push(__local_41, 116); + String::push(__local_41, 32); + String::push_str(__local_41, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_41, 58); __local_42 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_41 }; __local_161 = __local_42; i32::fmt_decimal(144, __local_161); - String::append(__local_41, String { repr: array.new_data(" + String::push_str(__local_41, String { repr: array.new_data(" condition: shape_area(1) == 3.14 * 3.14 "), used: 41 }); - String::append(__local_41, String { repr: array.new_data("shape_area(1): "), used: 15 }); + String::push_str(__local_41, String { repr: array.new_data("shape_area(1): "), used: 15 }); __local_42 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_41 }; __local_166 = __local_42; f64::inspect_into(__v0_18, __local_166); - String::append_char(__local_41, 10); - String::append(__local_41, String { repr: array.new_data("3.14 * 3.14: "), used: 13 }); + String::push(__local_41, 10); + String::push_str(__local_41, String { repr: array.new_data("3.14 * 3.14: "), used: 13 }); __local_42 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_41 }; __local_169 = __local_42; f64::inspect_into(9.8596, __local_169); - String::append_char(__local_41, 10); + String::push(__local_41, 10); break __tmpl: __local_41; }); unreachable; @@ -872,27 +872,27 @@ condition: shape_area(1) == 3.14 * 3.14 if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_43 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_43, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_43, 114); - String::append_char(__local_43, 117); - String::append_char(__local_43, 110); - String::append_char(__local_43, 32); - String::append_char(__local_43, 97); - String::append_char(__local_43, 116); - String::append_char(__local_43, 32); - String::append(__local_43, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_43, 58); + String::push_str(__local_43, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_43, 114); + String::push(__local_43, 117); + String::push(__local_43, 110); + String::push(__local_43, 32); + String::push(__local_43, 97); + String::push(__local_43, 116); + String::push(__local_43, 32); + String::push_str(__local_43, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_43, 58); __local_44 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_43 }; __local_173 = __local_44; i32::fmt_decimal(145, __local_173); - String::append(__local_43, String { repr: array.new_data(" + String::push_str(__local_43, String { repr: array.new_data(" condition: shape_area(2) == 20.0 "), used: 34 }); - String::append(__local_43, String { repr: array.new_data("shape_area(2): "), used: 15 }); + String::push_str(__local_43, String { repr: array.new_data("shape_area(2): "), used: 15 }); __local_44 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_43 }; __local_178 = __local_44; f64::inspect_into(__v0_21, __local_178); - String::append_char(__local_43, 10); + String::push(__local_43, 10); break __tmpl: __local_43; }); unreachable; @@ -902,27 +902,27 @@ condition: shape_area(2) == 20.0 if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_45 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_45, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_45, 114); - String::append_char(__local_45, 117); - String::append_char(__local_45, 110); - String::append_char(__local_45, 32); - String::append_char(__local_45, 97); - String::append_char(__local_45, 116); - String::append_char(__local_45, 32); - String::append(__local_45, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); - String::append_char(__local_45, 58); + String::push_str(__local_45, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_45, 114); + String::push(__local_45, 117); + String::push(__local_45, 110); + String::push(__local_45, 32); + String::push(__local_45, 97); + String::push(__local_45, 116); + String::push(__local_45, 32); + String::push_str(__local_45, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_nested_variant.wado"), used: 62 }); + String::push(__local_45, 58); __local_46 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_45 }; __local_182 = __local_46; i32::fmt_decimal(146, __local_182); - String::append(__local_45, String { repr: array.new_data(" + String::push_str(__local_45, String { repr: array.new_data(" condition: shape_area(3) == -1.0 "), used: 34 }); - String::append(__local_45, String { repr: array.new_data("shape_area(3): "), used: 15 }); + String::push_str(__local_45, String { repr: array.new_data("shape_area(3): "), used: 15 }); __local_46 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_45 }; __local_187 = __local_46; f64::inspect_into(__v0_23, __local_187); - String::append_char(__local_45, 10); + String::push(__local_45, 10); break __tmpl: __local_45; }); unreachable; @@ -1654,8 +1654,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1710,13 +1710,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1724,25 +1724,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1750,7 +1750,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1792,8 +1792,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1825,7 +1825,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1954,27 +1954,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2097,9 +2097,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2109,8 +2109,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2165,13 +2165,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2206,9 +2206,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2261,7 +2261,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2276,7 +2276,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2303,7 +2303,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2366,7 +2366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l214; }; @@ -2524,20 +2524,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2547,10 +2547,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2560,10 +2560,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2571,10 +2571,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_copy_prop_while_let.wir.wado b/wado-compiler/tests/fixtures.golden/opt_copy_prop_while_let.wir.wado index b4891eb15..6e1b9ba0a 100644 --- a/wado-compiler/tests/fixtures.golden/opt_copy_prop_while_let.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_copy_prop_while_let.wir.wado @@ -82,15 +82,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -298,27 +298,27 @@ fn run() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_while_let.wado"), used: 57 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_while_let.wado"), used: 57 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_43 = __local_19; i32::fmt_decimal(83, __local_43); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: sum_iter(items) == 15 "), used: 34 }); - String::append(__local_18, String { repr: array.new_data("sum_iter(items): "), used: 17 }); + String::push_str(__local_18, String { repr: array.new_data("sum_iter(items): "), used: 17 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_48 = __local_19; i32::fmt_decimal(__v0_2, __local_48); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -332,27 +332,27 @@ condition: sum_iter(items) == 15 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_while_let.wado"), used: 57 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_while_let.wado"), used: 57 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_57 = __local_21; i32::fmt_decimal(85, __local_57); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: sum_iter(empty) == 0 "), used: 33 }); - String::append(__local_20, String { repr: array.new_data("sum_iter(empty): "), used: 17 }); + String::push_str(__local_20, String { repr: array.new_data("sum_iter(empty): "), used: 17 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_62 = __local_21; i32::fmt_decimal(__v0_6, __local_62); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -366,27 +366,27 @@ condition: sum_iter(empty) == 0 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_while_let.wado"), used: 57 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_while_let.wado"), used: 57 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_83 = __local_23; i32::fmt_decimal(89, __local_83); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: count_positive(mixed) == 3 "), used: 39 }); - String::append(__local_22, String { repr: array.new_data("count_positive(mixed): "), used: 23 }); + String::push_str(__local_22, String { repr: array.new_data("count_positive(mixed): "), used: 23 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_88 = __local_23; i32::fmt_decimal(__v0_10, __local_88); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -404,27 +404,27 @@ condition: count_positive(mixed) == 3 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_while_let.wado"), used: 57 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_copy_prop_while_let.wado"), used: 57 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_110 = __local_25; i32::fmt_decimal(94, __local_110); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: cross_sum(a, b) == 180 "), used: 35 }); - String::append(__local_24, String { repr: array.new_data("cross_sum(a, b): "), used: 17 }); + String::push_str(__local_24, String { repr: array.new_data("cross_sum(a, b): "), used: 17 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_115 = __local_25; i32::fmt_decimal(__v0_16, __local_115); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -627,7 +627,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -671,7 +671,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -698,7 +698,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -751,7 +751,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l55; }; @@ -785,20 +785,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -808,10 +808,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -821,10 +821,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -832,10 +832,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_crossmod_array.wir.wado b/wado-compiler/tests/fixtures.golden/opt_crossmod_array.wir.wado index b79e7757c..befcc74a2 100644 --- a/wado-compiler/tests/fixtures.golden/opt_crossmod_array.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_crossmod_array.wir.wado @@ -106,11 +106,11 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/./sub/opt_crossmod_level2.wado/Array::append" = fn(ref Array, ref String); +type "functype/./sub/opt_crossmod_level2.wado/Array::push" = fn(ref Array, ref String); type "functype/./sub/opt_crossmod_level2.wado/Array::grow" = fn(ref Array); -type "functype/./sub/opt_crossmod_level2.wado/Array::append" = fn(ref Array, i32); +type "functype/./sub/opt_crossmod_level2.wado/Array::push" = fn(ref Array, i32); type "functype/./sub/opt_crossmod_level2.wado/Array::grow" = fn(ref Array); @@ -118,15 +118,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -257,27 +257,27 @@ fn run() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_33, 114); - String::append_char(__local_33, 117); - String::append_char(__local_33, 110); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_33, 114); + String::push(__local_33, 117); + String::push(__local_33, 110); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_68 = __local_34; i32::fmt_decimal(14, __local_68); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: sp.len() == 2 "), used: 26 }); - String::append(__local_33, String { repr: array.new_data("sp.len(): "), used: 10 }); + String::push_str(__local_33, String { repr: array.new_data("sp.len(): "), used: 10 }); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_73 = __local_34; i32::fmt_decimal(__v0_1, __local_73); - String::append_char(__local_33, 10); + String::push(__local_33, 10); break __tmpl: __local_33; }); unreachable; @@ -293,32 +293,32 @@ condition: sp.len() == 2 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_35 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_35, 114); - String::append_char(__local_35, 117); - String::append_char(__local_35, 110); - String::append_char(__local_35, 32); - String::append_char(__local_35, 97); - String::append_char(__local_35, 116); - String::append_char(__local_35, 32); - String::append(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_35, 58); + String::push_str(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_35, 114); + String::push(__local_35, 117); + String::push(__local_35, 110); + String::push(__local_35, 32); + String::push(__local_35, 97); + String::push(__local_35, 116); + String::push(__local_35, 32); + String::push_str(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_35, 58); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_81 = __local_36; i32::fmt_decimal(15, __local_81); - String::append(__local_35, String { repr: array.new_data(" + String::push_str(__local_35, String { repr: array.new_data(" condition: sp[0] == \"hello\" "), used: 29 }); - String::append_char(__local_35, 115); - String::append_char(__local_35, 112); - String::append_char(__local_35, 91); - String::append_char(__local_35, 48); - String::append_char(__local_35, 93); - String::append_char(__local_35, 58); - String::append_char(__local_35, 32); + String::push(__local_35, 115); + String::push(__local_35, 112); + String::push(__local_35, 91); + String::push(__local_35, 48); + String::push(__local_35, 93); + String::push(__local_35, 58); + String::push(__local_35, 32); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; String^Inspect::inspect(__v0_3, __local_36); - String::append_char(__local_35, 10); + String::push(__local_35, 10); break __tmpl: __local_35; }); unreachable; @@ -334,32 +334,32 @@ condition: sp[0] == \"hello\" if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_37 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_37, 114); - String::append_char(__local_37, 117); - String::append_char(__local_37, 110); - String::append_char(__local_37, 32); - String::append_char(__local_37, 97); - String::append_char(__local_37, 116); - String::append_char(__local_37, 32); - String::append(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_37, 58); + String::push_str(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_37, 114); + String::push(__local_37, 117); + String::push(__local_37, 110); + String::push(__local_37, 32); + String::push(__local_37, 97); + String::push(__local_37, 116); + String::push(__local_37, 32); + String::push_str(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_37, 58); __local_38 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_37 }; __local_90 = __local_38; i32::fmt_decimal(16, __local_90); - String::append(__local_37, String { repr: array.new_data(" + String::push_str(__local_37, String { repr: array.new_data(" condition: sp[1] == \"world\" "), used: 29 }); - String::append_char(__local_37, 115); - String::append_char(__local_37, 112); - String::append_char(__local_37, 91); - String::append_char(__local_37, 49); - String::append_char(__local_37, 93); - String::append_char(__local_37, 58); - String::append_char(__local_37, 32); + String::push(__local_37, 115); + String::push(__local_37, 112); + String::push(__local_37, 91); + String::push(__local_37, 49); + String::push(__local_37, 93); + String::push(__local_37, 58); + String::push(__local_37, 32); __local_38 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_37 }; String^Inspect::inspect(__v0_5, __local_38); - String::append_char(__local_37, 10); + String::push(__local_37, 10); break __tmpl: __local_37; }); unreachable; @@ -370,27 +370,27 @@ condition: sp[1] == \"world\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_39 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_39, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_39, 114); - String::append_char(__local_39, 117); - String::append_char(__local_39, 110); - String::append_char(__local_39, 32); - String::append_char(__local_39, 97); - String::append_char(__local_39, 116); - String::append_char(__local_39, 32); - String::append(__local_39, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_39, 58); + String::push_str(__local_39, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_39, 114); + String::push(__local_39, 117); + String::push(__local_39, 110); + String::push(__local_39, 32); + String::push(__local_39, 97); + String::push(__local_39, 116); + String::push(__local_39, 32); + String::push_str(__local_39, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_39, 58); __local_40 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_39 }; __local_98 = __local_40; i32::fmt_decimal(20, __local_98); - String::append(__local_39, String { repr: array.new_data(" + String::push_str(__local_39, String { repr: array.new_data(" condition: it.len() == 3 "), used: 26 }); - String::append(__local_39, String { repr: array.new_data("it.len(): "), used: 10 }); + String::push_str(__local_39, String { repr: array.new_data("it.len(): "), used: 10 }); __local_40 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_39 }; __local_103 = __local_40; i32::fmt_decimal(__v0_8, __local_103); - String::append_char(__local_39, 10); + String::push(__local_39, 10); break __tmpl: __local_39; }); unreachable; @@ -406,33 +406,33 @@ condition: it.len() == 3 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_41 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_41, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_41, 114); - String::append_char(__local_41, 117); - String::append_char(__local_41, 110); - String::append_char(__local_41, 32); - String::append_char(__local_41, 97); - String::append_char(__local_41, 116); - String::append_char(__local_41, 32); - String::append(__local_41, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_41, 58); + String::push_str(__local_41, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_41, 114); + String::push(__local_41, 117); + String::push(__local_41, 110); + String::push(__local_41, 32); + String::push(__local_41, 97); + String::push(__local_41, 116); + String::push(__local_41, 32); + String::push_str(__local_41, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_41, 58); __local_42 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_41 }; __local_111 = __local_42; i32::fmt_decimal(21, __local_111); - String::append(__local_41, String { repr: array.new_data(" + String::push_str(__local_41, String { repr: array.new_data(" condition: it[0] == 10 "), used: 24 }); - String::append_char(__local_41, 105); - String::append_char(__local_41, 116); - String::append_char(__local_41, 91); - String::append_char(__local_41, 48); - String::append_char(__local_41, 93); - String::append_char(__local_41, 58); - String::append_char(__local_41, 32); + String::push(__local_41, 105); + String::push(__local_41, 116); + String::push(__local_41, 91); + String::push(__local_41, 48); + String::push(__local_41, 93); + String::push(__local_41, 58); + String::push(__local_41, 32); __local_42 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_41 }; __local_116 = __local_42; i32::fmt_decimal(__v0_10, __local_116); - String::append_char(__local_41, 10); + String::push(__local_41, 10); break __tmpl: __local_41; }); unreachable; @@ -448,33 +448,33 @@ condition: it[0] == 10 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_43 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_43, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_43, 114); - String::append_char(__local_43, 117); - String::append_char(__local_43, 110); - String::append_char(__local_43, 32); - String::append_char(__local_43, 97); - String::append_char(__local_43, 116); - String::append_char(__local_43, 32); - String::append(__local_43, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_43, 58); + String::push_str(__local_43, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_43, 114); + String::push(__local_43, 117); + String::push(__local_43, 110); + String::push(__local_43, 32); + String::push(__local_43, 97); + String::push(__local_43, 116); + String::push(__local_43, 32); + String::push_str(__local_43, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_43, 58); __local_44 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_43 }; __local_124 = __local_44; i32::fmt_decimal(22, __local_124); - String::append(__local_43, String { repr: array.new_data(" + String::push_str(__local_43, String { repr: array.new_data(" condition: it[1] == 20 "), used: 24 }); - String::append_char(__local_43, 105); - String::append_char(__local_43, 116); - String::append_char(__local_43, 91); - String::append_char(__local_43, 49); - String::append_char(__local_43, 93); - String::append_char(__local_43, 58); - String::append_char(__local_43, 32); + String::push(__local_43, 105); + String::push(__local_43, 116); + String::push(__local_43, 91); + String::push(__local_43, 49); + String::push(__local_43, 93); + String::push(__local_43, 58); + String::push(__local_43, 32); __local_44 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_43 }; __local_129 = __local_44; i32::fmt_decimal(__v0_12, __local_129); - String::append_char(__local_43, 10); + String::push(__local_43, 10); break __tmpl: __local_43; }); unreachable; @@ -490,33 +490,33 @@ condition: it[1] == 20 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_45 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_45, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_45, 114); - String::append_char(__local_45, 117); - String::append_char(__local_45, 110); - String::append_char(__local_45, 32); - String::append_char(__local_45, 97); - String::append_char(__local_45, 116); - String::append_char(__local_45, 32); - String::append(__local_45, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_45, 58); + String::push_str(__local_45, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_45, 114); + String::push(__local_45, 117); + String::push(__local_45, 110); + String::push(__local_45, 32); + String::push(__local_45, 97); + String::push(__local_45, 116); + String::push(__local_45, 32); + String::push_str(__local_45, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_45, 58); __local_46 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_45 }; __local_137 = __local_46; i32::fmt_decimal(23, __local_137); - String::append(__local_45, String { repr: array.new_data(" + String::push_str(__local_45, String { repr: array.new_data(" condition: it[2] == 30 "), used: 24 }); - String::append_char(__local_45, 105); - String::append_char(__local_45, 116); - String::append_char(__local_45, 91); - String::append_char(__local_45, 50); - String::append_char(__local_45, 93); - String::append_char(__local_45, 58); - String::append_char(__local_45, 32); + String::push(__local_45, 105); + String::push(__local_45, 116); + String::push(__local_45, 91); + String::push(__local_45, 50); + String::push(__local_45, 93); + String::push(__local_45, 58); + String::push(__local_45, 32); __local_46 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_45 }; __local_142 = __local_46; i32::fmt_decimal(__v0_14, __local_142); - String::append_char(__local_45, 10); + String::push(__local_45, 10); break __tmpl: __local_45; }); unreachable; @@ -527,27 +527,27 @@ condition: it[2] == 30 if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_47 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_47, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_47, 114); - String::append_char(__local_47, 117); - String::append_char(__local_47, 110); - String::append_char(__local_47, 32); - String::append_char(__local_47, 97); - String::append_char(__local_47, 116); - String::append_char(__local_47, 32); - String::append(__local_47, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_47, 58); + String::push_str(__local_47, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_47, 114); + String::push(__local_47, 117); + String::push(__local_47, 110); + String::push(__local_47, 32); + String::push(__local_47, 97); + String::push(__local_47, 116); + String::push(__local_47, 32); + String::push_str(__local_47, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_47, 58); __local_48 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_47 }; __local_149 = __local_48; i32::fmt_decimal(27, __local_149); - String::append(__local_47, String { repr: array.new_data(" + String::push_str(__local_47, String { repr: array.new_data(" condition: sl.len() == 3 "), used: 26 }); - String::append(__local_47, String { repr: array.new_data("sl.len(): "), used: 10 }); + String::push_str(__local_47, String { repr: array.new_data("sl.len(): "), used: 10 }); __local_48 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_47 }; __local_154 = __local_48; i32::fmt_decimal(__v0_17, __local_154); - String::append_char(__local_47, 10); + String::push(__local_47, 10); break __tmpl: __local_47; }); unreachable; @@ -563,32 +563,32 @@ condition: sl.len() == 3 if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_49 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_49, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_49, 114); - String::append_char(__local_49, 117); - String::append_char(__local_49, 110); - String::append_char(__local_49, 32); - String::append_char(__local_49, 97); - String::append_char(__local_49, 116); - String::append_char(__local_49, 32); - String::append(__local_49, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_49, 58); + String::push_str(__local_49, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_49, 114); + String::push(__local_49, 117); + String::push(__local_49, 110); + String::push(__local_49, 32); + String::push(__local_49, 97); + String::push(__local_49, 116); + String::push(__local_49, 32); + String::push_str(__local_49, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_49, 58); __local_50 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_49 }; __local_162 = __local_50; i32::fmt_decimal(28, __local_162); - String::append(__local_49, String { repr: array.new_data(" + String::push_str(__local_49, String { repr: array.new_data(" condition: sl[0] == \"alpha\" "), used: 29 }); - String::append_char(__local_49, 115); - String::append_char(__local_49, 108); - String::append_char(__local_49, 91); - String::append_char(__local_49, 48); - String::append_char(__local_49, 93); - String::append_char(__local_49, 58); - String::append_char(__local_49, 32); + String::push(__local_49, 115); + String::push(__local_49, 108); + String::push(__local_49, 91); + String::push(__local_49, 48); + String::push(__local_49, 93); + String::push(__local_49, 58); + String::push(__local_49, 32); __local_50 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_49 }; String^Inspect::inspect(__v0_19, __local_50); - String::append_char(__local_49, 10); + String::push(__local_49, 10); break __tmpl: __local_49; }); unreachable; @@ -604,32 +604,32 @@ condition: sl[0] == \"alpha\" if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_51 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_51, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_51, 114); - String::append_char(__local_51, 117); - String::append_char(__local_51, 110); - String::append_char(__local_51, 32); - String::append_char(__local_51, 97); - String::append_char(__local_51, 116); - String::append_char(__local_51, 32); - String::append(__local_51, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_51, 58); + String::push_str(__local_51, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_51, 114); + String::push(__local_51, 117); + String::push(__local_51, 110); + String::push(__local_51, 32); + String::push(__local_51, 97); + String::push(__local_51, 116); + String::push(__local_51, 32); + String::push_str(__local_51, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_51, 58); __local_52 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_51 }; __local_171 = __local_52; i32::fmt_decimal(29, __local_171); - String::append(__local_51, String { repr: array.new_data(" + String::push_str(__local_51, String { repr: array.new_data(" condition: sl[1] == \"beta\" "), used: 28 }); - String::append_char(__local_51, 115); - String::append_char(__local_51, 108); - String::append_char(__local_51, 91); - String::append_char(__local_51, 49); - String::append_char(__local_51, 93); - String::append_char(__local_51, 58); - String::append_char(__local_51, 32); + String::push(__local_51, 115); + String::push(__local_51, 108); + String::push(__local_51, 91); + String::push(__local_51, 49); + String::push(__local_51, 93); + String::push(__local_51, 58); + String::push(__local_51, 32); __local_52 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_51 }; String^Inspect::inspect(__v0_21, __local_52); - String::append_char(__local_51, 10); + String::push(__local_51, 10); break __tmpl: __local_51; }); unreachable; @@ -645,32 +645,32 @@ condition: sl[1] == \"beta\" if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_53 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_53, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_53, 114); - String::append_char(__local_53, 117); - String::append_char(__local_53, 110); - String::append_char(__local_53, 32); - String::append_char(__local_53, 97); - String::append_char(__local_53, 116); - String::append_char(__local_53, 32); - String::append(__local_53, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_53, 58); + String::push_str(__local_53, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_53, 114); + String::push(__local_53, 117); + String::push(__local_53, 110); + String::push(__local_53, 32); + String::push(__local_53, 97); + String::push(__local_53, 116); + String::push(__local_53, 32); + String::push_str(__local_53, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_53, 58); __local_54 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_53 }; __local_180 = __local_54; i32::fmt_decimal(30, __local_180); - String::append(__local_53, String { repr: array.new_data(" + String::push_str(__local_53, String { repr: array.new_data(" condition: sl[2] == \"gamma\" "), used: 29 }); - String::append_char(__local_53, 115); - String::append_char(__local_53, 108); - String::append_char(__local_53, 91); - String::append_char(__local_53, 50); - String::append_char(__local_53, 93); - String::append_char(__local_53, 58); - String::append_char(__local_53, 32); + String::push(__local_53, 115); + String::push(__local_53, 108); + String::push(__local_53, 91); + String::push(__local_53, 50); + String::push(__local_53, 93); + String::push(__local_53, 58); + String::push(__local_53, 32); __local_54 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_53 }; String^Inspect::inspect(__v0_23, __local_54); - String::append_char(__local_53, 10); + String::push(__local_53, 10); break __tmpl: __local_53; }); unreachable; @@ -682,27 +682,27 @@ condition: sl[2] == \"gamma\" if __cond_28 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_55 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_55, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_55, 114); - String::append_char(__local_55, 117); - String::append_char(__local_55, 110); - String::append_char(__local_55, 32); - String::append_char(__local_55, 97); - String::append_char(__local_55, 116); - String::append_char(__local_55, 32); - String::append(__local_55, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_55, 58); + String::push_str(__local_55, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_55, 114); + String::push(__local_55, 117); + String::push(__local_55, 110); + String::push(__local_55, 32); + String::push(__local_55, 97); + String::push(__local_55, 116); + String::push(__local_55, 32); + String::push_str(__local_55, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_55, 58); __local_56 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_55 }; __local_190 = __local_56; i32::fmt_decimal(35, __local_190); - String::append(__local_55, String { repr: array.new_data(" + String::push_str(__local_55, String { repr: array.new_data(" condition: ia.len() == 2 "), used: 26 }); - String::append(__local_55, String { repr: array.new_data("ia.len(): "), used: 10 }); + String::push_str(__local_55, String { repr: array.new_data("ia.len(): "), used: 10 }); __local_56 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_55 }; __local_195 = __local_56; i32::fmt_decimal(__v0_27, __local_195); - String::append_char(__local_55, 10); + String::push(__local_55, 10); break __tmpl: __local_55; }); unreachable; @@ -718,33 +718,33 @@ condition: ia.len() == 2 if __cond_30 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_57 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_57, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_57, 114); - String::append_char(__local_57, 117); - String::append_char(__local_57, 110); - String::append_char(__local_57, 32); - String::append_char(__local_57, 97); - String::append_char(__local_57, 116); - String::append_char(__local_57, 32); - String::append(__local_57, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_57, 58); + String::push_str(__local_57, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_57, 114); + String::push(__local_57, 117); + String::push(__local_57, 110); + String::push(__local_57, 32); + String::push(__local_57, 97); + String::push(__local_57, 116); + String::push(__local_57, 32); + String::push_str(__local_57, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_57, 58); __local_58 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_57 }; __local_203 = __local_58; i32::fmt_decimal(36, __local_203); - String::append(__local_57, String { repr: array.new_data(" + String::push_str(__local_57, String { repr: array.new_data(" condition: ia[0] == 100 "), used: 25 }); - String::append_char(__local_57, 105); - String::append_char(__local_57, 97); - String::append_char(__local_57, 91); - String::append_char(__local_57, 48); - String::append_char(__local_57, 93); - String::append_char(__local_57, 58); - String::append_char(__local_57, 32); + String::push(__local_57, 105); + String::push(__local_57, 97); + String::push(__local_57, 91); + String::push(__local_57, 48); + String::push(__local_57, 93); + String::push(__local_57, 58); + String::push(__local_57, 32); __local_58 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_57 }; __local_208 = __local_58; i32::fmt_decimal(__v0_29, __local_208); - String::append_char(__local_57, 10); + String::push(__local_57, 10); break __tmpl: __local_57; }); unreachable; @@ -760,33 +760,33 @@ condition: ia[0] == 100 if __cond_32 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_59 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_59, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_59, 114); - String::append_char(__local_59, 117); - String::append_char(__local_59, 110); - String::append_char(__local_59, 32); - String::append_char(__local_59, 97); - String::append_char(__local_59, 116); - String::append_char(__local_59, 32); - String::append(__local_59, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); - String::append_char(__local_59, 58); + String::push_str(__local_59, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_59, 114); + String::push(__local_59, 117); + String::push(__local_59, 110); + String::push(__local_59, 32); + String::push(__local_59, 97); + String::push(__local_59, 116); + String::push(__local_59, 32); + String::push_str(__local_59, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_crossmod_array.wado"), used: 52 }); + String::push(__local_59, 58); __local_60 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_59 }; __local_216 = __local_60; i32::fmt_decimal(37, __local_216); - String::append(__local_59, String { repr: array.new_data(" + String::push_str(__local_59, String { repr: array.new_data(" condition: ia[1] == 200 "), used: 25 }); - String::append_char(__local_59, 105); - String::append_char(__local_59, 97); - String::append_char(__local_59, 91); - String::append_char(__local_59, 49); - String::append_char(__local_59, 93); - String::append_char(__local_59, 58); - String::append_char(__local_59, 32); + String::push(__local_59, 105); + String::push(__local_59, 97); + String::push(__local_59, 91); + String::push(__local_59, 49); + String::push(__local_59, 93); + String::push(__local_59, 58); + String::push(__local_59, 32); __local_60 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_59 }; __local_221 = __local_60; i32::fmt_decimal(__v0_31, __local_221); - String::append_char(__local_59, 10); + String::push(__local_59, 10); break __tmpl: __local_59; }); unreachable; @@ -1004,7 +1004,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn "./sub/opt_crossmod_level2.wado/Array::append"(self, value) { // from ./sub/opt_crossmod_level2.wado +fn "./sub/opt_crossmod_level2.wado/Array::push"(self, value) { // from ./sub/opt_crossmod_level2.wado let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1046,7 +1046,7 @@ fn "./sub/opt_crossmod_level2.wado/Array::grow"(self) { // from ./sub/o self.repr = new_repr; } -fn "./sub/opt_crossmod_level2.wado/Array::append"(self, value) { // from ./sub/opt_crossmod_level2.wado +fn "./sub/opt_crossmod_level2.wado/Array::push"(self, value) { // from ./sub/opt_crossmod_level2.wado let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1142,7 +1142,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1230,7 +1230,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1257,7 +1257,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1310,7 +1310,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l69; }; @@ -1344,20 +1344,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1367,10 +1367,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1380,10 +1380,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1391,10 +1391,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1406,7 +1406,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1423,22 +1423,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b88; @@ -1446,7 +1446,7 @@ fn String^Inspect::inspect(self, f) { continue l89; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/opt_eqz.wir.wado b/wado-compiler/tests/fixtures.golden/opt_eqz.wir.wado index 24350c3b7..b30e263d5 100644 --- a/wado-compiler/tests/fixtures.golden/opt_eqz.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_eqz.wir.wado @@ -58,9 +58,9 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -104,13 +104,13 @@ fn run() with Stdout { let __local_57: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(42), used: 0 }; - String::append(__local_0, String { repr: array.new_data("i32 eqz: "), used: 9 }); + String::push_str(__local_0, String { repr: array.new_data("i32 eqz: "), used: 9 }); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; __local_12 = __local_1; Formatter::pad(__local_12, block -> ref String { String { repr: array.new_data("true"), used: 4 }; }); - String::append_char(__local_0, 32); + String::push(__local_0, 32); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; __local_18 = __local_1; Formatter::pad(__local_18, block -> ref String { @@ -120,13 +120,13 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(43), used: 0 }; - String::append(__local_2, String { repr: array.new_data("i32 neqz: "), used: 10 }); + String::push_str(__local_2, String { repr: array.new_data("i32 neqz: "), used: 10 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_25 = __local_3; Formatter::pad(__local_25, block -> ref String { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_2, 32); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_31 = __local_3; Formatter::pad(__local_31, block -> ref String { @@ -136,13 +136,13 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(42), used: 0 }; - String::append(__local_4, String { repr: array.new_data("i64 eqz: "), used: 9 }); + String::push_str(__local_4, String { repr: array.new_data("i64 eqz: "), used: 9 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_38 = __local_5; Formatter::pad(__local_38, block -> ref String { String { repr: array.new_data("true"), used: 4 }; }); - String::append_char(__local_4, 32); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_44 = __local_5; Formatter::pad(__local_44, block -> ref String { @@ -152,13 +152,13 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(43), used: 0 }; - String::append(__local_6, String { repr: array.new_data("i64 neqz: "), used: 10 }); + String::push_str(__local_6, String { repr: array.new_data("i64 neqz: "), used: 10 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_51 = __local_7; Formatter::pad(__local_51, block -> ref String { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_6, 32); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_57 = __local_7; Formatter::pad(__local_57, block -> ref String { @@ -284,7 +284,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -299,7 +299,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -337,7 +337,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l21; }; @@ -357,7 +357,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -365,17 +365,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } diff --git a/wado-compiler/tests/fixtures.golden/opt_hfs_immut_ref_no_reread.wir.wado b/wado-compiler/tests/fixtures.golden/opt_hfs_immut_ref_no_reread.wir.wado index cc95c898d..66be12ac2 100644 --- a/wado-compiler/tests/fixtures.golden/opt_hfs_immut_ref_no_reread.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_hfs_immut_ref_no_reread.wir.wado @@ -73,9 +73,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -156,33 +156,33 @@ fn run() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_7, 114); - String::append_char(__local_7, 117); - String::append_char(__local_7, 110); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_immut_ref_no_reread.wado"), used: 61 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_7, 114); + String::push(__local_7, 117); + String::push(__local_7, 110); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_immut_ref_no_reread.wado"), used: 61 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_15 = __local_8; i32::fmt_decimal(37, __local_15); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: total == 45 "), used: 24 }); - String::append_char(__local_7, 116); - String::append_char(__local_7, 111); - String::append_char(__local_7, 116); - String::append_char(__local_7, 97); - String::append_char(__local_7, 108); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 116); + String::push(__local_7, 111); + String::push(__local_7, 116); + String::push(__local_7, 97); + String::push(__local_7, 108); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_20 = __local_8; i32::fmt_decimal(__v0_3, __local_20); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -192,31 +192,31 @@ condition: total == 45 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_9, 114); - String::append_char(__local_9, 117); - String::append_char(__local_9, 110); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_immut_ref_no_reread.wado"), used: 61 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_9, 114); + String::push(__local_9, 117); + String::push(__local_9, 110); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_immut_ref_no_reread.wado"), used: 61 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_26 = __local_10; i32::fmt_decimal(38, __local_26); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: c.x == 5 "), used: 21 }); - String::append_char(__local_9, 99); - String::append_char(__local_9, 46); - String::append_char(__local_9, 120); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 99); + String::push(__local_9, 46); + String::push(__local_9, 120); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_31 = __local_10; i32::fmt_decimal(__v0_5, __local_31); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -419,7 +419,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -434,7 +434,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -472,7 +472,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l28; }; @@ -506,20 +506,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -529,10 +529,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -542,10 +542,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -553,10 +553,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_hfs_immut_ref_sync.wir.wado b/wado-compiler/tests/fixtures.golden/opt_hfs_immut_ref_sync.wir.wado index c069c1d3d..c1d78acc9 100644 --- a/wado-compiler/tests/fixtures.golden/opt_hfs_immut_ref_sync.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_hfs_immut_ref_sync.wir.wado @@ -73,9 +73,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -161,33 +161,33 @@ fn run() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_9, 114); - String::append_char(__local_9, 117); - String::append_char(__local_9, 110); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_immut_ref_sync.wado"), used: 56 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_9, 114); + String::push(__local_9, 117); + String::push(__local_9, 110); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_immut_ref_sync.wado"), used: 56 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_19 = __local_10; i32::fmt_decimal(37, __local_19); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: total == 45 "), used: 24 }); - String::append_char(__local_9, 116); - String::append_char(__local_9, 111); - String::append_char(__local_9, 116); - String::append_char(__local_9, 97); - String::append_char(__local_9, 108); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 116); + String::push(__local_9, 111); + String::push(__local_9, 116); + String::push(__local_9, 97); + String::push(__local_9, 108); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_24 = __local_10; i32::fmt_decimal(__v0_3, __local_24); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -197,31 +197,31 @@ condition: total == 45 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_11, 114); - String::append_char(__local_11, 117); - String::append_char(__local_11, 110); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_immut_ref_sync.wado"), used: 56 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_11, 114); + String::push(__local_11, 117); + String::push(__local_11, 110); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_immut_ref_sync.wado"), used: 56 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_30 = __local_12; i32::fmt_decimal(38, __local_30); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: c.x == 5 "), used: 21 }); - String::append_char(__local_11, 99); - String::append_char(__local_11, 46); - String::append_char(__local_11, 120); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 99); + String::push(__local_11, 46); + String::push(__local_11, 120); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_35 = __local_12; i32::fmt_decimal(__v0_5, __local_35); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -231,31 +231,31 @@ condition: c.x == 5 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_13, 114); - String::append_char(__local_13, 117); - String::append_char(__local_13, 110); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_immut_ref_sync.wado"), used: 56 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_13, 114); + String::push(__local_13, 117); + String::push(__local_13, 110); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_immut_ref_sync.wado"), used: 56 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_41 = __local_14; i32::fmt_decimal(39, __local_41); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: c.y == 50 "), used: 22 }); - String::append_char(__local_13, 99); - String::append_char(__local_13, 46); - String::append_char(__local_13, 121); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 99); + String::push(__local_13, 46); + String::push(__local_13, 121); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_46 = __local_14; i32::fmt_decimal(__v0_7, __local_46); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -458,7 +458,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -473,7 +473,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -511,7 +511,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l29; }; @@ -545,20 +545,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -568,10 +568,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -581,10 +581,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -592,10 +592,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_hfs_labeled_block_match.wir.wado b/wado-compiler/tests/fixtures.golden/opt_hfs_labeled_block_match.wir.wado index 5cbaa6106..85c4bae0b 100644 --- a/wado-compiler/tests/fixtures.golden/opt_hfs_labeled_block_match.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_hfs_labeled_block_match.wir.wado @@ -95,13 +95,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Parser::advance" = fn(ref Parser) -> i32; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -347,42 +347,42 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_9, 114); - String::append_char(__local_9, 117); - String::append_char(__local_9, 110); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_labeled_block_match.wado"), used: 61 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_9, 114); + String::push(__local_9, 117); + String::push(__local_9, 110); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_labeled_block_match.wado"), used: 61 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_37 = __local_10; i32::fmt_decimal(59, __local_37); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); - String::append(__local_9, __tmpl: block -> ref String { + String::push(__local_9, 58); + String::push(__local_9, 32); + String::push_str(__local_9, __tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_7, String { repr: array.new_data("expected pos=8, got "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("expected pos=8, got "), used: 20 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(p.pos, __local_8); break __tmpl: __local_7; }); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: p.pos == 8 "), used: 23 }); - String::append_char(__local_9, 112); - String::append_char(__local_9, 46); - String::append_char(__local_9, 112); - String::append_char(__local_9, 111); - String::append_char(__local_9, 115); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 112); + String::push(__local_9, 46); + String::push(__local_9, 112); + String::push(__local_9, 111); + String::push(__local_9, 115); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_48 = __local_10; i32::fmt_decimal(__v0, __local_48); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -585,7 +585,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -600,7 +600,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -644,7 +644,7 @@ fn Parser::advance(self) { return v; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -697,7 +697,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l47; }; @@ -731,20 +731,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -754,10 +754,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -767,10 +767,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -778,10 +778,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_hfs_mixed_ref_sync.wir.wado b/wado-compiler/tests/fixtures.golden/opt_hfs_mixed_ref_sync.wir.wado index 7253dfb22..d87d392c2 100644 --- a/wado-compiler/tests/fixtures.golden/opt_hfs_mixed_ref_sync.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_hfs_mixed_ref_sync.wir.wado @@ -73,9 +73,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -158,33 +158,33 @@ fn run() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_7, 114); - String::append_char(__local_7, 117); - String::append_char(__local_7, 110); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_mixed_ref_sync.wado"), used: 56 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_7, 114); + String::push(__local_7, 117); + String::push(__local_7, 110); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_mixed_ref_sync.wado"), used: 56 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_15 = __local_8; i32::fmt_decimal(36, __local_15); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: total == 390 "), used: 25 }); - String::append_char(__local_7, 116); - String::append_char(__local_7, 111); - String::append_char(__local_7, 116); - String::append_char(__local_7, 97); - String::append_char(__local_7, 108); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 116); + String::push(__local_7, 111); + String::push(__local_7, 116); + String::push(__local_7, 97); + String::push(__local_7, 108); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_20 = __local_8; i32::fmt_decimal(__v0_3, __local_20); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -194,31 +194,31 @@ condition: total == 390 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_9, 114); - String::append_char(__local_9, 117); - String::append_char(__local_9, 110); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_mixed_ref_sync.wado"), used: 56 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_9, 114); + String::push(__local_9, 117); + String::push(__local_9, 110); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_mixed_ref_sync.wado"), used: 56 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_26 = __local_10; i32::fmt_decimal(37, __local_26); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: c.x == 22 "), used: 22 }); - String::append_char(__local_9, 99); - String::append_char(__local_9, 46); - String::append_char(__local_9, 120); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 99); + String::push(__local_9, 46); + String::push(__local_9, 120); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_31 = __local_10; i32::fmt_decimal(__v0_5, __local_31); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -421,7 +421,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -436,7 +436,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -474,7 +474,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l28; }; @@ -508,20 +508,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -531,10 +531,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -544,10 +544,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -555,10 +555,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_hfs_mut_ref_reread.wir.wado b/wado-compiler/tests/fixtures.golden/opt_hfs_mut_ref_reread.wir.wado index bd9178f16..6212bcb3d 100644 --- a/wado-compiler/tests/fixtures.golden/opt_hfs_mut_ref_reread.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_hfs_mut_ref_reread.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -150,33 +150,33 @@ fn run() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_7, 114); - String::append_char(__local_7, 117); - String::append_char(__local_7, 110); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_mut_ref_reread.wado"), used: 56 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_7, 114); + String::push(__local_7, 117); + String::push(__local_7, 110); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_mut_ref_reread.wado"), used: 56 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_15 = __local_8; i32::fmt_decimal(30, __local_15); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: total == 164 "), used: 25 }); - String::append_char(__local_7, 116); - String::append_char(__local_7, 111); - String::append_char(__local_7, 116); - String::append_char(__local_7, 97); - String::append_char(__local_7, 108); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 116); + String::push(__local_7, 111); + String::push(__local_7, 116); + String::push(__local_7, 97); + String::push(__local_7, 108); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_20 = __local_8; i32::fmt_decimal(__v0_3, __local_20); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -186,31 +186,31 @@ condition: total == 164 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_9, 114); - String::append_char(__local_9, 117); - String::append_char(__local_9, 110); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_mut_ref_reread.wado"), used: 56 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_9, 114); + String::push(__local_9, 117); + String::push(__local_9, 110); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_mut_ref_reread.wado"), used: 56 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_26 = __local_10; i32::fmt_decimal(31, __local_26); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: c.x == 46 "), used: 22 }); - String::append_char(__local_9, 99); - String::append_char(__local_9, 46); - String::append_char(__local_9, 120); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 99); + String::push(__local_9, 46); + String::push(__local_9, 120); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_31 = __local_10; i32::fmt_decimal(__v0_5, __local_31); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -413,7 +413,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -428,7 +428,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -466,7 +466,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l28; }; @@ -500,20 +500,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -523,10 +523,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -536,10 +536,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -547,10 +547,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_hfs_stores_ref_sync.wir.wado b/wado-compiler/tests/fixtures.golden/opt_hfs_stores_ref_sync.wir.wado index b5e45de92..fc37dff01 100644 --- a/wado-compiler/tests/fixtures.golden/opt_hfs_stores_ref_sync.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_hfs_stores_ref_sync.wir.wado @@ -77,9 +77,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -167,33 +167,33 @@ fn run() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_stores_ref_sync.wado"), used: 57 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_stores_ref_sync.wado"), used: 57 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_20 = __local_11; i32::fmt_decimal(37, __local_20); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: total == 45 "), used: 24 }); - String::append_char(__local_10, 116); - String::append_char(__local_10, 111); - String::append_char(__local_10, 116); - String::append_char(__local_10, 97); - String::append_char(__local_10, 108); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 116); + String::push(__local_10, 111); + String::push(__local_10, 116); + String::push(__local_10, 97); + String::push(__local_10, 108); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_25 = __local_11; i32::fmt_decimal(__v0_4, __local_25); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -203,31 +203,31 @@ condition: total == 45 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_stores_ref_sync.wado"), used: 57 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_stores_ref_sync.wado"), used: 57 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_31 = __local_13; i32::fmt_decimal(38, __local_31); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: c.x == 5 "), used: 21 }); - String::append_char(__local_12, 99); - String::append_char(__local_12, 46); - String::append_char(__local_12, 120); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 99); + String::push(__local_12, 46); + String::push(__local_12, 120); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_36 = __local_13; i32::fmt_decimal(__v0_6, __local_36); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -237,31 +237,31 @@ condition: c.x == 5 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_stores_ref_sync.wado"), used: 57 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_hfs_stores_ref_sync.wado"), used: 57 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_42 = __local_15; i32::fmt_decimal(39, __local_42); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: c.y == 50 "), used: 22 }); - String::append_char(__local_14, 99); - String::append_char(__local_14, 46); - String::append_char(__local_14, 121); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 99); + String::push(__local_14, 46); + String::push(__local_14, 121); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_47 = __local_15; i32::fmt_decimal(__v0_8, __local_47); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -464,7 +464,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -479,7 +479,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -517,7 +517,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l29; }; @@ -551,20 +551,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -574,10 +574,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -587,10 +587,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -598,10 +598,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_inline.wir.wado b/wado-compiler/tests/fixtures.golden/opt_inline.wir.wado index 67a530a09..acb0b6b2d 100644 --- a/wado-compiler/tests/fixtures.golden/opt_inline.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_inline.wir.wado @@ -86,9 +86,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -166,27 +166,27 @@ fn opt_inline_attr() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("opt_inline_attr"), used: 15 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_inline.wado"), used: 44 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("opt_inline_attr"), used: 15 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_inline.wado"), used: 44 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_24 = __local_14; i32::fmt_decimal(103, __local_24); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: a == 30 "), used: 20 }); - String::append_char(__local_13, 97); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_29 = __local_14; i32::fmt_decimal(a, __local_29); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -200,27 +200,27 @@ condition: a == 30 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("opt_inline_attr"), used: 15 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_inline.wado"), used: 44 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("opt_inline_attr"), used: 15 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_inline.wado"), used: 44 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_47 = __local_16; i32::fmt_decimal(106, __local_47); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: b == 2299 "), used: 22 }); - String::append_char(__local_15, 98); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 98); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_52 = __local_16; i32::fmt_decimal(b, __local_52); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -242,27 +242,27 @@ fn opt_inline_multireturn() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("opt_inline_multireturn"), used: 22 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_inline.wado"), used: 44 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("opt_inline_multireturn"), used: 22 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_inline.wado"), used: 44 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_26 = __local_9; i32::fmt_decimal(121, __local_26); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: b == 5 "), used: 19 }); - String::append_char(__local_8, 98); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 98); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_31 = __local_9; i32::fmt_decimal(b, __local_31); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -281,32 +281,32 @@ fn opt_inline_recursive() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("opt_inline_recursive"), used: 20 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_inline.wado"), used: 44 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("opt_inline_recursive"), used: 20 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_inline.wado"), used: 44 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_8 = __local_4; i32::fmt_decimal(133, __local_8); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: result == 120 "), used: 26 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 101); - String::append_char(__local_3, 115); - String::append_char(__local_3, 117); - String::append_char(__local_3, 108); - String::append_char(__local_3, 116); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 114); + String::push(__local_3, 101); + String::push(__local_3, 115); + String::push(__local_3, 117); + String::push(__local_3, 108); + String::push(__local_3, 116); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_13 = __local_4; i32::fmt_decimal(result, __local_13); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -555,7 +555,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -570,7 +570,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -608,7 +608,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l29; }; @@ -642,20 +642,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -665,10 +665,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -678,10 +678,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -689,10 +689,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_inline_backtrack_miscompile.wir.wado b/wado-compiler/tests/fixtures.golden/opt_inline_backtrack_miscompile.wir.wado index b3ff12b80..404eae300 100644 --- a/wado-compiler/tests/fixtures.golden/opt_inline_backtrack_miscompile.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_inline_backtrack_miscompile.wir.wado @@ -80,13 +80,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Parser::advance" = fn(ref Parser) -> i32; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -285,42 +285,42 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_inline_backtrack_miscompile.wado"), used: 65 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_inline_backtrack_miscompile.wado"), used: 65 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_35 = __local_9; i32::fmt_decimal(62, __local_35); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); - String::append(__local_8, __tmpl: block -> ref String { + String::push(__local_8, 58); + String::push(__local_8, 32); + String::push_str(__local_8, __tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_6, String { repr: array.new_data("expected pos=8, got "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("expected pos=8, got "), used: 20 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(p.pos, __local_7); break __tmpl: __local_6; }); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p.pos == 8 "), used: 23 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 46); - String::append_char(__local_8, 112); - String::append_char(__local_8, 111); - String::append_char(__local_8, 115); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 46); + String::push(__local_8, 112); + String::push(__local_8, 111); + String::push(__local_8, 115); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_46 = __local_9; i32::fmt_decimal(__v0, __local_46); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -523,7 +523,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -538,7 +538,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -582,7 +582,7 @@ fn Parser::advance(self) { return v; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -635,7 +635,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l42; }; @@ -669,20 +669,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -692,10 +692,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -705,10 +705,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -716,10 +716,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_labeled_block_fusion.wir.wado b/wado-compiler/tests/fixtures.golden/opt_labeled_block_fusion.wir.wado index 0a8c524b1..c0737bb44 100644 --- a/wado-compiler/tests/fixtures.golden/opt_labeled_block_fusion.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_labeled_block_fusion.wir.wado @@ -97,11 +97,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -191,19 +191,19 @@ fn run() with Stdout { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_labeled_block_fusion.wado"), used: 58 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_labeled_block_fusion.wado"), used: 58 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(36, __local_19); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: b matches { None } "), used: 31 }); break __tmpl: __local_18; @@ -221,29 +221,29 @@ condition: b matches { None } if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_labeled_block_fusion.wado"), used: 58 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_labeled_block_fusion.wado"), used: 58 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_60 = __local_21; i32::fmt_decimal(42, __local_60); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: v == 3 "), used: 19 }); - String::append_char(__local_20, 118); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 118); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_65 = __local_21; i32::fmt_decimal(v, __local_65); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -264,19 +264,19 @@ condition: v == 3 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_labeled_block_fusion.wado"), used: 58 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_labeled_block_fusion.wado"), used: 58 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i32::fmt_decimal(47, __local_23); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: d matches { None } "), used: 31 }); break __tmpl: __local_22; @@ -518,7 +518,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -533,7 +533,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -560,7 +560,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -623,7 +623,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l39; }; @@ -657,20 +657,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -680,10 +680,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -693,10 +693,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -704,10 +704,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref.wir.wado b/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref.wir.wado index 84b6558ca..66ba4539b 100644 --- a/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -333,7 +333,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -348,7 +348,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -386,7 +386,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -420,20 +420,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -443,10 +443,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -456,10 +456,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -467,10 +467,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_method.wir.wado b/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_method.wir.wado index 2aff6a611..9f4b7f17c 100644 --- a/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_method.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Config::get_scale" = fn(ref Config) -> i32; @@ -329,7 +329,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -344,7 +344,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -386,7 +386,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -420,20 +420,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -443,10 +443,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -456,10 +456,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -467,10 +467,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_mixed.wir.wado b/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_mixed.wir.wado index 046237110..5c9fa0049 100644 --- a/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_mixed.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_mixed.wir.wado @@ -78,9 +78,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -349,7 +349,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -364,7 +364,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -402,7 +402,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -436,20 +436,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -459,10 +459,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -472,10 +472,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -483,10 +483,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_multi.wir.wado b/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_multi.wir.wado index 0373ff63f..11113c3a7 100644 --- a/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_multi.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_licm_immut_ref_multi.wir.wado @@ -78,9 +78,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -351,7 +351,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -366,7 +366,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -404,7 +404,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -438,20 +438,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -461,10 +461,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -474,10 +474,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -485,10 +485,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_licm_mut_ref_no_hoist.wir.wado b/wado-compiler/tests/fixtures.golden/opt_licm_mut_ref_no_hoist.wir.wado index b843d5306..56928688a 100644 --- a/wado-compiler/tests/fixtures.golden/opt_licm_mut_ref_no_hoist.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_licm_mut_ref_no_hoist.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -331,7 +331,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -346,7 +346,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -384,7 +384,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -418,20 +418,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -441,10 +441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -454,10 +454,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -465,10 +465,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa.wir.wado index 99f280994..4672b18fb 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa.wir.wado @@ -145,7 +145,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -155,9 +155,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -353,25 +353,25 @@ fn opt_sroa_interprocedural() with Stdout { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(151), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("opt_sroa_interprocedural"), used: 24 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("opt_sroa_interprocedural"), used: 24 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_24 = __local_12; i32::fmt_decimal(202, __local_24); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: use_returned_point() == 30 "), used: 39 }); - String::append(__local_11, String { repr: array.new_data("use_returned_point(): "), used: 22 }); + String::push_str(__local_11, String { repr: array.new_data("use_returned_point(): "), used: 22 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_29 = __local_12; i32::fmt_decimal(__v0_0, __local_29); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -381,25 +381,25 @@ condition: use_returned_point() == 30 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("opt_sroa_interprocedural"), used: 24 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("opt_sroa_interprocedural"), used: 24 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_35 = __local_14; i32::fmt_decimal(203, __local_35); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: pass_struct_arg() == 10 "), used: 36 }); - String::append(__local_13, String { repr: array.new_data("pass_struct_arg(): "), used: 19 }); + String::push_str(__local_13, String { repr: array.new_data("pass_struct_arg(): "), used: 19 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_40 = __local_14; i32::fmt_decimal(__v0_2, __local_40); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -409,25 +409,25 @@ condition: pass_struct_arg() == 10 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("opt_sroa_interprocedural"), used: 24 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("opt_sroa_interprocedural"), used: 24 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_46 = __local_16; i32::fmt_decimal(204, __local_46); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: chain_struct_ops() == 30 "), used: 37 }); - String::append(__local_15, String { repr: array.new_data("chain_struct_ops(): "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("chain_struct_ops(): "), used: 20 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_51 = __local_16; i32::fmt_decimal(__v0_4, __local_51); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -437,29 +437,29 @@ condition: chain_struct_ops() == 30 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("opt_sroa_interprocedural"), used: 24 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("opt_sroa_interprocedural"), used: 24 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_57 = __local_18; i32::fmt_decimal(207, __local_57); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: dot == 32.0 "), used: 24 }); - String::append_char(__local_17, 100); - String::append_char(__local_17, 111); - String::append_char(__local_17, 116); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 100); + String::push(__local_17, 111); + String::push(__local_17, 116); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_62 = __local_18; f64::inspect_into(dot, __local_62); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -469,25 +469,25 @@ condition: dot == 32.0 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("opt_sroa_interprocedural"), used: 24 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("opt_sroa_interprocedural"), used: 24 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_66 = __local_20; i32::fmt_decimal(209, __local_66); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: method_returns_struct() == 33 "), used: 42 }); - String::append(__local_19, String { repr: array.new_data("method_returns_struct(): "), used: 25 }); + String::push_str(__local_19, String { repr: array.new_data("method_returns_struct(): "), used: 25 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_71 = __local_20; i32::fmt_decimal(__v0_9, __local_71); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -628,25 +628,25 @@ fn opt_sroa_multi_value_return() with Stdout { if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("opt_sroa_multi_value_return"), used: 27 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("opt_sroa_multi_value_return"), used: 27 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_36 = __local_28; i32::fmt_decimal(291, __local_36); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: caller_a() == 30 "), used: 29 }); - String::append(__local_27, String { repr: array.new_data("caller_a(): "), used: 12 }); + String::push_str(__local_27, String { repr: array.new_data("caller_a(): "), used: 12 }); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_41 = __local_28; i32::fmt_decimal(__v0_21, __local_41); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -656,25 +656,25 @@ condition: caller_a() == 30 if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_29, String { repr: array.new_data("opt_sroa_multi_value_return"), used: 27 }); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_29, String { repr: array.new_data("opt_sroa_multi_value_return"), used: 27 }); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_47 = __local_30; i32::fmt_decimal(292, __local_47); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: caller_b() == 20000 "), used: 32 }); - String::append(__local_29, String { repr: array.new_data("caller_b(): "), used: 12 }); + String::push_str(__local_29, String { repr: array.new_data("caller_b(): "), used: 12 }); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_52 = __local_30; i32::fmt_decimal(__v0_23, __local_52); - String::append_char(__local_29, 10); + String::push(__local_29, 10); break __tmpl: __local_29; }); unreachable; @@ -684,25 +684,25 @@ condition: caller_b() == 20000 if __cond_26 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_31, String { repr: array.new_data("opt_sroa_multi_value_return"), used: 27 }); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_31, String { repr: array.new_data("opt_sroa_multi_value_return"), used: 27 }); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa.wado"), used: 42 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_58 = __local_32; i32::fmt_decimal(295, __local_58); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: chained() == 12 "), used: 28 }); - String::append(__local_31, String { repr: array.new_data("chained(): "), used: 11 }); + String::push_str(__local_31, String { repr: array.new_data("chained(): "), used: 11 }); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_63 = __local_32; i32::fmt_decimal(__v0_25, __local_63); - String::append_char(__local_31, 10); + String::push(__local_31, 10); break __tmpl: __local_31; }); unreachable; @@ -1491,8 +1491,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1547,13 +1547,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1561,25 +1561,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1587,7 +1587,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1629,8 +1629,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1662,7 +1662,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1791,27 +1791,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1934,9 +1934,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1946,8 +1946,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2002,13 +2002,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2043,9 +2043,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2098,7 +2098,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2113,7 +2113,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2151,7 +2151,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l187; }; @@ -2309,20 +2309,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2332,10 +2332,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2345,10 +2345,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2356,10 +2356,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_box_parameter.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_box_parameter.wir.wado index 2d12a5901..d92d3ca7a 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_box_parameter.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_box_parameter.wir.wado @@ -168,7 +168,7 @@ type "functype/count_digits_base" = fn(i64, i32) -> i32; type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -178,13 +178,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/__Closure_5::__call" = fn(ref __Closure_5) -> ref String; @@ -281,24 +281,24 @@ fn check_i32(x, expected) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("check_i32"), used: 9 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("check_i32"), used: 9 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; i32::fmt_decimal(15, __local_17); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{x}` == expected "), used: 30 }); - String::append(__local_6, String { repr: array.new_data("expected: "), used: 10 }); + String::push_str(__local_6, String { repr: array.new_data("expected: "), used: 10 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -323,24 +323,24 @@ fn check_i64(x, expected) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("check_i64"), used: 9 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("check_i64"), used: 9 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; i32::fmt_decimal(19, __local_17); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{x}` == expected "), used: 30 }); - String::append(__local_6, String { repr: array.new_data("expected: "), used: 10 }); + String::push_str(__local_6, String { repr: array.new_data("expected: "), used: 10 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -365,24 +365,24 @@ fn check_f32(x, expected) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("check_f32"), used: 9 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("check_f32"), used: 9 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_15 = __local_7; i32::fmt_decimal(23, __local_15); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{x}` == expected "), used: 30 }); - String::append(__local_6, String { repr: array.new_data("expected: "), used: 10 }); + String::push_str(__local_6, String { repr: array.new_data("expected: "), used: 10 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -407,24 +407,24 @@ fn check_f64(x, expected) { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("check_f64"), used: 9 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("check_f64"), used: 9 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_15 = __local_7; i32::fmt_decimal(27, __local_15); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: `{x}` == expected "), used: 30 }); - String::append(__local_6, String { repr: array.new_data("expected: "), used: 10 }); + String::push_str(__local_6, String { repr: array.new_data("expected: "), used: 10 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -687,19 +687,19 @@ fn run() with Stdout { if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_101 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_101, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_101, 114); - String::append_char(__local_101, 117); - String::append_char(__local_101, 110); - String::append_char(__local_101, 32); - String::append_char(__local_101, 97); - String::append_char(__local_101, 116); - String::append_char(__local_101, 32); - String::append(__local_101, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_101, 58); + String::push_str(__local_101, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_101, 114); + String::push(__local_101, 117); + String::push(__local_101, 110); + String::push(__local_101, 32); + String::push(__local_101, 97); + String::push(__local_101, 116); + String::push(__local_101, 32); + String::push_str(__local_101, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_101, 58); __local_102 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_101 }; i32::fmt_decimal(45, __local_102); - String::append(__local_101, String { repr: array.new_data(" + String::push_str(__local_101, String { repr: array.new_data(" condition: `{i8_val}` == \"42\" "), used: 31 }); break __tmpl: __local_101; @@ -715,19 +715,19 @@ condition: `{i8_val}` == \"42\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_105 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_105, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_105, 114); - String::append_char(__local_105, 117); - String::append_char(__local_105, 110); - String::append_char(__local_105, 32); - String::append_char(__local_105, 97); - String::append_char(__local_105, 116); - String::append_char(__local_105, 32); - String::append(__local_105, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_105, 58); + String::push_str(__local_105, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_105, 114); + String::push(__local_105, 117); + String::push(__local_105, 110); + String::push(__local_105, 32); + String::push(__local_105, 97); + String::push(__local_105, 116); + String::push(__local_105, 32); + String::push_str(__local_105, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_105, 58); __local_106 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_105 }; i32::fmt_decimal(46, __local_106); - String::append(__local_105, String { repr: array.new_data(" + String::push_str(__local_105, String { repr: array.new_data(" condition: `{i16_val}` == \"1000\" "), used: 34 }); break __tmpl: __local_105; @@ -743,19 +743,19 @@ condition: `{i16_val}` == \"1000\" if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_109 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_109, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_109, 114); - String::append_char(__local_109, 117); - String::append_char(__local_109, 110); - String::append_char(__local_109, 32); - String::append_char(__local_109, 97); - String::append_char(__local_109, 116); - String::append_char(__local_109, 32); - String::append(__local_109, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_109, 58); + String::push_str(__local_109, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_109, 114); + String::push(__local_109, 117); + String::push(__local_109, 110); + String::push(__local_109, 32); + String::push(__local_109, 97); + String::push(__local_109, 116); + String::push(__local_109, 32); + String::push_str(__local_109, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_109, 58); __local_110 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_109 }; i32::fmt_decimal(47, __local_110); - String::append(__local_109, String { repr: array.new_data(" + String::push_str(__local_109, String { repr: array.new_data(" condition: `{i32_val}` == \"100000\" "), used: 36 }); break __tmpl: __local_109; @@ -771,19 +771,19 @@ condition: `{i32_val}` == \"100000\" if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_113 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_113, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_113, 114); - String::append_char(__local_113, 117); - String::append_char(__local_113, 110); - String::append_char(__local_113, 32); - String::append_char(__local_113, 97); - String::append_char(__local_113, 116); - String::append_char(__local_113, 32); - String::append(__local_113, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_113, 58); + String::push_str(__local_113, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_113, 114); + String::push(__local_113, 117); + String::push(__local_113, 110); + String::push(__local_113, 32); + String::push(__local_113, 97); + String::push(__local_113, 116); + String::push(__local_113, 32); + String::push_str(__local_113, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_113, 58); __local_114 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_113 }; i32::fmt_decimal(48, __local_114); - String::append(__local_113, String { repr: array.new_data(" + String::push_str(__local_113, String { repr: array.new_data(" condition: `{i64_val}` == \"999999999\" "), used: 39 }); break __tmpl: __local_113; @@ -799,19 +799,19 @@ condition: `{i64_val}` == \"999999999\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_117 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_117, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_117, 114); - String::append_char(__local_117, 117); - String::append_char(__local_117, 110); - String::append_char(__local_117, 32); - String::append_char(__local_117, 97); - String::append_char(__local_117, 116); - String::append_char(__local_117, 32); - String::append(__local_117, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_117, 58); + String::push_str(__local_117, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_117, 114); + String::push(__local_117, 117); + String::push(__local_117, 110); + String::push(__local_117, 32); + String::push(__local_117, 97); + String::push(__local_117, 116); + String::push(__local_117, 32); + String::push_str(__local_117, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_117, 58); __local_118 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_117 }; i32::fmt_decimal(49, __local_118); - String::append(__local_117, String { repr: array.new_data(" + String::push_str(__local_117, String { repr: array.new_data(" condition: `{u8_val}` == \"255\" "), used: 32 }); break __tmpl: __local_117; @@ -827,19 +827,19 @@ condition: `{u8_val}` == \"255\" if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_121 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_121, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_121, 114); - String::append_char(__local_121, 117); - String::append_char(__local_121, 110); - String::append_char(__local_121, 32); - String::append_char(__local_121, 97); - String::append_char(__local_121, 116); - String::append_char(__local_121, 32); - String::append(__local_121, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_121, 58); + String::push_str(__local_121, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_121, 114); + String::push(__local_121, 117); + String::push(__local_121, 110); + String::push(__local_121, 32); + String::push(__local_121, 97); + String::push(__local_121, 116); + String::push(__local_121, 32); + String::push_str(__local_121, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_121, 58); __local_122 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_121 }; i32::fmt_decimal(50, __local_122); - String::append(__local_121, String { repr: array.new_data(" + String::push_str(__local_121, String { repr: array.new_data(" condition: `{u16_val}` == \"60000\" "), used: 35 }); break __tmpl: __local_121; @@ -855,19 +855,19 @@ condition: `{u16_val}` == \"60000\" if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_125 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_125, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_125, 114); - String::append_char(__local_125, 117); - String::append_char(__local_125, 110); - String::append_char(__local_125, 32); - String::append_char(__local_125, 97); - String::append_char(__local_125, 116); - String::append_char(__local_125, 32); - String::append(__local_125, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_125, 58); + String::push_str(__local_125, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_125, 114); + String::push(__local_125, 117); + String::push(__local_125, 110); + String::push(__local_125, 32); + String::push(__local_125, 97); + String::push(__local_125, 116); + String::push(__local_125, 32); + String::push_str(__local_125, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_125, 58); __local_126 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_125 }; i32::fmt_decimal(51, __local_126); - String::append(__local_125, String { repr: array.new_data(" + String::push_str(__local_125, String { repr: array.new_data(" condition: `{u32_val}` == \"4000000000\" "), used: 40 }); break __tmpl: __local_125; @@ -883,19 +883,19 @@ condition: `{u32_val}` == \"4000000000\" if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_129 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_129, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_129, 114); - String::append_char(__local_129, 117); - String::append_char(__local_129, 110); - String::append_char(__local_129, 32); - String::append_char(__local_129, 97); - String::append_char(__local_129, 116); - String::append_char(__local_129, 32); - String::append(__local_129, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_129, 58); + String::push_str(__local_129, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_129, 114); + String::push(__local_129, 117); + String::push(__local_129, 110); + String::push(__local_129, 32); + String::push(__local_129, 97); + String::push(__local_129, 116); + String::push(__local_129, 32); + String::push_str(__local_129, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_129, 58); __local_130 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_129 }; i32::fmt_decimal(52, __local_130); - String::append(__local_129, String { repr: array.new_data(" + String::push_str(__local_129, String { repr: array.new_data(" condition: `{u64_val}` == \"18000000000000000000\" "), used: 50 }); break __tmpl: __local_129; @@ -911,19 +911,19 @@ condition: `{u64_val}` == \"18000000000000000000\" if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_133 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_133, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_133, 114); - String::append_char(__local_133, 117); - String::append_char(__local_133, 110); - String::append_char(__local_133, 32); - String::append_char(__local_133, 97); - String::append_char(__local_133, 116); - String::append_char(__local_133, 32); - String::append(__local_133, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_133, 58); + String::push_str(__local_133, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_133, 114); + String::push(__local_133, 117); + String::push(__local_133, 110); + String::push(__local_133, 32); + String::push(__local_133, 97); + String::push(__local_133, 116); + String::push(__local_133, 32); + String::push_str(__local_133, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_133, 58); __local_134 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_133 }; i32::fmt_decimal(53, __local_134); - String::append(__local_133, String { repr: array.new_data(" + String::push_str(__local_133, String { repr: array.new_data(" condition: `{f32_val}` == \"3.14\" "), used: 34 }); break __tmpl: __local_133; @@ -939,19 +939,19 @@ condition: `{f32_val}` == \"3.14\" if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_137 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_137, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_137, 114); - String::append_char(__local_137, 117); - String::append_char(__local_137, 110); - String::append_char(__local_137, 32); - String::append_char(__local_137, 97); - String::append_char(__local_137, 116); - String::append_char(__local_137, 32); - String::append(__local_137, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_137, 58); + String::push_str(__local_137, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_137, 114); + String::push(__local_137, 117); + String::push(__local_137, 110); + String::push(__local_137, 32); + String::push(__local_137, 97); + String::push(__local_137, 116); + String::push(__local_137, 32); + String::push_str(__local_137, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_137, 58); __local_138 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_137 }; i32::fmt_decimal(54, __local_138); - String::append(__local_137, String { repr: array.new_data(" + String::push_str(__local_137, String { repr: array.new_data(" condition: `{f64_val}` == \"2.71828\" "), used: 37 }); break __tmpl: __local_137; @@ -969,19 +969,19 @@ condition: `{f64_val}` == \"2.71828\" if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_141 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_141, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_141, 114); - String::append_char(__local_141, 117); - String::append_char(__local_141, 110); - String::append_char(__local_141, 32); - String::append_char(__local_141, 97); - String::append_char(__local_141, 116); - String::append_char(__local_141, 32); - String::append(__local_141, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_141, 58); + String::push_str(__local_141, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_141, 114); + String::push(__local_141, 117); + String::push(__local_141, 110); + String::push(__local_141, 32); + String::push(__local_141, 97); + String::push(__local_141, 116); + String::push(__local_141, 32); + String::push_str(__local_141, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_141, 58); __local_142 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_141 }; i32::fmt_decimal(55, __local_142); - String::append(__local_141, String { repr: array.new_data(" + String::push_str(__local_141, String { repr: array.new_data(" condition: `{bool_val}` == \"true\" "), used: 35 }); break __tmpl: __local_141; @@ -997,19 +997,19 @@ condition: `{bool_val}` == \"true\" if __cond_23 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_145 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_145, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_145, 114); - String::append_char(__local_145, 117); - String::append_char(__local_145, 110); - String::append_char(__local_145, 32); - String::append_char(__local_145, 97); - String::append_char(__local_145, 116); - String::append_char(__local_145, 32); - String::append(__local_145, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_145, 58); + String::push_str(__local_145, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_145, 114); + String::push(__local_145, 117); + String::push(__local_145, 110); + String::push(__local_145, 32); + String::push(__local_145, 97); + String::push(__local_145, 116); + String::push(__local_145, 32); + String::push_str(__local_145, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_145, 58); __local_146 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_145 }; i32::fmt_decimal(56, __local_146); - String::append(__local_145, String { repr: array.new_data(" + String::push_str(__local_145, String { repr: array.new_data(" condition: `{char_val}` == \"Z\" "), used: 32 }); break __tmpl: __local_145; @@ -1025,19 +1025,19 @@ condition: `{char_val}` == \"Z\" if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_149 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_149, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_149, 114); - String::append_char(__local_149, 117); - String::append_char(__local_149, 110); - String::append_char(__local_149, 32); - String::append_char(__local_149, 97); - String::append_char(__local_149, 116); - String::append_char(__local_149, 32); - String::append(__local_149, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_149, 58); + String::push_str(__local_149, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_149, 114); + String::push(__local_149, 117); + String::push(__local_149, 110); + String::push(__local_149, 32); + String::push(__local_149, 97); + String::push(__local_149, 116); + String::push(__local_149, 32); + String::push_str(__local_149, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_149, 58); __local_150 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_149 }; i32::fmt_decimal(59, __local_150); - String::append(__local_149, String { repr: array.new_data(" + String::push_str(__local_149, String { repr: array.new_data(" condition: `{f64_val:0.2f}` == \"2.72\" "), used: 39 }); break __tmpl: __local_149; @@ -1053,19 +1053,19 @@ condition: `{f64_val:0.2f}` == \"2.72\" if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_153 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_153, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_153, 114); - String::append_char(__local_153, 117); - String::append_char(__local_153, 110); - String::append_char(__local_153, 32); - String::append_char(__local_153, 97); - String::append_char(__local_153, 116); - String::append_char(__local_153, 32); - String::append(__local_153, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_153, 58); + String::push_str(__local_153, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_153, 114); + String::push(__local_153, 117); + String::push(__local_153, 110); + String::push(__local_153, 32); + String::push(__local_153, 97); + String::push(__local_153, 116); + String::push(__local_153, 32); + String::push_str(__local_153, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_153, 58); __local_154 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_153 }; i32::fmt_decimal(60, __local_154); - String::append(__local_153, String { repr: array.new_data(" + String::push_str(__local_153, String { repr: array.new_data(" condition: `{i32_val:x}` == \"186a0\" "), used: 37 }); break __tmpl: __local_153; @@ -1081,19 +1081,19 @@ condition: `{i32_val:x}` == \"186a0\" if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_157 = String { repr: builtin::array_new(99), used: 0 }; - String::append(__local_157, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_157, 114); - String::append_char(__local_157, 117); - String::append_char(__local_157, 110); - String::append_char(__local_157, 32); - String::append_char(__local_157, 97); - String::append_char(__local_157, 116); - String::append_char(__local_157, 32); - String::append(__local_157, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_157, 58); + String::push_str(__local_157, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_157, 114); + String::push(__local_157, 117); + String::push(__local_157, 110); + String::push(__local_157, 32); + String::push(__local_157, 97); + String::push(__local_157, 116); + String::push(__local_157, 32); + String::push_str(__local_157, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_157, 58); __local_158 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_157 }; i32::fmt_decimal(69, __local_158); - String::append(__local_157, String { repr: array.new_data(" + String::push_str(__local_157, String { repr: array.new_data(" condition: `{a}` == \"42\" "), used: 26 }); break __tmpl: __local_157; @@ -1109,19 +1109,19 @@ condition: `{a}` == \"42\" if __cond_32 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_161 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_161, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_161, 114); - String::append_char(__local_161, 117); - String::append_char(__local_161, 110); - String::append_char(__local_161, 32); - String::append_char(__local_161, 97); - String::append_char(__local_161, 116); - String::append_char(__local_161, 32); - String::append(__local_161, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_161, 58); + String::push_str(__local_161, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_161, 114); + String::push(__local_161, 117); + String::push(__local_161, 110); + String::push(__local_161, 32); + String::push(__local_161, 97); + String::push(__local_161, 116); + String::push(__local_161, 32); + String::push_str(__local_161, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_161, 58); __local_162 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_161 }; i32::fmt_decimal(70, __local_162); - String::append(__local_161, String { repr: array.new_data(" + String::push_str(__local_161, String { repr: array.new_data(" condition: `{b}` == \"9999999999\" "), used: 34 }); break __tmpl: __local_161; @@ -1137,19 +1137,19 @@ condition: `{b}` == \"9999999999\" if __cond_33 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_165 = String { repr: builtin::array_new(100), used: 0 }; - String::append(__local_165, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_165, 114); - String::append_char(__local_165, 117); - String::append_char(__local_165, 110); - String::append_char(__local_165, 32); - String::append_char(__local_165, 97); - String::append_char(__local_165, 116); - String::append_char(__local_165, 32); - String::append(__local_165, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_165, 58); + String::push_str(__local_165, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_165, 114); + String::push(__local_165, 117); + String::push(__local_165, 110); + String::push(__local_165, 32); + String::push(__local_165, 97); + String::push(__local_165, 116); + String::push(__local_165, 32); + String::push_str(__local_165, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_165, 58); __local_166 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_165 }; i32::fmt_decimal(71, __local_166); - String::append(__local_165, String { repr: array.new_data(" + String::push_str(__local_165, String { repr: array.new_data(" condition: `{c}` == \"1.5\" "), used: 27 }); break __tmpl: __local_165; @@ -1165,19 +1165,19 @@ condition: `{c}` == \"1.5\" if __cond_34 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_169 = String { repr: builtin::array_new(100), used: 0 }; - String::append(__local_169, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_169, 114); - String::append_char(__local_169, 117); - String::append_char(__local_169, 110); - String::append_char(__local_169, 32); - String::append_char(__local_169, 97); - String::append_char(__local_169, 116); - String::append_char(__local_169, 32); - String::append(__local_169, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_169, 58); + String::push_str(__local_169, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_169, 114); + String::push(__local_169, 117); + String::push(__local_169, 110); + String::push(__local_169, 32); + String::push(__local_169, 97); + String::push(__local_169, 116); + String::push(__local_169, 32); + String::push_str(__local_169, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_169, 58); __local_170 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_169 }; i32::fmt_decimal(72, __local_170); - String::append(__local_169, String { repr: array.new_data(" + String::push_str(__local_169, String { repr: array.new_data(" condition: `{d}` == \"2.5\" "), used: 27 }); break __tmpl: __local_169; @@ -1195,19 +1195,19 @@ condition: `{d}` == \"2.5\" if __cond_35 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_173 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_173, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_173, 114); - String::append_char(__local_173, 117); - String::append_char(__local_173, 110); - String::append_char(__local_173, 32); - String::append_char(__local_173, 97); - String::append_char(__local_173, 116); - String::append_char(__local_173, 32); - String::append(__local_173, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_173, 58); + String::push_str(__local_173, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_173, 114); + String::push(__local_173, 117); + String::push(__local_173, 110); + String::push(__local_173, 32); + String::push(__local_173, 97); + String::push(__local_173, 116); + String::push(__local_173, 32); + String::push_str(__local_173, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_173, 58); __local_174 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_173 }; i32::fmt_decimal(73, __local_174); - String::append(__local_173, String { repr: array.new_data(" + String::push_str(__local_173, String { repr: array.new_data(" condition: `{e}` == \"false\" "), used: 29 }); break __tmpl: __local_173; @@ -1223,19 +1223,19 @@ condition: `{e}` == \"false\" if __cond_36 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_177 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_177, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_177, 114); - String::append_char(__local_177, 117); - String::append_char(__local_177, 110); - String::append_char(__local_177, 32); - String::append_char(__local_177, 97); - String::append_char(__local_177, 116); - String::append_char(__local_177, 32); - String::append(__local_177, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_177, 58); + String::push_str(__local_177, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_177, 114); + String::push(__local_177, 117); + String::push(__local_177, 110); + String::push(__local_177, 32); + String::push(__local_177, 97); + String::push(__local_177, 116); + String::push(__local_177, 32); + String::push_str(__local_177, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_177, 58); __local_178 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_177 }; i32::fmt_decimal(77, __local_178); - String::append(__local_177, String { repr: array.new_data(" + String::push_str(__local_177, String { repr: array.new_data(" condition: `{i32_val}` == \"100000\" "), used: 36 }); break __tmpl: __local_177; @@ -1251,19 +1251,19 @@ condition: `{i32_val}` == \"100000\" if __cond_37 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_181 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_181, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_181, 114); - String::append_char(__local_181, 117); - String::append_char(__local_181, 110); - String::append_char(__local_181, 32); - String::append_char(__local_181, 97); - String::append_char(__local_181, 116); - String::append_char(__local_181, 32); - String::append(__local_181, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_181, 58); + String::push_str(__local_181, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_181, 114); + String::push(__local_181, 117); + String::push(__local_181, 110); + String::push(__local_181, 32); + String::push(__local_181, 97); + String::push(__local_181, 116); + String::push(__local_181, 32); + String::push_str(__local_181, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_181, 58); __local_182 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_181 }; i32::fmt_decimal(78, __local_182); - String::append(__local_181, String { repr: array.new_data(" + String::push_str(__local_181, String { repr: array.new_data(" condition: `{f64_val:0.1f}` == \"2.7\" "), used: 38 }); break __tmpl: __local_181; @@ -1297,29 +1297,29 @@ condition: `{f64_val:0.1f}` == \"2.7\" if __cond_47 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_189 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_189, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_189, 114); - String::append_char(__local_189, 117); - String::append_char(__local_189, 110); - String::append_char(__local_189, 32); - String::append_char(__local_189, 97); - String::append_char(__local_189, 116); - String::append_char(__local_189, 32); - String::append(__local_189, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_189, 58); + String::push_str(__local_189, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_189, 114); + String::push(__local_189, 117); + String::push(__local_189, 110); + String::push(__local_189, 32); + String::push(__local_189, 97); + String::push(__local_189, 116); + String::push(__local_189, 32); + String::push_str(__local_189, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_189, 58); __local_190 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_189 }; __local_502 = __local_190; i32::fmt_decimal(94, __local_502); - String::append(__local_189, String { repr: array.new_data(" + String::push_str(__local_189, String { repr: array.new_data(" condition: r1 == \"77\" "), used: 23 }); - String::append_char(__local_189, 114); - String::append_char(__local_189, 49); - String::append_char(__local_189, 58); - String::append_char(__local_189, 32); + String::push(__local_189, 114); + String::push(__local_189, 49); + String::push(__local_189, 58); + String::push(__local_189, 32); __local_190 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_189 }; String^Inspect::inspect(__v0_46, __local_190); - String::append_char(__local_189, 10); + String::push(__local_189, 10); break __tmpl: __local_189; }); unreachable; @@ -1346,29 +1346,29 @@ condition: r1 == \"77\" if __cond_51 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_193 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_193, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_193, 114); - String::append_char(__local_193, 117); - String::append_char(__local_193, 110); - String::append_char(__local_193, 32); - String::append_char(__local_193, 97); - String::append_char(__local_193, 116); - String::append_char(__local_193, 32); - String::append(__local_193, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_193, 58); + String::push_str(__local_193, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_193, 114); + String::push(__local_193, 117); + String::push(__local_193, 110); + String::push(__local_193, 32); + String::push(__local_193, 97); + String::push(__local_193, 116); + String::push(__local_193, 32); + String::push_str(__local_193, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_193, 58); __local_194 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_193 }; __local_515 = __local_194; i32::fmt_decimal(100, __local_515); - String::append(__local_193, String { repr: array.new_data(" + String::push_str(__local_193, String { repr: array.new_data(" condition: r2 == \"123456789\" "), used: 30 }); - String::append_char(__local_193, 114); - String::append_char(__local_193, 50); - String::append_char(__local_193, 58); - String::append_char(__local_193, 32); + String::push(__local_193, 114); + String::push(__local_193, 50); + String::push(__local_193, 58); + String::push(__local_193, 32); __local_194 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_193 }; String^Inspect::inspect(__v0_50, __local_194); - String::append_char(__local_193, 10); + String::push(__local_193, 10); break __tmpl: __local_193; }); unreachable; @@ -1395,29 +1395,29 @@ condition: r2 == \"123456789\" if __cond_55 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_197 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_197, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_197, 114); - String::append_char(__local_197, 117); - String::append_char(__local_197, 110); - String::append_char(__local_197, 32); - String::append_char(__local_197, 97); - String::append_char(__local_197, 116); - String::append_char(__local_197, 32); - String::append(__local_197, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_197, 58); + String::push_str(__local_197, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_197, 114); + String::push(__local_197, 117); + String::push(__local_197, 110); + String::push(__local_197, 32); + String::push(__local_197, 97); + String::push(__local_197, 116); + String::push(__local_197, 32); + String::push_str(__local_197, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_197, 58); __local_198 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_197 }; __local_526 = __local_198; i32::fmt_decimal(106, __local_526); - String::append(__local_197, String { repr: array.new_data(" + String::push_str(__local_197, String { repr: array.new_data(" condition: r3 == \"6.28\" "), used: 25 }); - String::append_char(__local_197, 114); - String::append_char(__local_197, 51); - String::append_char(__local_197, 58); - String::append_char(__local_197, 32); + String::push(__local_197, 114); + String::push(__local_197, 51); + String::push(__local_197, 58); + String::push(__local_197, 32); __local_198 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_197 }; String^Inspect::inspect(__v0_54, __local_198); - String::append_char(__local_197, 10); + String::push(__local_197, 10); break __tmpl: __local_197; }); unreachable; @@ -1444,29 +1444,29 @@ condition: r3 == \"6.28\" if __cond_59 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_201 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_201, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_201, 114); - String::append_char(__local_201, 117); - String::append_char(__local_201, 110); - String::append_char(__local_201, 32); - String::append_char(__local_201, 97); - String::append_char(__local_201, 116); - String::append_char(__local_201, 32); - String::append(__local_201, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_201, 58); + String::push_str(__local_201, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_201, 114); + String::push(__local_201, 117); + String::push(__local_201, 110); + String::push(__local_201, 32); + String::push(__local_201, 97); + String::push(__local_201, 116); + String::push(__local_201, 32); + String::push_str(__local_201, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_201, 58); __local_202 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_201 }; __local_537 = __local_202; i32::fmt_decimal(112, __local_537); - String::append(__local_201, String { repr: array.new_data(" + String::push_str(__local_201, String { repr: array.new_data(" condition: r4 == \"1.414\" "), used: 26 }); - String::append_char(__local_201, 114); - String::append_char(__local_201, 52); - String::append_char(__local_201, 58); - String::append_char(__local_201, 32); + String::push(__local_201, 114); + String::push(__local_201, 52); + String::push(__local_201, 58); + String::push(__local_201, 32); __local_202 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_201 }; String^Inspect::inspect(__v0_58, __local_202); - String::append_char(__local_201, 10); + String::push(__local_201, 10); break __tmpl: __local_201; }); unreachable; @@ -1498,29 +1498,29 @@ condition: r4 == \"1.414\" if __cond_63 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_205 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_205, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_205, 114); - String::append_char(__local_205, 117); - String::append_char(__local_205, 110); - String::append_char(__local_205, 32); - String::append_char(__local_205, 97); - String::append_char(__local_205, 116); - String::append_char(__local_205, 32); - String::append(__local_205, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_205, 58); + String::push_str(__local_205, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_205, 114); + String::push(__local_205, 117); + String::push(__local_205, 110); + String::push(__local_205, 32); + String::push(__local_205, 97); + String::push(__local_205, 116); + String::push(__local_205, 32); + String::push_str(__local_205, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_205, 58); __local_206 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_205 }; __local_550 = __local_206; i32::fmt_decimal(118, __local_550); - String::append(__local_205, String { repr: array.new_data(" + String::push_str(__local_205, String { repr: array.new_data(" condition: r5 == \"true\" "), used: 25 }); - String::append_char(__local_205, 114); - String::append_char(__local_205, 53); - String::append_char(__local_205, 58); - String::append_char(__local_205, 32); + String::push(__local_205, 114); + String::push(__local_205, 53); + String::push(__local_205, 58); + String::push(__local_205, 32); __local_206 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_205 }; String^Inspect::inspect(__v0_62, __local_206); - String::append_char(__local_205, 10); + String::push(__local_205, 10); break __tmpl: __local_205; }); unreachable; @@ -1537,28 +1537,28 @@ condition: r5 == \"true\" if __cond_66 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_209 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_209, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_209, 114); - String::append_char(__local_209, 117); - String::append_char(__local_209, 110); - String::append_char(__local_209, 32); - String::append_char(__local_209, 97); - String::append_char(__local_209, 116); - String::append_char(__local_209, 32); - String::append(__local_209, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_209, 58); + String::push_str(__local_209, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_209, 114); + String::push(__local_209, 117); + String::push(__local_209, 110); + String::push(__local_209, 32); + String::push(__local_209, 97); + String::push(__local_209, 116); + String::push(__local_209, 32); + String::push_str(__local_209, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_209, 58); __local_210 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_209 }; __local_563 = __local_210; i32::fmt_decimal(122, __local_563); - String::append(__local_209, String { repr: array.new_data(" + String::push_str(__local_209, String { repr: array.new_data(" condition: s == \"100000\" "), used: 26 }); - String::append_char(__local_209, 115); - String::append_char(__local_209, 58); - String::append_char(__local_209, 32); + String::push(__local_209, 115); + String::push(__local_209, 58); + String::push(__local_209, 32); __local_210 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_209 }; String^Inspect::inspect(__v0_65, __local_210); - String::append_char(__local_209, 10); + String::push(__local_209, 10); break __tmpl: __local_209; }); unreachable; @@ -1579,28 +1579,28 @@ condition: s == \"100000\" if __cond_69 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_213 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_213, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_213, 114); - String::append_char(__local_213, 117); - String::append_char(__local_213, 110); - String::append_char(__local_213, 32); - String::append_char(__local_213, 97); - String::append_char(__local_213, 116); - String::append_char(__local_213, 32); - String::append(__local_213, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_213, 58); + String::push_str(__local_213, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_213, 114); + String::push(__local_213, 117); + String::push(__local_213, 110); + String::push(__local_213, 32); + String::push(__local_213, 97); + String::push(__local_213, 116); + String::push(__local_213, 32); + String::push_str(__local_213, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_213, 58); __local_214 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_213 }; __local_576 = __local_214; i32::fmt_decimal(128, __local_576); - String::append(__local_213, String { repr: array.new_data(" + String::push_str(__local_213, String { repr: array.new_data(" condition: s == \"999999999\" "), used: 29 }); - String::append_char(__local_213, 115); - String::append_char(__local_213, 58); - String::append_char(__local_213, 32); + String::push(__local_213, 115); + String::push(__local_213, 58); + String::push(__local_213, 32); __local_214 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_213 }; String^Inspect::inspect(__v0_68, __local_214); - String::append_char(__local_213, 10); + String::push(__local_213, 10); break __tmpl: __local_213; }); unreachable; @@ -1621,28 +1621,28 @@ condition: s == \"999999999\" if __cond_72 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_217 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_217, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_217, 114); - String::append_char(__local_217, 117); - String::append_char(__local_217, 110); - String::append_char(__local_217, 32); - String::append_char(__local_217, 97); - String::append_char(__local_217, 116); - String::append_char(__local_217, 32); - String::append(__local_217, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_217, 58); + String::push_str(__local_217, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_217, 114); + String::push(__local_217, 117); + String::push(__local_217, 110); + String::push(__local_217, 32); + String::push(__local_217, 97); + String::push(__local_217, 116); + String::push(__local_217, 32); + String::push_str(__local_217, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_217, 58); __local_218 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_217 }; __local_587 = __local_218; i32::fmt_decimal(134, __local_587); - String::append(__local_217, String { repr: array.new_data(" + String::push_str(__local_217, String { repr: array.new_data(" condition: s == \"3.14\" "), used: 24 }); - String::append_char(__local_217, 115); - String::append_char(__local_217, 58); - String::append_char(__local_217, 32); + String::push(__local_217, 115); + String::push(__local_217, 58); + String::push(__local_217, 32); __local_218 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_217 }; String^Inspect::inspect(__v0_71, __local_218); - String::append_char(__local_217, 10); + String::push(__local_217, 10); break __tmpl: __local_217; }); unreachable; @@ -1663,28 +1663,28 @@ condition: s == \"3.14\" if __cond_75 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_221 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_221, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_221, 114); - String::append_char(__local_221, 117); - String::append_char(__local_221, 110); - String::append_char(__local_221, 32); - String::append_char(__local_221, 97); - String::append_char(__local_221, 116); - String::append_char(__local_221, 32); - String::append(__local_221, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_221, 58); + String::push_str(__local_221, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_221, 114); + String::push(__local_221, 117); + String::push(__local_221, 110); + String::push(__local_221, 32); + String::push(__local_221, 97); + String::push(__local_221, 116); + String::push(__local_221, 32); + String::push_str(__local_221, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_221, 58); __local_222 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_221 }; __local_598 = __local_222; i32::fmt_decimal(140, __local_598); - String::append(__local_221, String { repr: array.new_data(" + String::push_str(__local_221, String { repr: array.new_data(" condition: s == \"2.71828\" "), used: 27 }); - String::append_char(__local_221, 115); - String::append_char(__local_221, 58); - String::append_char(__local_221, 32); + String::push(__local_221, 115); + String::push(__local_221, 58); + String::push(__local_221, 32); __local_222 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_221 }; String^Inspect::inspect(__v0_74, __local_222); - String::append_char(__local_221, 10); + String::push(__local_221, 10); break __tmpl: __local_221; }); unreachable; @@ -1706,28 +1706,28 @@ condition: s == \"2.71828\" if __cond_78 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_225 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_225, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_225, 114); - String::append_char(__local_225, 117); - String::append_char(__local_225, 110); - String::append_char(__local_225, 32); - String::append_char(__local_225, 97); - String::append_char(__local_225, 116); - String::append_char(__local_225, 32); - String::append(__local_225, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_225, 58); + String::push_str(__local_225, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_225, 114); + String::push(__local_225, 117); + String::push(__local_225, 110); + String::push(__local_225, 32); + String::push(__local_225, 97); + String::push(__local_225, 116); + String::push(__local_225, 32); + String::push_str(__local_225, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_225, 58); __local_226 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_225 }; __local_611 = __local_226; i32::fmt_decimal(146, __local_611); - String::append(__local_225, String { repr: array.new_data(" + String::push_str(__local_225, String { repr: array.new_data(" condition: s == \"true\" "), used: 24 }); - String::append_char(__local_225, 115); - String::append_char(__local_225, 58); - String::append_char(__local_225, 32); + String::push(__local_225, 115); + String::push(__local_225, 58); + String::push(__local_225, 32); __local_226 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_225 }; String^Inspect::inspect(__v0_77, __local_226); - String::append_char(__local_225, 10); + String::push(__local_225, 10); break __tmpl: __local_225; }); unreachable; @@ -1746,26 +1746,26 @@ condition: s == \"true\" if __cond_85 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_237 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_237, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_237, 114); - String::append_char(__local_237, 117); - String::append_char(__local_237, 110); - String::append_char(__local_237, 32); - String::append_char(__local_237, 97); - String::append_char(__local_237, 116); - String::append_char(__local_237, 32); - String::append(__local_237, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_237, 58); + String::push_str(__local_237, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_237, 114); + String::push(__local_237, 117); + String::push(__local_237, 110); + String::push(__local_237, 32); + String::push(__local_237, 97); + String::push(__local_237, 116); + String::push(__local_237, 32); + String::push_str(__local_237, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_237, 58); __local_238 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_237 }; __local_854 = __local_238; i32::fmt_decimal(158, __local_854); - String::append(__local_237, String { repr: array.new_data(" + String::push_str(__local_237, String { repr: array.new_data(" condition: fmt_i32(42) == \"42\" "), used: 32 }); - String::append(__local_237, String { repr: array.new_data("fmt_i32(42): "), used: 13 }); + String::push_str(__local_237, String { repr: array.new_data("fmt_i32(42): "), used: 13 }); __local_238 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_237 }; String^Inspect::inspect(__v0_84, __local_238); - String::append_char(__local_237, 10); + String::push(__local_237, 10); break __tmpl: __local_237; }); unreachable; @@ -1780,26 +1780,26 @@ condition: fmt_i32(42) == \"42\" if __cond_87 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_239 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_239, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_239, 114); - String::append_char(__local_239, 117); - String::append_char(__local_239, 110); - String::append_char(__local_239, 32); - String::append_char(__local_239, 97); - String::append_char(__local_239, 116); - String::append_char(__local_239, 32); - String::append(__local_239, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_239, 58); + String::push_str(__local_239, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_239, 114); + String::push(__local_239, 117); + String::push(__local_239, 110); + String::push(__local_239, 32); + String::push(__local_239, 97); + String::push(__local_239, 116); + String::push(__local_239, 32); + String::push_str(__local_239, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_239, 58); __local_240 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_239 }; __local_1099 = __local_240; i32::fmt_decimal(159, __local_1099); - String::append(__local_239, String { repr: array.new_data(" + String::push_str(__local_239, String { repr: array.new_data(" condition: fmt_i64(123456789) == \"123456789\" "), used: 46 }); - String::append(__local_239, String { repr: array.new_data("fmt_i64(123456789): "), used: 20 }); + String::push_str(__local_239, String { repr: array.new_data("fmt_i64(123456789): "), used: 20 }); __local_240 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_239 }; String^Inspect::inspect(__v0_86, __local_240); - String::append_char(__local_239, 10); + String::push(__local_239, 10); break __tmpl: __local_239; }); unreachable; @@ -1814,26 +1814,26 @@ condition: fmt_i64(123456789) == \"123456789\" if __cond_89 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_241 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_241, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_241, 114); - String::append_char(__local_241, 117); - String::append_char(__local_241, 110); - String::append_char(__local_241, 32); - String::append_char(__local_241, 97); - String::append_char(__local_241, 116); - String::append_char(__local_241, 32); - String::append(__local_241, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_241, 58); + String::push_str(__local_241, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_241, 114); + String::push(__local_241, 117); + String::push(__local_241, 110); + String::push(__local_241, 32); + String::push(__local_241, 97); + String::push(__local_241, 116); + String::push(__local_241, 32); + String::push_str(__local_241, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_241, 58); __local_242 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_241 }; __local_1344 = __local_242; i32::fmt_decimal(160, __local_1344); - String::append(__local_241, String { repr: array.new_data(" + String::push_str(__local_241, String { repr: array.new_data(" condition: fmt_f32(2.5) == \"2.5\" "), used: 34 }); - String::append(__local_241, String { repr: array.new_data("fmt_f32(2.5): "), used: 14 }); + String::push_str(__local_241, String { repr: array.new_data("fmt_f32(2.5): "), used: 14 }); __local_242 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_241 }; String^Inspect::inspect(__v0_88, __local_242); - String::append_char(__local_241, 10); + String::push(__local_241, 10); break __tmpl: __local_241; }); unreachable; @@ -1848,26 +1848,26 @@ condition: fmt_f32(2.5) == \"2.5\" if __cond_91 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_243 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_243, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_243, 114); - String::append_char(__local_243, 117); - String::append_char(__local_243, 110); - String::append_char(__local_243, 32); - String::append_char(__local_243, 97); - String::append_char(__local_243, 116); - String::append_char(__local_243, 32); - String::append(__local_243, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_243, 58); + String::push_str(__local_243, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_243, 114); + String::push(__local_243, 117); + String::push(__local_243, 110); + String::push(__local_243, 32); + String::push(__local_243, 97); + String::push(__local_243, 116); + String::push(__local_243, 32); + String::push_str(__local_243, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_243, 58); __local_244 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_243 }; __local_1591 = __local_244; i32::fmt_decimal(161, __local_1591); - String::append(__local_243, String { repr: array.new_data(" + String::push_str(__local_243, String { repr: array.new_data(" condition: fmt_f64(3.14159) == \"3.14159\" "), used: 42 }); - String::append(__local_243, String { repr: array.new_data("fmt_f64(3.14159): "), used: 18 }); + String::push_str(__local_243, String { repr: array.new_data("fmt_f64(3.14159): "), used: 18 }); __local_244 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_243 }; String^Inspect::inspect(__v0_90, __local_244); - String::append_char(__local_243, 10); + String::push(__local_243, 10); break __tmpl: __local_243; }); unreachable; @@ -1883,26 +1883,26 @@ condition: fmt_f64(3.14159) == \"3.14159\" if __cond_93 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_245 = String { repr: builtin::array_new(146), used: 0 }; - String::append(__local_245, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_245, 114); - String::append_char(__local_245, 117); - String::append_char(__local_245, 110); - String::append_char(__local_245, 32); - String::append_char(__local_245, 97); - String::append_char(__local_245, 116); - String::append_char(__local_245, 32); - String::append(__local_245, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_245, 58); + String::push_str(__local_245, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_245, 114); + String::push(__local_245, 117); + String::push(__local_245, 110); + String::push(__local_245, 32); + String::push(__local_245, 97); + String::push(__local_245, 116); + String::push(__local_245, 32); + String::push_str(__local_245, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_245, 58); __local_246 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_245 }; __local_1842 = __local_246; i32::fmt_decimal(162, __local_1842); - String::append(__local_245, String { repr: array.new_data(" + String::push_str(__local_245, String { repr: array.new_data(" condition: fmt_bool(false) == \"false\" "), used: 39 }); - String::append(__local_245, String { repr: array.new_data("fmt_bool(false): "), used: 17 }); + String::push_str(__local_245, String { repr: array.new_data("fmt_bool(false): "), used: 17 }); __local_246 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_245 }; String^Inspect::inspect(__v0_92, __local_246); - String::append_char(__local_245, 10); + String::push(__local_245, 10); break __tmpl: __local_245; }); unreachable; @@ -1913,26 +1913,26 @@ condition: fmt_bool(false) == \"false\" if __cond_98 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_249 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_249, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_249, 114); - String::append_char(__local_249, 117); - String::append_char(__local_249, 110); - String::append_char(__local_249, 32); - String::append_char(__local_249, 97); - String::append_char(__local_249, 116); - String::append_char(__local_249, 32); - String::append(__local_249, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); - String::append_char(__local_249, 58); + String::push_str(__local_249, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_249, 114); + String::push(__local_249, 117); + String::push(__local_249, 110); + String::push(__local_249, 32); + String::push(__local_249, 97); + String::push(__local_249, 116); + String::push(__local_249, 32); + String::push_str(__local_249, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado"), used: 56 }); + String::push(__local_249, 58); __local_250 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_249 }; __local_1849 = __local_250; i32::fmt_decimal(168, __local_1849); - String::append(__local_249, String { repr: array.new_data(" + String::push_str(__local_249, String { repr: array.new_data(" condition: fmt_captured() == \"999, 1.618\" "), used: 43 }); - String::append(__local_249, String { repr: array.new_data("fmt_captured(): "), used: 16 }); + String::push_str(__local_249, String { repr: array.new_data("fmt_captured(): "), used: 16 }); __local_250 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_249 }; String^Inspect::inspect(__v0_97, __local_250); - String::append_char(__local_249, 10); + String::push(__local_249, 10); break __tmpl: __local_249; }); unreachable; @@ -2834,8 +2834,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2890,8 +2890,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2923,7 +2923,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -3113,27 +3113,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3418,9 +3418,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -3485,9 +3485,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -3541,13 +3541,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -3582,9 +3582,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -3595,10 +3595,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -3664,7 +3664,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -3752,7 +3752,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -3789,8 +3789,8 @@ fn __Closure_5::__call(self) { __local_249 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_248 }; __local_253 = __local_249; i32::fmt_decimal(self.__capture_0, __local_253); - String::append_char(__local_248, 44); - String::append_char(__local_248, 32); + String::push(__local_248, 44); + String::push(__local_248, 32); __local_249 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_248 }; __local_258 = __local_249; f64::fmt_into(self.__capture_1, __local_258); @@ -3809,7 +3809,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l261; }; @@ -3829,7 +3829,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3837,17 +3837,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -4001,20 +4001,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -4024,10 +4024,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -4037,10 +4037,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -4048,10 +4048,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -4063,7 +4063,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -4080,22 +4080,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b300; @@ -4103,7 +4103,7 @@ fn String^Inspect::inspect(self, f) { continue l301; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/opt_sroa_box_parameter.wado/__closure_wrapper_0"(__env) { diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_edge_cases.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_edge_cases.wir.wado index 10f83516e..b0fdef68e 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_edge_cases.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_edge_cases.wir.wado @@ -143,7 +143,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -153,9 +153,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -524,27 +524,27 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_44, 114); - String::append_char(__local_44, 117); - String::append_char(__local_44, 110); - String::append_char(__local_44, 32); - String::append_char(__local_44, 97); - String::append_char(__local_44, 116); - String::append_char(__local_44, 32); - String::append(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_44, 58); + String::push_str(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_44, 114); + String::push(__local_44, 117); + String::push(__local_44, 110); + String::push(__local_44, 32); + String::push(__local_44, 97); + String::push(__local_44, 116); + String::push(__local_44, 32); + String::push_str(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_44, 58); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_91 = __local_45; i32::fmt_decimal(213, __local_91); - String::append(__local_44, String { repr: array.new_data(" + String::push_str(__local_44, String { repr: array.new_data(" condition: sroa_in_loop() == 30 "), used: 33 }); - String::append(__local_44, String { repr: array.new_data("sroa_in_loop(): "), used: 16 }); + String::push_str(__local_44, String { repr: array.new_data("sroa_in_loop(): "), used: 16 }); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_96 = __local_45; i32::fmt_decimal(__v0_0, __local_96); - String::append_char(__local_44, 10); + String::push(__local_44, 10); break __tmpl: __local_44; }); unreachable; @@ -554,27 +554,27 @@ condition: sroa_in_loop() == 30 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_46 = String { repr: builtin::array_new(172), used: 0 }; - String::append(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_46, 114); - String::append_char(__local_46, 117); - String::append_char(__local_46, 110); - String::append_char(__local_46, 32); - String::append_char(__local_46, 97); - String::append_char(__local_46, 116); - String::append_char(__local_46, 32); - String::append(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_46, 58); + String::push_str(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_46, 114); + String::push(__local_46, 117); + String::push(__local_46, 110); + String::push(__local_46, 32); + String::push(__local_46, 97); + String::push(__local_46, 116); + String::push(__local_46, 32); + String::push_str(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_46, 58); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_102 = __local_47; i32::fmt_decimal(214, __local_102); - String::append(__local_46, String { repr: array.new_data(" + String::push_str(__local_46, String { repr: array.new_data(" condition: conditional_field_access(true) == 120 "), used: 50 }); - String::append(__local_46, String { repr: array.new_data("conditional_field_access(true): "), used: 32 }); + String::push_str(__local_46, String { repr: array.new_data("conditional_field_access(true): "), used: 32 }); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_107 = __local_47; i32::fmt_decimal(__v0_2, __local_107); - String::append_char(__local_46, 10); + String::push(__local_46, 10); break __tmpl: __local_46; }); unreachable; @@ -584,27 +584,27 @@ condition: conditional_field_access(true) == 120 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_48 = String { repr: builtin::array_new(173), used: 0 }; - String::append(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_48, 114); - String::append_char(__local_48, 117); - String::append_char(__local_48, 110); - String::append_char(__local_48, 32); - String::append_char(__local_48, 97); - String::append_char(__local_48, 116); - String::append_char(__local_48, 32); - String::append(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_48, 58); + String::push_str(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_48, 114); + String::push(__local_48, 117); + String::push(__local_48, 110); + String::push(__local_48, 32); + String::push(__local_48, 97); + String::push(__local_48, 116); + String::push(__local_48, 32); + String::push_str(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_48, 58); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_113 = __local_49; i32::fmt_decimal(215, __local_113); - String::append(__local_48, String { repr: array.new_data(" + String::push_str(__local_48, String { repr: array.new_data(" condition: conditional_field_access(false) == 30 "), used: 50 }); - String::append(__local_48, String { repr: array.new_data("conditional_field_access(false): "), used: 33 }); + String::push_str(__local_48, String { repr: array.new_data("conditional_field_access(false): "), used: 33 }); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_118 = __local_49; i32::fmt_decimal(__v0_4, __local_118); - String::append_char(__local_48, 10); + String::push(__local_48, 10); break __tmpl: __local_48; }); unreachable; @@ -614,27 +614,27 @@ condition: conditional_field_access(false) == 30 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_50 = String { repr: builtin::array_new(159), used: 0 }; - String::append(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_50, 114); - String::append_char(__local_50, 117); - String::append_char(__local_50, 110); - String::append_char(__local_50, 32); - String::append_char(__local_50, 97); - String::append_char(__local_50, 116); - String::append_char(__local_50, 32); - String::append(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_50, 58); + String::push_str(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_50, 114); + String::push(__local_50, 117); + String::push(__local_50, 110); + String::push(__local_50, 32); + String::push(__local_50, 97); + String::push(__local_50, 116); + String::push(__local_50, 32); + String::push_str(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_50, 58); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_124 = __local_51; i32::fmt_decimal(216, __local_124); - String::append(__local_50, String { repr: array.new_data(" + String::push_str(__local_50, String { repr: array.new_data(" condition: different_struct_types() == 92 "), used: 43 }); - String::append(__local_50, String { repr: array.new_data("different_struct_types(): "), used: 26 }); + String::push_str(__local_50, String { repr: array.new_data("different_struct_types(): "), used: 26 }); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_129 = __local_51; i32::fmt_decimal(__v0_6, __local_129); - String::append_char(__local_50, 10); + String::push(__local_50, 10); break __tmpl: __local_50; }); unreachable; @@ -644,27 +644,27 @@ condition: different_struct_types() == 92 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_52 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_52, 114); - String::append_char(__local_52, 117); - String::append_char(__local_52, 110); - String::append_char(__local_52, 32); - String::append_char(__local_52, 97); - String::append_char(__local_52, 116); - String::append_char(__local_52, 32); - String::append(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_52, 58); + String::push_str(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_52, 114); + String::push(__local_52, 117); + String::push(__local_52, 110); + String::push(__local_52, 32); + String::push(__local_52, 97); + String::push(__local_52, 116); + String::push(__local_52, 32); + String::push_str(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_52, 58); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_135 = __local_53; i32::fmt_decimal(217, __local_135); - String::append(__local_52, String { repr: array.new_data(" + String::push_str(__local_52, String { repr: array.new_data(" condition: struct_from_call() == 100 "), used: 38 }); - String::append(__local_52, String { repr: array.new_data("struct_from_call(): "), used: 20 }); + String::push_str(__local_52, String { repr: array.new_data("struct_from_call(): "), used: 20 }); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_140 = __local_53; i32::fmt_decimal(__v0_8, __local_140); - String::append_char(__local_52, 10); + String::push(__local_52, 10); break __tmpl: __local_52; }); unreachable; @@ -674,27 +674,27 @@ condition: struct_from_call() == 100 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_54 = String { repr: builtin::array_new(157), used: 0 }; - String::append(__local_54, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_54, 114); - String::append_char(__local_54, 117); - String::append_char(__local_54, 110); - String::append_char(__local_54, 32); - String::append_char(__local_54, 97); - String::append_char(__local_54, 116); - String::append_char(__local_54, 32); - String::append(__local_54, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_54, 58); + String::push_str(__local_54, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_54, 114); + String::push(__local_54, 117); + String::push(__local_54, 110); + String::push(__local_54, 32); + String::push(__local_54, 97); + String::push(__local_54, 116); + String::push(__local_54, 32); + String::push_str(__local_54, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_54, 58); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_146 = __local_55; i32::fmt_decimal(218, __local_146); - String::append(__local_54, String { repr: array.new_data(" + String::push_str(__local_54, String { repr: array.new_data(" condition: interleaved_field_ops() == 33 "), used: 42 }); - String::append(__local_54, String { repr: array.new_data("interleaved_field_ops(): "), used: 25 }); + String::push_str(__local_54, String { repr: array.new_data("interleaved_field_ops(): "), used: 25 }); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_151 = __local_55; i32::fmt_decimal(__v0_10, __local_151); - String::append_char(__local_54, 10); + String::push(__local_54, 10); break __tmpl: __local_54; }); unreachable; @@ -704,27 +704,27 @@ condition: interleaved_field_ops() == 33 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_56 = String { repr: builtin::array_new(146), used: 0 }; - String::append(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_56, 114); - String::append_char(__local_56, 117); - String::append_char(__local_56, 110); - String::append_char(__local_56, 32); - String::append_char(__local_56, 97); - String::append_char(__local_56, 116); - String::append_char(__local_56, 32); - String::append(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_56, 58); + String::push_str(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_56, 114); + String::push(__local_56, 117); + String::push(__local_56, 110); + String::push(__local_56, 32); + String::push(__local_56, 97); + String::push(__local_56, 116); + String::push(__local_56, 32); + String::push_str(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_56, 58); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_157 = __local_57; i32::fmt_decimal(219, __local_157); - String::append(__local_56, String { repr: array.new_data(" + String::push_str(__local_56, String { repr: array.new_data(" condition: struct_in_match(0) == 3 "), used: 36 }); - String::append(__local_56, String { repr: array.new_data("struct_in_match(0): "), used: 20 }); + String::push_str(__local_56, String { repr: array.new_data("struct_in_match(0): "), used: 20 }); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_162 = __local_57; i32::fmt_decimal(__v0_12, __local_162); - String::append_char(__local_56, 10); + String::push(__local_56, 10); break __tmpl: __local_56; }); unreachable; @@ -734,27 +734,27 @@ condition: struct_in_match(0) == 3 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_58 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_58, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_58, 114); - String::append_char(__local_58, 117); - String::append_char(__local_58, 110); - String::append_char(__local_58, 32); - String::append_char(__local_58, 97); - String::append_char(__local_58, 116); - String::append_char(__local_58, 32); - String::append(__local_58, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_58, 58); + String::push_str(__local_58, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_58, 114); + String::push(__local_58, 117); + String::push(__local_58, 110); + String::push(__local_58, 32); + String::push(__local_58, 97); + String::push(__local_58, 116); + String::push(__local_58, 32); + String::push_str(__local_58, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_58, 58); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; __local_168 = __local_59; i32::fmt_decimal(220, __local_168); - String::append(__local_58, String { repr: array.new_data(" + String::push_str(__local_58, String { repr: array.new_data(" condition: struct_in_match(1) == 30 "), used: 37 }); - String::append(__local_58, String { repr: array.new_data("struct_in_match(1): "), used: 20 }); + String::push_str(__local_58, String { repr: array.new_data("struct_in_match(1): "), used: 20 }); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; __local_173 = __local_59; i32::fmt_decimal(__v0_14, __local_173); - String::append_char(__local_58, 10); + String::push(__local_58, 10); break __tmpl: __local_58; }); unreachable; @@ -764,27 +764,27 @@ condition: struct_in_match(1) == 30 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_60 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_60, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_60, 114); - String::append_char(__local_60, 117); - String::append_char(__local_60, 110); - String::append_char(__local_60, 32); - String::append_char(__local_60, 97); - String::append_char(__local_60, 116); - String::append_char(__local_60, 32); - String::append(__local_60, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_60, 58); + String::push_str(__local_60, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_60, 114); + String::push(__local_60, 117); + String::push(__local_60, 110); + String::push(__local_60, 32); + String::push(__local_60, 97); + String::push(__local_60, 116); + String::push(__local_60, 32); + String::push_str(__local_60, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_60, 58); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; __local_179 = __local_61; i32::fmt_decimal(221, __local_179); - String::append(__local_60, String { repr: array.new_data(" + String::push_str(__local_60, String { repr: array.new_data(" condition: struct_in_match(2) == 300 "), used: 38 }); - String::append(__local_60, String { repr: array.new_data("struct_in_match(2): "), used: 20 }); + String::push_str(__local_60, String { repr: array.new_data("struct_in_match(2): "), used: 20 }); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; __local_184 = __local_61; i32::fmt_decimal(__v0_16, __local_184); - String::append_char(__local_60, 10); + String::push(__local_60, 10); break __tmpl: __local_60; }); unreachable; @@ -794,27 +794,27 @@ condition: struct_in_match(2) == 300 if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_62 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_62, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_62, 114); - String::append_char(__local_62, 117); - String::append_char(__local_62, 110); - String::append_char(__local_62, 32); - String::append_char(__local_62, 97); - String::append_char(__local_62, 116); - String::append_char(__local_62, 32); - String::append(__local_62, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_62, 58); + String::push_str(__local_62, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_62, 114); + String::push(__local_62, 117); + String::push(__local_62, 110); + String::push(__local_62, 32); + String::push(__local_62, 97); + String::push(__local_62, 116); + String::push(__local_62, 32); + String::push_str(__local_62, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_62, 58); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; __local_190 = __local_63; i32::fmt_decimal(222, __local_190); - String::append(__local_62, String { repr: array.new_data(" + String::push_str(__local_62, String { repr: array.new_data(" condition: fields_as_args() == 30 "), used: 35 }); - String::append(__local_62, String { repr: array.new_data("fields_as_args(): "), used: 18 }); + String::push_str(__local_62, String { repr: array.new_data("fields_as_args(): "), used: 18 }); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; __local_195 = __local_63; i32::fmt_decimal(__v0_18, __local_195); - String::append_char(__local_62, 10); + String::push(__local_62, 10); break __tmpl: __local_62; }); unreachable; @@ -824,27 +824,27 @@ condition: fields_as_args() == 30 if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_64 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_64, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_64, 114); - String::append_char(__local_64, 117); - String::append_char(__local_64, 110); - String::append_char(__local_64, 32); - String::append_char(__local_64, 97); - String::append_char(__local_64, 116); - String::append_char(__local_64, 32); - String::append(__local_64, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_64, 58); + String::push_str(__local_64, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_64, 114); + String::push(__local_64, 117); + String::push(__local_64, 110); + String::push(__local_64, 32); + String::push(__local_64, 97); + String::push(__local_64, 116); + String::push(__local_64, 32); + String::push_str(__local_64, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_64, 58); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; __local_201 = __local_65; i32::fmt_decimal(223, __local_201); - String::append(__local_64, String { repr: array.new_data(" + String::push_str(__local_64, String { repr: array.new_data(" condition: nested_field_access() == 115 "), used: 41 }); - String::append(__local_64, String { repr: array.new_data("nested_field_access(): "), used: 23 }); + String::push_str(__local_64, String { repr: array.new_data("nested_field_access(): "), used: 23 }); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; __local_206 = __local_65; i32::fmt_decimal(__v0_20, __local_206); - String::append_char(__local_64, 10); + String::push(__local_64, 10); break __tmpl: __local_64; }); unreachable; @@ -854,27 +854,27 @@ condition: nested_field_access() == 115 if __cond_23 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_66 = String { repr: builtin::array_new(155), used: 0 }; - String::append(__local_66, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_66, 114); - String::append_char(__local_66, 117); - String::append_char(__local_66, 110); - String::append_char(__local_66, 32); - String::append_char(__local_66, 97); - String::append_char(__local_66, 116); - String::append_char(__local_66, 32); - String::append(__local_66, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_66, 58); + String::push_str(__local_66, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_66, 114); + String::push(__local_66, 117); + String::push(__local_66, 110); + String::push(__local_66, 32); + String::push(__local_66, 97); + String::push(__local_66, 116); + String::push(__local_66, 32); + String::push_str(__local_66, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_66, 58); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; __local_212 = __local_67; i32::fmt_decimal(224, __local_212); - String::append(__local_66, String { repr: array.new_data(" + String::push_str(__local_66, String { repr: array.new_data(" condition: single_field_wrapper() == 42 "), used: 41 }); - String::append(__local_66, String { repr: array.new_data("single_field_wrapper(): "), used: 24 }); + String::push_str(__local_66, String { repr: array.new_data("single_field_wrapper(): "), used: 24 }); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; __local_217 = __local_67; i32::fmt_decimal(__v0_22, __local_217); - String::append_char(__local_66, 10); + String::push(__local_66, 10); break __tmpl: __local_66; }); unreachable; @@ -884,27 +884,27 @@ condition: single_field_wrapper() == 42 if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_68 = String { repr: builtin::array_new(173), used: 0 }; - String::append(__local_68, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_68, 114); - String::append_char(__local_68, 117); - String::append_char(__local_68, 110); - String::append_char(__local_68, 32); - String::append_char(__local_68, 97); - String::append_char(__local_68, 116); - String::append_char(__local_68, 32); - String::append(__local_68, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_68, 58); + String::push_str(__local_68, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_68, 114); + String::push(__local_68, 117); + String::push(__local_68, 110); + String::push(__local_68, 32); + String::push(__local_68, 97); + String::push(__local_68, 116); + String::push(__local_68, 32); + String::push_str(__local_68, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_68, 58); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; __local_223 = __local_69; i32::fmt_decimal(225, __local_223); - String::append(__local_68, String { repr: array.new_data(" + String::push_str(__local_68, String { repr: array.new_data(" condition: dependent_field_construction(5) == 21 "), used: 50 }); - String::append(__local_68, String { repr: array.new_data("dependent_field_construction(5): "), used: 33 }); + String::push_str(__local_68, String { repr: array.new_data("dependent_field_construction(5): "), used: 33 }); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; __local_228 = __local_69; i32::fmt_decimal(__v0_24, __local_228); - String::append_char(__local_68, 10); + String::push(__local_68, 10); break __tmpl: __local_68; }); unreachable; @@ -914,27 +914,27 @@ condition: dependent_field_construction(5) == 21 if __cond_27 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_70 = String { repr: builtin::array_new(169), used: 0 }; - String::append(__local_70, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_70, 114); - String::append_char(__local_70, 117); - String::append_char(__local_70, 110); - String::append_char(__local_70, 32); - String::append_char(__local_70, 97); - String::append_char(__local_70, 116); - String::append_char(__local_70, 32); - String::append(__local_70, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_70, 58); + String::push_str(__local_70, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_70, 114); + String::push(__local_70, 117); + String::push(__local_70, 110); + String::push(__local_70, 32); + String::push(__local_70, 97); + String::push(__local_70, 116); + String::push(__local_70, 32); + String::push_str(__local_70, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_70, 58); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; __local_234 = __local_71; i32::fmt_decimal(226, __local_234); - String::append(__local_70, String { repr: array.new_data(" + String::push_str(__local_70, String { repr: array.new_data(" condition: struct_from_conditional(true) == 30 "), used: 48 }); - String::append(__local_70, String { repr: array.new_data("struct_from_conditional(true): "), used: 31 }); + String::push_str(__local_70, String { repr: array.new_data("struct_from_conditional(true): "), used: 31 }); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; __local_239 = __local_71; i32::fmt_decimal(__v0_26, __local_239); - String::append_char(__local_70, 10); + String::push(__local_70, 10); break __tmpl: __local_70; }); unreachable; @@ -944,27 +944,27 @@ condition: struct_from_conditional(true) == 30 if __cond_29 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_72 = String { repr: builtin::array_new(171), used: 0 }; - String::append(__local_72, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_72, 114); - String::append_char(__local_72, 117); - String::append_char(__local_72, 110); - String::append_char(__local_72, 32); - String::append_char(__local_72, 97); - String::append_char(__local_72, 116); - String::append_char(__local_72, 32); - String::append(__local_72, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_72, 58); + String::push_str(__local_72, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_72, 114); + String::push(__local_72, 117); + String::push(__local_72, 110); + String::push(__local_72, 32); + String::push(__local_72, 97); + String::push(__local_72, 116); + String::push(__local_72, 32); + String::push_str(__local_72, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_72, 58); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; __local_245 = __local_73; i32::fmt_decimal(227, __local_245); - String::append(__local_72, String { repr: array.new_data(" + String::push_str(__local_72, String { repr: array.new_data(" condition: struct_from_conditional(false) == 70 "), used: 49 }); - String::append(__local_72, String { repr: array.new_data("struct_from_conditional(false): "), used: 32 }); + String::push_str(__local_72, String { repr: array.new_data("struct_from_conditional(false): "), used: 32 }); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; __local_250 = __local_73; i32::fmt_decimal(__v0_28, __local_250); - String::append_char(__local_72, 10); + String::push(__local_72, 10); break __tmpl: __local_72; }); unreachable; @@ -974,27 +974,27 @@ condition: struct_from_conditional(false) == 70 if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_74 = String { repr: builtin::array_new(153), used: 0 }; - String::append(__local_74, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_74, 114); - String::append_char(__local_74, 117); - String::append_char(__local_74, 110); - String::append_char(__local_74, 32); - String::append_char(__local_74, 97); - String::append_char(__local_74, 116); - String::append_char(__local_74, 32); - String::append(__local_74, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_74, 58); + String::push_str(__local_74, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_74, 114); + String::push(__local_74, 117); + String::push(__local_74, 110); + String::push(__local_74, 32); + String::push(__local_74, 97); + String::push(__local_74, 116); + String::push(__local_74, 32); + String::push_str(__local_74, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_74, 58); __local_75 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_74 }; __local_256 = __local_75; i32::fmt_decimal(228, __local_256); - String::append(__local_74, String { repr: array.new_data(" + String::push_str(__local_74, String { repr: array.new_data(" condition: struct_reassignment() == 33 "), used: 40 }); - String::append(__local_74, String { repr: array.new_data("struct_reassignment(): "), used: 23 }); + String::push_str(__local_74, String { repr: array.new_data("struct_reassignment(): "), used: 23 }); __local_75 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_74 }; __local_261 = __local_75; i32::fmt_decimal(__v0_30, __local_261); - String::append_char(__local_74, 10); + String::push(__local_74, 10); break __tmpl: __local_74; }); unreachable; @@ -1004,27 +1004,27 @@ condition: struct_reassignment() == 33 if __cond_33 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_76 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_76, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_76, 114); - String::append_char(__local_76, 117); - String::append_char(__local_76, 110); - String::append_char(__local_76, 32); - String::append_char(__local_76, 97); - String::append_char(__local_76, 116); - String::append_char(__local_76, 32); - String::append(__local_76, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_76, 58); + String::push_str(__local_76, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_76, 114); + String::push(__local_76, 117); + String::push(__local_76, 110); + String::push(__local_76, 32); + String::push(__local_76, 97); + String::push(__local_76, 116); + String::push(__local_76, 32); + String::push_str(__local_76, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_76, 58); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_76 }; __local_267 = __local_77; i32::fmt_decimal(229, __local_267); - String::append(__local_76, String { repr: array.new_data(" + String::push_str(__local_76, String { repr: array.new_data(" condition: same_value_fields() == 84 "), used: 38 }); - String::append(__local_76, String { repr: array.new_data("same_value_fields(): "), used: 21 }); + String::push_str(__local_76, String { repr: array.new_data("same_value_fields(): "), used: 21 }); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_76 }; __local_272 = __local_77; i32::fmt_decimal(__v0_32, __local_272); - String::append_char(__local_76, 10); + String::push(__local_76, 10); break __tmpl: __local_76; }); unreachable; @@ -1034,27 +1034,27 @@ condition: same_value_fields() == 84 if __cond_35 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_78 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_78, 114); - String::append_char(__local_78, 117); - String::append_char(__local_78, 110); - String::append_char(__local_78, 32); - String::append_char(__local_78, 97); - String::append_char(__local_78, 116); - String::append_char(__local_78, 32); - String::append(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_78, 58); + String::push_str(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_78, 114); + String::push(__local_78, 117); + String::push(__local_78, 110); + String::push(__local_78, 32); + String::push(__local_78, 97); + String::push(__local_78, 116); + String::push(__local_78, 32); + String::push_str(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_78, 58); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; __local_278 = __local_79; i32::fmt_decimal(230, __local_278); - String::append(__local_78, String { repr: array.new_data(" + String::push_str(__local_78, String { repr: array.new_data(" condition: deep_nesting() == 25 "), used: 33 }); - String::append(__local_78, String { repr: array.new_data("deep_nesting(): "), used: 16 }); + String::push_str(__local_78, String { repr: array.new_data("deep_nesting(): "), used: 16 }); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; __local_283 = __local_79; i32::fmt_decimal(__v0_34, __local_283); - String::append_char(__local_78, 10); + String::push(__local_78, 10); break __tmpl: __local_78; }); unreachable; @@ -1064,27 +1064,27 @@ condition: deep_nesting() == 25 if __cond_37 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_80 = String { repr: builtin::array_new(151), used: 0 }; - String::append(__local_80, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_80, 114); - String::append_char(__local_80, 117); - String::append_char(__local_80, 110); - String::append_char(__local_80, 32); - String::append_char(__local_80, 97); - String::append_char(__local_80, 116); - String::append_char(__local_80, 32); - String::append(__local_80, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_80, 58); + String::push_str(__local_80, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_80, 114); + String::push(__local_80, 117); + String::push(__local_80, 110); + String::push(__local_80, 32); + String::push(__local_80, 97); + String::push(__local_80, 116); + String::push(__local_80, 32); + String::push_str(__local_80, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_80, 58); __local_81 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_80 }; __local_289 = __local_81; i32::fmt_decimal(231, __local_289); - String::append(__local_80, String { repr: array.new_data(" + String::push_str(__local_80, String { repr: array.new_data(" condition: float_wrapper_ops() == 6.28 "), used: 40 }); - String::append(__local_80, String { repr: array.new_data("float_wrapper_ops(): "), used: 21 }); + String::push_str(__local_80, String { repr: array.new_data("float_wrapper_ops(): "), used: 21 }); __local_81 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_80 }; __local_294 = __local_81; f64::inspect_into(__v0_36, __local_294); - String::append_char(__local_80, 10); + String::push(__local_80, 10); break __tmpl: __local_80; }); unreachable; @@ -1094,27 +1094,27 @@ condition: float_wrapper_ops() == 6.28 if __cond_39 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_82 = String { repr: builtin::array_new(153), used: 0 }; - String::append(__local_82, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_82, 114); - String::append_char(__local_82, 117); - String::append_char(__local_82, 110); - String::append_char(__local_82, 32); - String::append_char(__local_82, 97); - String::append_char(__local_82, 116); - String::append_char(__local_82, 32); - String::append(__local_82, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_82, 58); + String::push_str(__local_82, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_82, 114); + String::push(__local_82, 117); + String::push(__local_82, 110); + String::push(__local_82, 32); + String::push(__local_82, 97); + String::push(__local_82, 116); + String::push(__local_82, 32); + String::push_str(__local_82, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_82, 58); __local_83 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_82 }; __local_298 = __local_83; i32::fmt_decimal(232, __local_298); - String::append(__local_82, String { repr: array.new_data(" + String::push_str(__local_82, String { repr: array.new_data(" condition: field_as_loop_bound() == 10 "), used: 40 }); - String::append(__local_82, String { repr: array.new_data("field_as_loop_bound(): "), used: 23 }); + String::push_str(__local_82, String { repr: array.new_data("field_as_loop_bound(): "), used: 23 }); __local_83 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_82 }; __local_303 = __local_83; i32::fmt_decimal(__v0_38, __local_303); - String::append_char(__local_82, 10); + String::push(__local_82, 10); break __tmpl: __local_82; }); unreachable; @@ -1124,27 +1124,27 @@ condition: field_as_loop_bound() == 10 if __cond_41 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_84 = String { repr: builtin::array_new(163), used: 0 }; - String::append(__local_84, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_84, 114); - String::append_char(__local_84, 117); - String::append_char(__local_84, 110); - String::append_char(__local_84, 32); - String::append_char(__local_84, 97); - String::append_char(__local_84, 116); - String::append_char(__local_84, 32); - String::append(__local_84, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_84, 58); + String::push_str(__local_84, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_84, 114); + String::push(__local_84, 117); + String::push(__local_84, 110); + String::push(__local_84, 32); + String::push(__local_84, 97); + String::push(__local_84, 116); + String::push(__local_84, 32); + String::push_str(__local_84, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_84, 58); __local_85 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_84 }; __local_309 = __local_85; i32::fmt_decimal(233, __local_309); - String::append(__local_84, String { repr: array.new_data(" + String::push_str(__local_84, String { repr: array.new_data(" condition: struct_to_multiple_calls() == 31 "), used: 45 }); - String::append(__local_84, String { repr: array.new_data("struct_to_multiple_calls(): "), used: 28 }); + String::push_str(__local_84, String { repr: array.new_data("struct_to_multiple_calls(): "), used: 28 }); __local_85 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_84 }; __local_314 = __local_85; i32::fmt_decimal(__v0_40, __local_314); - String::append_char(__local_84, 10); + String::push(__local_84, 10); break __tmpl: __local_84; }); unreachable; @@ -1154,27 +1154,27 @@ condition: struct_to_multiple_calls() == 31 if __cond_43 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_86 = String { repr: builtin::array_new(165), used: 0 }; - String::append(__local_86, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_86, 114); - String::append_char(__local_86, 117); - String::append_char(__local_86, 110); - String::append_char(__local_86, 32); - String::append_char(__local_86, 97); - String::append_char(__local_86, 116); - String::append_char(__local_86, 32); - String::append(__local_86, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); - String::append_char(__local_86, 58); + String::push_str(__local_86, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_86, 114); + String::push(__local_86, 117); + String::push(__local_86, 110); + String::push(__local_86, 32); + String::push(__local_86, 97); + String::push(__local_86, 116); + String::push(__local_86, 32); + String::push_str(__local_86, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_edge_cases.wado"), used: 53 }); + String::push(__local_86, 58); __local_87 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_86 }; __local_320 = __local_87; i32::fmt_decimal(234, __local_320); - String::append(__local_86, String { repr: array.new_data(" + String::push_str(__local_86, String { repr: array.new_data(" condition: immediate_field_of_return() == 50 "), used: 46 }); - String::append(__local_86, String { repr: array.new_data("immediate_field_of_return(): "), used: 29 }); + String::push_str(__local_86, String { repr: array.new_data("immediate_field_of_return(): "), used: 29 }); __local_87 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_86 }; __local_325 = __local_87; i32::fmt_decimal(__v0_42, __local_325); - String::append_char(__local_86, 10); + String::push(__local_86, 10); break __tmpl: __local_86; }); unreachable; @@ -1906,8 +1906,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1962,13 +1962,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1976,25 +1976,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -2002,7 +2002,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -2044,8 +2044,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2077,7 +2077,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -2206,27 +2206,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2349,9 +2349,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2361,8 +2361,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2417,13 +2417,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2458,9 +2458,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2513,7 +2513,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2528,7 +2528,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2566,7 +2566,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l193; }; @@ -2724,20 +2724,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2747,10 +2747,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2760,10 +2760,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2771,10 +2771,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_intraprocedural.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_intraprocedural.wir.wado index e0c45bec8..edfaa18c1 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_intraprocedural.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_intraprocedural.wir.wado @@ -85,9 +85,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -209,27 +209,27 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_17, 114); - String::append_char(__local_17, 117); - String::append_char(__local_17, 110); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_17, 114); + String::push(__local_17, 117); + String::push(__local_17, 110); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_35 = __local_18; i32::fmt_decimal(95, __local_35); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: basic_sroa() == 30 "), used: 31 }); - String::append(__local_17, String { repr: array.new_data("basic_sroa(): "), used: 14 }); + String::push_str(__local_17, String { repr: array.new_data("basic_sroa(): "), used: 14 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_40 = __local_18; i32::fmt_decimal(__v0_0, __local_40); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -239,27 +239,27 @@ condition: basic_sroa() == 30 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 114); - String::append_char(__local_19, 117); - String::append_char(__local_19, 110); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 114); + String::push(__local_19, 117); + String::push(__local_19, 110); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_46 = __local_20; i32::fmt_decimal(96, __local_46); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: mutable_field_write() == 100 "), used: 41 }); - String::append(__local_19, String { repr: array.new_data("mutable_field_write(): "), used: 23 }); + String::push_str(__local_19, String { repr: array.new_data("mutable_field_write(): "), used: 23 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_51 = __local_20; i32::fmt_decimal(__v0_2, __local_51); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -269,27 +269,27 @@ condition: mutable_field_write() == 100 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 114); - String::append_char(__local_21, 117); - String::append_char(__local_21, 110); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 114); + String::push(__local_21, 117); + String::push(__local_21, 110); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_57 = __local_22; i32::fmt_decimal(97, __local_57); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: partial_escape(50) == 150 "), used: 38 }); - String::append(__local_21, String { repr: array.new_data("partial_escape(50): "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("partial_escape(50): "), used: 20 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_62 = __local_22; i32::fmt_decimal(__v0_4, __local_62); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -299,27 +299,27 @@ condition: partial_escape(50) == 150 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_23, 114); - String::append_char(__local_23, 117); - String::append_char(__local_23, 110); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_23, 114); + String::push(__local_23, 117); + String::push(__local_23, 110); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_68 = __local_24; i32::fmt_decimal(98, __local_68); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: nested_struct() == 33 "), used: 34 }); - String::append(__local_23, String { repr: array.new_data("nested_struct(): "), used: 17 }); + String::push_str(__local_23, String { repr: array.new_data("nested_struct(): "), used: 17 }); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_73 = __local_24; i32::fmt_decimal(__v0_6, __local_73); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -329,27 +329,27 @@ condition: nested_struct() == 33 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_25, 114); - String::append_char(__local_25, 117); - String::append_char(__local_25, 110); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_25, 114); + String::push(__local_25, 117); + String::push(__local_25, 110); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_79 = __local_26; i32::fmt_decimal(99, __local_79); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: multiple_structs() == 10 "), used: 37 }); - String::append(__local_25, String { repr: array.new_data("multiple_structs(): "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("multiple_structs(): "), used: 20 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_84 = __local_26; i32::fmt_decimal(__v0_8, __local_84); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -359,27 +359,27 @@ condition: multiple_structs() == 10 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_27, 114); - String::append_char(__local_27, 117); - String::append_char(__local_27, 110); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_27, 114); + String::push(__local_27, 117); + String::push(__local_27, 110); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_90 = __local_28; i32::fmt_decimal(100, __local_90); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: use_then_pass() == 60 "), used: 34 }); - String::append(__local_27, String { repr: array.new_data("use_then_pass(): "), used: 17 }); + String::push_str(__local_27, String { repr: array.new_data("use_then_pass(): "), used: 17 }); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_95 = __local_28; i32::fmt_decimal(__v0_10, __local_95); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -392,37 +392,37 @@ condition: use_then_pass() == 60 if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(197), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_29, 114); - String::append_char(__local_29, 117); - String::append_char(__local_29, 110); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_29, 114); + String::push(__local_29, 117); + String::push(__local_29, 110); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_intraprocedural.wado"), used: 58 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_101 = __local_30; i32::fmt_decimal(102, __local_101); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: built.x + built.y == 20 "), used: 36 }); - String::append(__local_29, String { repr: array.new_data("built.x: "), used: 9 }); + String::push_str(__local_29, String { repr: array.new_data("built.x: "), used: 9 }); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_106 = __local_30; i32::fmt_decimal(__v0_13, __local_106); - String::append_char(__local_29, 10); - String::append(__local_29, String { repr: array.new_data("built.y: "), used: 9 }); + String::push(__local_29, 10); + String::push_str(__local_29, String { repr: array.new_data("built.y: "), used: 9 }); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_111 = __local_30; i32::fmt_decimal(__v1, __local_111); - String::append_char(__local_29, 10); - String::append(__local_29, String { repr: array.new_data("built.x + built.y: "), used: 19 }); + String::push(__local_29, 10); + String::push_str(__local_29, String { repr: array.new_data("built.x + built.y: "), used: 19 }); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_116 = __local_30; i32::fmt_decimal(__v2, __local_116); - String::append_char(__local_29, 10); + String::push(__local_29, 10); break __tmpl: __local_29; }); unreachable; @@ -625,7 +625,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -640,7 +640,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -678,7 +678,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l30; }; @@ -712,20 +712,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -735,10 +735,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -748,10 +748,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -759,10 +759,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_newtype_param.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_newtype_param.wir.wado index 99c58f9d4..4d76b5f9c 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_newtype_param.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_newtype_param.wir.wado @@ -99,7 +99,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -109,9 +109,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -296,27 +296,27 @@ fn run() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_32, 114); - String::append_char(__local_32, 117); - String::append_char(__local_32, 110); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_32, 114); + String::push(__local_32, 117); + String::push(__local_32, 110); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_53 = __local_33; i32::fmt_decimal(83, __local_53); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: m.raw() == 42.5 "), used: 28 }); - String::append(__local_32, String { repr: array.new_data("m.raw(): "), used: 9 }); + String::push_str(__local_32, String { repr: array.new_data("m.raw(): "), used: 9 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_58 = __local_33; f64::inspect_into(__v0_1, __local_58); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -326,27 +326,27 @@ condition: m.raw() == 42.5 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_34, 114); - String::append_char(__local_34, 117); - String::append_char(__local_34, 110); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_34, 114); + String::push(__local_34, 117); + String::push(__local_34, 110); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_62 = __local_35; i32::fmt_decimal(86, __local_62); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: c.raw() == 10 "), used: 26 }); - String::append(__local_34, String { repr: array.new_data("c.raw(): "), used: 9 }); + String::push_str(__local_34, String { repr: array.new_data("c.raw(): "), used: 9 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_67 = __local_35; i32::fmt_decimal(__v0_4, __local_67); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -357,27 +357,27 @@ condition: c.raw() == 10 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_36, 114); - String::append_char(__local_36, 117); - String::append_char(__local_36, 110); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_36, 114); + String::push(__local_36, 117); + String::push(__local_36, 110); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_73 = __local_37; i32::fmt_decimal(90, __local_73); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: c2.raw() == 11 "), used: 27 }); - String::append(__local_36, String { repr: array.new_data("c2.raw(): "), used: 10 }); + String::push_str(__local_36, String { repr: array.new_data("c2.raw(): "), used: 10 }); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_78 = __local_37; i32::fmt_decimal(__v0_7, __local_78); - String::append_char(__local_36, 10); + String::push(__local_36, 10); break __tmpl: __local_36; }); unreachable; @@ -387,27 +387,27 @@ condition: c2.raw() == 11 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(151), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_38, 114); - String::append_char(__local_38, 117); - String::append_char(__local_38, 110); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_38, 114); + String::push(__local_38, 117); + String::push(__local_38, 110); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_84 = __local_39; i32::fmt_decimal(95, __local_84); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: speed(&dist, &time) == 20.0 "), used: 40 }); - String::append(__local_38, String { repr: array.new_data("speed(&dist, &time): "), used: 21 }); + String::push_str(__local_38, String { repr: array.new_data("speed(&dist, &time): "), used: 21 }); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_89 = __local_39; f64::inspect_into(__v0_11, __local_89); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; @@ -419,27 +419,27 @@ condition: speed(&dist, &time) == 20.0 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_40, 114); - String::append_char(__local_40, 117); - String::append_char(__local_40, 110); - String::append_char(__local_40, 32); - String::append_char(__local_40, 97); - String::append_char(__local_40, 116); - String::append_char(__local_40, 32); - String::append(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); - String::append_char(__local_40, 58); + String::push_str(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_40, 114); + String::push(__local_40, 117); + String::push(__local_40, 110); + String::push(__local_40, 32); + String::push(__local_40, 97); + String::push(__local_40, 116); + String::push(__local_40, 32); + String::push_str(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); + String::push(__local_40, 58); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_93 = __local_41; i32::fmt_decimal(101, __local_93); - String::append(__local_40, String { repr: array.new_data(" + String::push_str(__local_40, String { repr: array.new_data(" condition: m3.raw() == 42.5 "), used: 29 }); - String::append(__local_40, String { repr: array.new_data("m3.raw(): "), used: 10 }); + String::push_str(__local_40, String { repr: array.new_data("m3.raw(): "), used: 10 }); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_98 = __local_41; f64::inspect_into(__v0_16, __local_98); - String::append_char(__local_40, 10); + String::push(__local_40, 10); break __tmpl: __local_40; }); unreachable; @@ -450,27 +450,27 @@ condition: m3.raw() == 42.5 if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_42, 114); - String::append_char(__local_42, 117); - String::append_char(__local_42, 110); - String::append_char(__local_42, 32); - String::append_char(__local_42, 97); - String::append_char(__local_42, 116); - String::append_char(__local_42, 32); - String::append(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); - String::append_char(__local_42, 58); + String::push_str(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_42, 114); + String::push(__local_42, 117); + String::push(__local_42, 110); + String::push(__local_42, 32); + String::push(__local_42, 97); + String::push(__local_42, 116); + String::push(__local_42, 32); + String::push_str(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); + String::push(__local_42, 58); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_102 = __local_43; i32::fmt_decimal(106, __local_102); - String::append(__local_42, String { repr: array.new_data(" + String::push_str(__local_42, String { repr: array.new_data(" condition: pos.raw() == 5.0 "), used: 29 }); - String::append(__local_42, String { repr: array.new_data("pos.raw(): "), used: 11 }); + String::push_str(__local_42, String { repr: array.new_data("pos.raw(): "), used: 11 }); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_107 = __local_43; f64::inspect_into(__v0_20, __local_107); - String::append_char(__local_42, 10); + String::push(__local_42, 10); break __tmpl: __local_42; }); unreachable; @@ -481,27 +481,27 @@ condition: pos.raw() == 5.0 if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_44, 114); - String::append_char(__local_44, 117); - String::append_char(__local_44, 110); - String::append_char(__local_44, 32); - String::append_char(__local_44, 97); - String::append_char(__local_44, 116); - String::append_char(__local_44, 32); - String::append(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); - String::append_char(__local_44, 58); + String::push_str(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_44, 114); + String::push(__local_44, 117); + String::push(__local_44, 110); + String::push(__local_44, 32); + String::push(__local_44, 97); + String::push(__local_44, 116); + String::push(__local_44, 32); + String::push_str(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); + String::push(__local_44, 58); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_111 = __local_45; i32::fmt_decimal(110, __local_111); - String::append(__local_44, String { repr: array.new_data(" + String::push_str(__local_44, String { repr: array.new_data(" condition: still_pos.raw() == 3.0 "), used: 35 }); - String::append(__local_44, String { repr: array.new_data("still_pos.raw(): "), used: 17 }); + String::push_str(__local_44, String { repr: array.new_data("still_pos.raw(): "), used: 17 }); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_116 = __local_45; f64::inspect_into(__v0_24, __local_116); - String::append_char(__local_44, 10); + String::push(__local_44, 10); break __tmpl: __local_44; }); unreachable; @@ -512,27 +512,27 @@ condition: still_pos.raw() == 3.0 if __cond_28 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_46 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_46, 114); - String::append_char(__local_46, 117); - String::append_char(__local_46, 110); - String::append_char(__local_46, 32); - String::append_char(__local_46, 97); - String::append_char(__local_46, 116); - String::append_char(__local_46, 32); - String::append(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); - String::append_char(__local_46, 58); + String::push_str(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_46, 114); + String::push(__local_46, 117); + String::push(__local_46, 110); + String::push(__local_46, 32); + String::push(__local_46, 97); + String::push(__local_46, 116); + String::push(__local_46, 32); + String::push_str(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); + String::push(__local_46, 58); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_120 = __local_47; i32::fmt_decimal(114, __local_120); - String::append(__local_46, String { repr: array.new_data(" + String::push_str(__local_46, String { repr: array.new_data(" condition: total.raw() == 5 "), used: 29 }); - String::append(__local_46, String { repr: array.new_data("total.raw(): "), used: 13 }); + String::push_str(__local_46, String { repr: array.new_data("total.raw(): "), used: 13 }); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_125 = __local_47; i32::fmt_decimal(__v0_27, __local_125); - String::append_char(__local_46, 10); + String::push(__local_46, 10); break __tmpl: __local_46; }); unreachable; @@ -542,27 +542,27 @@ condition: total.raw() == 5 if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_48 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_48, 114); - String::append_char(__local_48, 117); - String::append_char(__local_48, 110); - String::append_char(__local_48, 32); - String::append_char(__local_48, 97); - String::append_char(__local_48, 116); - String::append_char(__local_48, 32); - String::append(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); - String::append_char(__local_48, 58); + String::push_str(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_48, 114); + String::push(__local_48, 117); + String::push(__local_48, 110); + String::push(__local_48, 32); + String::push(__local_48, 97); + String::push(__local_48, 116); + String::push(__local_48, 32); + String::push_str(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_newtype_param.wado"), used: 56 }); + String::push(__local_48, 58); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_131 = __local_49; i32::fmt_decimal(118, __local_131); - String::append(__local_48, String { repr: array.new_data(" + String::push_str(__local_48, String { repr: array.new_data(" condition: triple_inc(&start).raw() == 3 "), used: 42 }); - String::append(__local_48, String { repr: array.new_data("triple_inc(&start).raw(): "), used: 26 }); + String::push_str(__local_48, String { repr: array.new_data("triple_inc(&start).raw(): "), used: 26 }); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_136 = __local_49; i32::fmt_decimal(__v0_30, __local_136); - String::append_char(__local_48, 10); + String::push(__local_48, 10); break __tmpl: __local_48; }); unreachable; @@ -1331,8 +1331,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1387,13 +1387,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1401,25 +1401,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1427,7 +1427,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1469,8 +1469,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1502,7 +1502,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1631,27 +1631,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1774,9 +1774,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1786,8 +1786,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1842,13 +1842,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1883,9 +1883,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1938,7 +1938,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1953,7 +1953,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2011,7 +2011,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l175; }; @@ -2169,20 +2169,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2192,10 +2192,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2205,10 +2205,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2216,10 +2216,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_return_match.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_return_match.wir.wado index 00fa8fa91..1e02dee42 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_return_match.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_return_match.wir.wado @@ -73,9 +73,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -214,27 +214,27 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_32 = __local_15; i32::fmt_decimal(61, __local_32); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: use_small_match(0) == 30 "), used: 37 }); - String::append(__local_14, String { repr: array.new_data("use_small_match(0): "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("use_small_match(0): "), used: 20 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_37 = __local_15; i32::fmt_decimal(__v0_0, __local_37); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -244,27 +244,27 @@ condition: use_small_match(0) == 30 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_43 = __local_17; i32::fmt_decimal(62, __local_43); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: use_small_match(1) == 70 "), used: 37 }); - String::append(__local_16, String { repr: array.new_data("use_small_match(1): "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("use_small_match(1): "), used: 20 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_48 = __local_17; i32::fmt_decimal(__v0_2, __local_48); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -274,27 +274,27 @@ condition: use_small_match(1) == 70 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_54 = __local_19; i32::fmt_decimal(63, __local_54); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: use_small_match(2) == 110 "), used: 38 }); - String::append(__local_18, String { repr: array.new_data("use_small_match(2): "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("use_small_match(2): "), used: 20 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_59 = __local_19; i32::fmt_decimal(__v0_4, __local_59); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -304,27 +304,27 @@ condition: use_small_match(2) == 110 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_65 = __local_21; i32::fmt_decimal(66, __local_65); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: use_large_match(0) == 300 "), used: 38 }); - String::append(__local_20, String { repr: array.new_data("use_large_match(0): "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("use_large_match(0): "), used: 20 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_70 = __local_21; u64::fmt_decimal(__v0_6, __local_70); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -334,27 +334,27 @@ condition: use_large_match(0) == 300 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_76 = __local_23; i32::fmt_decimal(67, __local_76); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: use_large_match(5) == 2300 "), used: 39 }); - String::append(__local_22, String { repr: array.new_data("use_large_match(5): "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("use_large_match(5): "), used: 20 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_81 = __local_23; u64::fmt_decimal(__v0_8, __local_81); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -364,27 +364,27 @@ condition: use_large_match(5) == 2300 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_87 = __local_25; i32::fmt_decimal(68, __local_87); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: use_large_match(9) == 3900 "), used: 39 }); - String::append(__local_24, String { repr: array.new_data("use_large_match(9): "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("use_large_match(9): "), used: 20 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_92 = __local_25; u64::fmt_decimal(__v0_10, __local_92); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -394,27 +394,27 @@ condition: use_large_match(9) == 3900 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_26, 114); - String::append_char(__local_26, 117); - String::append_char(__local_26, 110); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_26, 114); + String::push(__local_26, 117); + String::push(__local_26, 110); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_return_match.wado"), used: 55 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_98 = __local_27; i32::fmt_decimal(69, __local_98); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: use_large_match(99) == 0 "), used: 37 }); - String::append(__local_26, String { repr: array.new_data("use_large_match(99): "), used: 21 }); + String::push_str(__local_26, String { repr: array.new_data("use_large_match(99): "), used: 21 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_103 = __local_27; u64::fmt_decimal(__v0_12, __local_103); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -706,7 +706,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -721,7 +721,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -759,7 +759,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l56; }; @@ -793,20 +793,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -816,10 +816,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -829,10 +829,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -840,10 +840,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_single_field.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_single_field.wir.wado index b9befbe71..af6ee60bc 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_single_field.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_single_field.wir.wado @@ -107,7 +107,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -117,13 +117,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Wrapper::set" = fn(ref Wrapper, i32); @@ -367,27 +367,27 @@ fn run() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_46 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_46, 114); - String::append_char(__local_46, 117); - String::append_char(__local_46, 110); - String::append_char(__local_46, 32); - String::append_char(__local_46, 97); - String::append_char(__local_46, 116); - String::append_char(__local_46, 32); - String::append(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_46, 58); + String::push_str(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_46, 114); + String::push(__local_46, 117); + String::push(__local_46, 110); + String::push(__local_46, 32); + String::push(__local_46, 97); + String::push(__local_46, 116); + String::push(__local_46, 32); + String::push_str(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_46, 58); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_85 = __local_47; i32::fmt_decimal(139, __local_85); - String::append(__local_46, String { repr: array.new_data(" + String::push_str(__local_46, String { repr: array.new_data(" condition: w.get() == 42 "), used: 26 }); - String::append(__local_46, String { repr: array.new_data("w.get(): "), used: 9 }); + String::push_str(__local_46, String { repr: array.new_data("w.get(): "), used: 9 }); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_90 = __local_47; i32::fmt_decimal(__v0_1, __local_90); - String::append_char(__local_46, 10); + String::push(__local_46, 10); break __tmpl: __local_46; }); unreachable; @@ -397,27 +397,27 @@ condition: w.get() == 42 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_48 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_48, 114); - String::append_char(__local_48, 117); - String::append_char(__local_48, 110); - String::append_char(__local_48, 32); - String::append_char(__local_48, 97); - String::append_char(__local_48, 116); - String::append_char(__local_48, 32); - String::append(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_48, 58); + String::push_str(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_48, 114); + String::push(__local_48, 117); + String::push(__local_48, 110); + String::push(__local_48, 32); + String::push(__local_48, 97); + String::push(__local_48, 116); + String::push(__local_48, 32); + String::push_str(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_48, 58); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_96 = __local_49; i32::fmt_decimal(140, __local_96); - String::append(__local_48, String { repr: array.new_data(" + String::push_str(__local_48, String { repr: array.new_data(" condition: w.doubled() == 84 "), used: 30 }); - String::append(__local_48, String { repr: array.new_data("w.doubled(): "), used: 13 }); + String::push_str(__local_48, String { repr: array.new_data("w.doubled(): "), used: 13 }); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_101 = __local_49; i32::fmt_decimal(__v0_3, __local_101); - String::append_char(__local_48, 10); + String::push(__local_48, 10); break __tmpl: __local_48; }); unreachable; @@ -427,27 +427,27 @@ condition: w.doubled() == 84 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_50 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_50, 114); - String::append_char(__local_50, 117); - String::append_char(__local_50, 110); - String::append_char(__local_50, 32); - String::append_char(__local_50, 97); - String::append_char(__local_50, 116); - String::append_char(__local_50, 32); - String::append(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_50, 58); + String::push_str(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_50, 114); + String::push(__local_50, 117); + String::push(__local_50, 110); + String::push(__local_50, 32); + String::push(__local_50, 97); + String::push(__local_50, 116); + String::push(__local_50, 32); + String::push_str(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_50, 58); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_107 = __local_51; i32::fmt_decimal(144, __local_107); - String::append(__local_50, String { repr: array.new_data(" + String::push_str(__local_50, String { repr: array.new_data(" condition: a.as_cents() == 1950 "), used: 33 }); - String::append(__local_50, String { repr: array.new_data("a.as_cents(): "), used: 14 }); + String::push_str(__local_50, String { repr: array.new_data("a.as_cents(): "), used: 14 }); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_112 = __local_51; i32::fmt_decimal(__v0_6, __local_112); - String::append_char(__local_50, 10); + String::push(__local_50, 10); break __tmpl: __local_50; }); unreachable; @@ -457,27 +457,27 @@ condition: a.as_cents() == 1950 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_52 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_52, 114); - String::append_char(__local_52, 117); - String::append_char(__local_52, 110); - String::append_char(__local_52, 32); - String::append_char(__local_52, 97); - String::append_char(__local_52, 116); - String::append_char(__local_52, 32); - String::append(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_52, 58); + String::push_str(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_52, 114); + String::push(__local_52, 117); + String::push(__local_52, 110); + String::push(__local_52, 32); + String::push(__local_52, 97); + String::push(__local_52, 116); + String::push(__local_52, 32); + String::push_str(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_52, 58); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_118 = __local_53; i32::fmt_decimal(148, __local_118); - String::append(__local_52, String { repr: array.new_data(" + String::push_str(__local_52, String { repr: array.new_data(" condition: l.len() == 5 "), used: 25 }); - String::append(__local_52, String { repr: array.new_data("l.len(): "), used: 9 }); + String::push_str(__local_52, String { repr: array.new_data("l.len(): "), used: 9 }); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_123 = __local_53; i32::fmt_decimal(__v0_9, __local_123); - String::append_char(__local_52, 10); + String::push(__local_52, 10); break __tmpl: __local_52; }); unreachable; @@ -487,23 +487,23 @@ condition: l.len() == 5 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_54 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_54, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_54, 114); - String::append_char(__local_54, 117); - String::append_char(__local_54, 110); - String::append_char(__local_54, 32); - String::append_char(__local_54, 97); - String::append_char(__local_54, 116); - String::append_char(__local_54, 32); - String::append(__local_54, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_54, 58); + String::push_str(__local_54, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_54, 114); + String::push(__local_54, 117); + String::push(__local_54, 110); + String::push(__local_54, 32); + String::push(__local_54, 97); + String::push(__local_54, 116); + String::push(__local_54, 32); + String::push_str(__local_54, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_54, 58); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_129 = __local_55; i32::fmt_decimal(152, __local_129); - String::append(__local_54, String { repr: array.new_data(" + String::push_str(__local_54, String { repr: array.new_data(" condition: f.is_set() == true "), used: 31 }); - String::append(__local_54, String { repr: array.new_data("f.is_set(): "), used: 12 }); + String::push_str(__local_54, String { repr: array.new_data("f.is_set(): "), used: 12 }); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_134 = __local_55; Formatter::pad(__local_134, if __v0_12 -> ref String { @@ -511,7 +511,7 @@ condition: f.is_set() == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_54, 10); + String::push(__local_54, 10); break __tmpl: __local_54; }); unreachable; @@ -521,23 +521,23 @@ condition: f.is_set() == true if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_56 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_56, 114); - String::append_char(__local_56, 117); - String::append_char(__local_56, 110); - String::append_char(__local_56, 32); - String::append_char(__local_56, 97); - String::append_char(__local_56, 116); - String::append_char(__local_56, 32); - String::append(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_56, 58); + String::push_str(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_56, 114); + String::push(__local_56, 117); + String::push(__local_56, 110); + String::push(__local_56, 32); + String::push(__local_56, 97); + String::push(__local_56, 116); + String::push(__local_56, 32); + String::push_str(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_56, 58); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_140 = __local_57; i32::fmt_decimal(154, __local_140); - String::append(__local_56, String { repr: array.new_data(" + String::push_str(__local_56, String { repr: array.new_data(" condition: f2.is_set() == false "), used: 33 }); - String::append(__local_56, String { repr: array.new_data("f2.is_set(): "), used: 13 }); + String::push_str(__local_56, String { repr: array.new_data("f2.is_set(): "), used: 13 }); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_145 = __local_57; Formatter::pad(__local_145, if __v0_15 -> ref String { @@ -545,7 +545,7 @@ condition: f2.is_set() == false } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_56, 10); + String::push(__local_56, 10); break __tmpl: __local_56; }); unreachable; @@ -555,27 +555,27 @@ condition: f2.is_set() == false if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_58 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_58, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_58, 114); - String::append_char(__local_58, 117); - String::append_char(__local_58, 110); - String::append_char(__local_58, 32); - String::append_char(__local_58, 97); - String::append_char(__local_58, 116); - String::append_char(__local_58, 32); - String::append(__local_58, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_58, 58); + String::push_str(__local_58, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_58, 114); + String::push(__local_58, 117); + String::push(__local_58, 110); + String::push(__local_58, 32); + String::push(__local_58, 97); + String::push(__local_58, 116); + String::push(__local_58, 32); + String::push_str(__local_58, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_58, 58); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; __local_151 = __local_59; i32::fmt_decimal(157, __local_151); - String::append(__local_58, String { repr: array.new_data(" + String::push_str(__local_58, String { repr: array.new_data(" condition: double_wrapper(&w) == 84 "), used: 37 }); - String::append(__local_58, String { repr: array.new_data("double_wrapper(&w): "), used: 20 }); + String::push_str(__local_58, String { repr: array.new_data("double_wrapper(&w): "), used: 20 }); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; __local_156 = __local_59; i32::fmt_decimal(__v0_17, __local_156); - String::append_char(__local_58, 10); + String::push(__local_58, 10); break __tmpl: __local_58; }); unreachable; @@ -585,27 +585,27 @@ condition: double_wrapper(&w) == 84 if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_60 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_60, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_60, 114); - String::append_char(__local_60, 117); - String::append_char(__local_60, 110); - String::append_char(__local_60, 32); - String::append_char(__local_60, 97); - String::append_char(__local_60, 116); - String::append_char(__local_60, 32); - String::append(__local_60, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_60, 58); + String::push_str(__local_60, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_60, 114); + String::push(__local_60, 117); + String::push(__local_60, 110); + String::push(__local_60, 32); + String::push(__local_60, 97); + String::push(__local_60, 116); + String::push(__local_60, 32); + String::push_str(__local_60, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_60, 58); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; __local_162 = __local_61; i32::fmt_decimal(158, __local_162); - String::append(__local_60, String { repr: array.new_data(" + String::push_str(__local_60, String { repr: array.new_data(" condition: triple_wrapper(&w) == 126 "), used: 38 }); - String::append(__local_60, String { repr: array.new_data("triple_wrapper(&w): "), used: 20 }); + String::push_str(__local_60, String { repr: array.new_data("triple_wrapper(&w): "), used: 20 }); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; __local_167 = __local_61; i32::fmt_decimal(__v0_19, __local_167); - String::append_char(__local_60, 10); + String::push(__local_60, 10); break __tmpl: __local_60; }); unreachable; @@ -615,27 +615,27 @@ condition: triple_wrapper(&w) == 126 if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_62 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_62, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_62, 114); - String::append_char(__local_62, 117); - String::append_char(__local_62, 110); - String::append_char(__local_62, 32); - String::append_char(__local_62, 97); - String::append_char(__local_62, 116); - String::append_char(__local_62, 32); - String::append(__local_62, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_62, 58); + String::push_str(__local_62, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_62, 114); + String::push(__local_62, 117); + String::push(__local_62, 110); + String::push(__local_62, 32); + String::push(__local_62, 97); + String::push(__local_62, 116); + String::push(__local_62, 32); + String::push_str(__local_62, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_62, 58); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; __local_173 = __local_63; i32::fmt_decimal(159, __local_173); - String::append(__local_62, String { repr: array.new_data(" + String::push_str(__local_62, String { repr: array.new_data(" condition: process_wrapper(&w) == 210 "), used: 39 }); - String::append(__local_62, String { repr: array.new_data("process_wrapper(&w): "), used: 21 }); + String::push_str(__local_62, String { repr: array.new_data("process_wrapper(&w): "), used: 21 }); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; __local_178 = __local_63; i32::fmt_decimal(__v0_21, __local_178); - String::append_char(__local_62, 10); + String::push(__local_62, 10); break __tmpl: __local_62; }); unreachable; @@ -645,27 +645,27 @@ condition: process_wrapper(&w) == 210 if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_64 = String { repr: builtin::array_new(161), used: 0 }; - String::append(__local_64, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_64, 114); - String::append_char(__local_64, 117); - String::append_char(__local_64, 110); - String::append_char(__local_64, 32); - String::append_char(__local_64, 97); - String::append_char(__local_64, 116); - String::append_char(__local_64, 32); - String::append(__local_64, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_64, 58); + String::push_str(__local_64, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_64, 114); + String::push(__local_64, 117); + String::push(__local_64, 110); + String::push(__local_64, 32); + String::push(__local_64, 97); + String::push(__local_64, 116); + String::push(__local_64, 32); + String::push_str(__local_64, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_64, 58); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; __local_184 = __local_65; i32::fmt_decimal(162, __local_184); - String::append(__local_64, String { repr: array.new_data(" + String::push_str(__local_64, String { repr: array.new_data(" condition: conditional_wrapper(true) == 10 "), used: 44 }); - String::append(__local_64, String { repr: array.new_data("conditional_wrapper(true): "), used: 27 }); + String::push_str(__local_64, String { repr: array.new_data("conditional_wrapper(true): "), used: 27 }); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; __local_189 = __local_65; i32::fmt_decimal(__v0_23, __local_189); - String::append_char(__local_64, 10); + String::push(__local_64, 10); break __tmpl: __local_64; }); unreachable; @@ -675,27 +675,27 @@ condition: conditional_wrapper(true) == 10 if __cond_26 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_66 = String { repr: builtin::array_new(163), used: 0 }; - String::append(__local_66, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_66, 114); - String::append_char(__local_66, 117); - String::append_char(__local_66, 110); - String::append_char(__local_66, 32); - String::append_char(__local_66, 97); - String::append_char(__local_66, 116); - String::append_char(__local_66, 32); - String::append(__local_66, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_66, 58); + String::push_str(__local_66, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_66, 114); + String::push(__local_66, 117); + String::push(__local_66, 110); + String::push(__local_66, 32); + String::push(__local_66, 97); + String::push(__local_66, 116); + String::push(__local_66, 32); + String::push_str(__local_66, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_66, 58); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; __local_195 = __local_67; i32::fmt_decimal(163, __local_195); - String::append(__local_66, String { repr: array.new_data(" + String::push_str(__local_66, String { repr: array.new_data(" condition: conditional_wrapper(false) == 20 "), used: 45 }); - String::append(__local_66, String { repr: array.new_data("conditional_wrapper(false): "), used: 28 }); + String::push_str(__local_66, String { repr: array.new_data("conditional_wrapper(false): "), used: 28 }); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; __local_200 = __local_67; i32::fmt_decimal(__v0_25, __local_200); - String::append_char(__local_66, 10); + String::push(__local_66, 10); break __tmpl: __local_66; }); unreachable; @@ -705,31 +705,31 @@ condition: conditional_wrapper(false) == 20 if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_68 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_68, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_68, 114); - String::append_char(__local_68, 117); - String::append_char(__local_68, 110); - String::append_char(__local_68, 32); - String::append_char(__local_68, 97); - String::append_char(__local_68, 116); - String::append_char(__local_68, 32); - String::append(__local_68, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_68, 58); + String::push_str(__local_68, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_68, 114); + String::push(__local_68, 117); + String::push(__local_68, 110); + String::push(__local_68, 32); + String::push(__local_68, 97); + String::push(__local_68, 116); + String::push(__local_68, 32); + String::push_str(__local_68, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_68, 58); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; __local_206 = __local_69; i32::fmt_decimal(169, __local_206); - String::append(__local_68, String { repr: array.new_data(" + String::push_str(__local_68, String { repr: array.new_data(" condition: sum == 30.8 "), used: 24 }); - String::append_char(__local_68, 115); - String::append_char(__local_68, 117); - String::append_char(__local_68, 109); - String::append_char(__local_68, 58); - String::append_char(__local_68, 32); + String::push(__local_68, 115); + String::push(__local_68, 117); + String::push(__local_68, 109); + String::push(__local_68, 58); + String::push(__local_68, 32); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; __local_211 = __local_69; f64::inspect_into(sum, __local_211); - String::append_char(__local_68, 10); + String::push(__local_68, 10); break __tmpl: __local_68; }); unreachable; @@ -739,27 +739,27 @@ condition: sum == 30.8 if __cond_33 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_70 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_70, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_70, 114); - String::append_char(__local_70, 117); - String::append_char(__local_70, 110); - String::append_char(__local_70, 32); - String::append_char(__local_70, 97); - String::append_char(__local_70, 116); - String::append_char(__local_70, 32); - String::append(__local_70, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_70, 58); + String::push_str(__local_70, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_70, 114); + String::push(__local_70, 117); + String::push(__local_70, 110); + String::push(__local_70, 32); + String::push(__local_70, 97); + String::push(__local_70, 116); + String::push(__local_70, 32); + String::push_str(__local_70, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_70, 58); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; __local_215 = __local_71; i32::fmt_decimal(172, __local_215); - String::append(__local_70, String { repr: array.new_data(" + String::push_str(__local_70, String { repr: array.new_data(" condition: sum_wrappers() == 100 "), used: 34 }); - String::append(__local_70, String { repr: array.new_data("sum_wrappers(): "), used: 16 }); + String::push_str(__local_70, String { repr: array.new_data("sum_wrappers(): "), used: 16 }); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; __local_220 = __local_71; i32::fmt_decimal(__v0_32, __local_220); - String::append_char(__local_70, 10); + String::push(__local_70, 10); break __tmpl: __local_70; }); unreachable; @@ -769,27 +769,27 @@ condition: sum_wrappers() == 100 if __cond_35 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_72 = String { repr: builtin::array_new(153), used: 0 }; - String::append(__local_72, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_72, 114); - String::append_char(__local_72, 117); - String::append_char(__local_72, 110); - String::append_char(__local_72, 32); - String::append_char(__local_72, 97); - String::append_char(__local_72, 116); - String::append_char(__local_72, 32); - String::append(__local_72, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_72, 58); + String::push_str(__local_72, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_72, 114); + String::push(__local_72, 117); + String::push(__local_72, 110); + String::push(__local_72, 32); + String::push(__local_72, 97); + String::push(__local_72, 116); + String::push(__local_72, 32); + String::push_str(__local_72, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_72, 58); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; __local_226 = __local_73; i32::fmt_decimal(175, __local_226); - String::append(__local_72, String { repr: array.new_data(" + String::push_str(__local_72, String { repr: array.new_data(" condition: mixed_single_fields() == 42 "), used: 40 }); - String::append(__local_72, String { repr: array.new_data("mixed_single_fields(): "), used: 23 }); + String::push_str(__local_72, String { repr: array.new_data("mixed_single_fields(): "), used: 23 }); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; __local_231 = __local_73; i32::fmt_decimal(__v0_34, __local_231); - String::append_char(__local_72, 10); + String::push(__local_72, 10); break __tmpl: __local_72; }); unreachable; @@ -803,19 +803,19 @@ condition: mixed_single_fields() == 42 if __cond_37 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_76 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_76, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_76, 114); - String::append_char(__local_76, 117); - String::append_char(__local_76, 110); - String::append_char(__local_76, 32); - String::append_char(__local_76, 97); - String::append_char(__local_76, 116); - String::append_char(__local_76, 32); - String::append(__local_76, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_76, 58); + String::push_str(__local_76, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_76, 114); + String::push(__local_76, 117); + String::push(__local_76, 110); + String::push(__local_76, 32); + String::push(__local_76, 97); + String::push(__local_76, 116); + String::push(__local_76, 32); + String::push_str(__local_76, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_76, 58); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_76 }; i32::fmt_decimal(179, __local_77); - String::append(__local_76, String { repr: array.new_data(" + String::push_str(__local_76, String { repr: array.new_data(" condition: `{w2.inner}` == \"99\" "), used: 33 }); break __tmpl: __local_76; @@ -829,27 +829,27 @@ condition: `{w2.inner}` == \"99\" if __cond_40 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_78 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_78, 114); - String::append_char(__local_78, 117); - String::append_char(__local_78, 110); - String::append_char(__local_78, 32); - String::append_char(__local_78, 97); - String::append_char(__local_78, 116); - String::append_char(__local_78, 32); - String::append(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); - String::append_char(__local_78, 58); + String::push_str(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_78, 114); + String::push(__local_78, 117); + String::push(__local_78, 110); + String::push(__local_78, 32); + String::push(__local_78, 97); + String::push(__local_78, 116); + String::push(__local_78, 32); + String::push_str(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_single_field.wado"), used: 55 }); + String::push(__local_78, 58); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; __local_249 = __local_79; i32::fmt_decimal(184, __local_249); - String::append(__local_78, String { repr: array.new_data(" + String::push_str(__local_78, String { repr: array.new_data(" condition: w3.inner == 77 "), used: 27 }); - String::append(__local_78, String { repr: array.new_data("w3.inner: "), used: 10 }); + String::push_str(__local_78, String { repr: array.new_data("w3.inner: "), used: 10 }); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; __local_254 = __local_79; i32::fmt_decimal(__v0_39, __local_254); - String::append_char(__local_78, 10); + String::push(__local_78, 10); break __tmpl: __local_78; }); unreachable; @@ -1618,8 +1618,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1674,13 +1674,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1688,25 +1688,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1714,7 +1714,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1756,8 +1756,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1789,7 +1789,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1918,27 +1918,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2061,9 +2061,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2073,8 +2073,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2129,13 +2129,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2170,9 +2170,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2225,7 +2225,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2269,7 +2269,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2335,7 +2335,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l190; }; @@ -2355,7 +2355,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2363,17 +2363,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2527,20 +2527,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2550,10 +2550,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2563,10 +2563,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2574,10 +2574,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref.wir.wado index 4c1da69e3..d57988035 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -120,43 +120,43 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(167), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref.wado"), used: 53 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref.wado"), used: 53 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(23, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: p.x + r == 40 "), used: 26 }); - String::append_char(__local_6, 112); - String::append_char(__local_6, 46); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 112); + String::push(__local_6, 46); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; i32::fmt_decimal(10, __local_17); - String::append_char(__local_6, 10); - String::append_char(__local_6, 114); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 10); + String::push(__local_6, 114); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_22 = __local_7; i32::fmt_decimal(r, __local_22); - String::append_char(__local_6, 10); - String::append(__local_6, String { repr: array.new_data("p.x + r: "), used: 9 }); + String::push(__local_6, 10); + String::push_str(__local_6, String { repr: array.new_data("p.x + r: "), used: 9 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_27 = __local_7; i32::fmt_decimal(__v2, __local_27); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -359,7 +359,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -374,7 +374,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -412,7 +412,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -446,20 +446,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -469,10 +469,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -482,10 +482,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -493,10 +493,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_blocked.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_blocked.wir.wado index 8d04965a5..b6a6a2d6d 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_blocked.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_blocked.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -111,31 +111,31 @@ fn run() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_blocked.wado"), used: 61 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_blocked.wado"), used: 61 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_15 = __local_7; i32::fmt_decimal(25, __local_15); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: p.x == 10 "), used: 22 }); - String::append_char(__local_6, 112); - String::append_char(__local_6, 46); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 112); + String::push(__local_6, 46); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_20 = __local_7; i32::fmt_decimal(__v0_2, __local_20); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -145,33 +145,33 @@ condition: p.x == 10 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_blocked.wado"), used: 61 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_blocked.wado"), used: 61 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_26 = __local_9; i32::fmt_decimal(26, __local_26); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: h.p.x == 10 "), used: 24 }); - String::append_char(__local_8, 104); - String::append_char(__local_8, 46); - String::append_char(__local_8, 112); - String::append_char(__local_8, 46); - String::append_char(__local_8, 120); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 104); + String::push(__local_8, 46); + String::push(__local_8, 112); + String::push(__local_8, 46); + String::push(__local_8, 120); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_31 = __local_9; i32::fmt_decimal(__v0_4, __local_31); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -374,7 +374,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -389,7 +389,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -427,7 +427,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -461,20 +461,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -484,10 +484,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -497,10 +497,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -508,10 +508,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_mixed.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_mixed.wir.wado index 1bad494e6..31072f96d 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_mixed.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_mixed.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -132,44 +132,44 @@ fn run() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(169), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_mixed.wado"), used: 59 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_mixed.wado"), used: 59 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_22 = __local_13; i32::fmt_decimal(28, __local_22); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: a.x + ra == 4 "), used: 26 }); - String::append_char(__local_12, 97); - String::append_char(__local_12, 46); - String::append_char(__local_12, 120); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 46); + String::push(__local_12, 120); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_27 = __local_13; i32::fmt_decimal(1, __local_27); - String::append_char(__local_12, 10); - String::append_char(__local_12, 114); - String::append_char(__local_12, 97); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 10); + String::push(__local_12, 114); + String::push(__local_12, 97); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_32 = __local_13; i32::fmt_decimal(ra, __local_32); - String::append_char(__local_12, 10); - String::append(__local_12, String { repr: array.new_data("a.x + ra: "), used: 10 }); + String::push(__local_12, 10); + String::push_str(__local_12, String { repr: array.new_data("a.x + ra: "), used: 10 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_37 = __local_13; i32::fmt_decimal(__v2, __local_37); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -179,31 +179,31 @@ condition: a.x + ra == 4 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_mixed.wado"), used: 59 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_mixed.wado"), used: 59 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_44 = __local_15; i32::fmt_decimal(33, __local_44); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: b.x == 3 "), used: 21 }); - String::append_char(__local_14, 98); - String::append_char(__local_14, 46); - String::append_char(__local_14, 120); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 98); + String::push(__local_14, 46); + String::push(__local_14, 120); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_49 = __local_15; i32::fmt_decimal(__v0_8, __local_49); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -213,33 +213,33 @@ condition: b.x == 3 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_mixed.wado"), used: 59 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_mixed.wado"), used: 59 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_55 = __local_17; i32::fmt_decimal(34, __local_55); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: h.p.x == 3 "), used: 23 }); - String::append_char(__local_16, 104); - String::append_char(__local_16, 46); - String::append_char(__local_16, 112); - String::append_char(__local_16, 46); - String::append_char(__local_16, 120); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 104); + String::push(__local_16, 46); + String::push(__local_16, 112); + String::push(__local_16, 46); + String::push(__local_16, 120); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_60 = __local_17; i32::fmt_decimal(__v0_10, __local_60); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -442,7 +442,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -457,7 +457,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -495,7 +495,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -529,20 +529,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -552,10 +552,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -565,10 +565,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -576,10 +576,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_mut.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_mut.wir.wado index ade65dc39..e8ef3de6d 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_mut.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_stores_ref_mut.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -126,31 +126,31 @@ fn run() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_mut.wado"), used: 57 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_5, 114); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_mut.wado"), used: 57 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_13 = __local_6; i32::fmt_decimal(22, __local_13); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: p.x == 15 "), used: 22 }); - String::append_char(__local_5, 112); - String::append_char(__local_5, 46); - String::append_char(__local_5, 120); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 112); + String::push(__local_5, 46); + String::push(__local_5, 120); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_18 = __local_6; i32::fmt_decimal(__v0_1, __local_18); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -160,31 +160,31 @@ condition: p.x == 15 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_7, 114); - String::append_char(__local_7, 117); - String::append_char(__local_7, 110); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_mut.wado"), used: 57 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_7, 114); + String::push(__local_7, 117); + String::push(__local_7, 110); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_stores_ref_mut.wado"), used: 57 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_24 = __local_8; i32::fmt_decimal(23, __local_24); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: p.y == 30 "), used: 22 }); - String::append_char(__local_7, 112); - String::append_char(__local_7, 46); - String::append_char(__local_7, 121); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 112); + String::push(__local_7, 46); + String::push(__local_7, 121); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_29 = __local_8; i32::fmt_decimal(__v0_3, __local_29); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -387,7 +387,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -402,7 +402,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -440,7 +440,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -474,20 +474,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -497,10 +497,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -510,10 +510,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -521,10 +521,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_variant.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_variant.wir.wado index 90e668b12..3d3364de2 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_variant.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_variant.wir.wado @@ -84,9 +84,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -222,27 +222,27 @@ fn run() with Stdout { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant.wado"), used: 50 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant.wado"), used: 50 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_24 = __local_11; i32::fmt_decimal(39, __local_24); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: sum_bytes(\"ABC\") == 198 "), used: 36 }); - String::append(__local_10, String { repr: array.new_data("sum_bytes(\"ABC\"): "), used: 18 }); + String::push_str(__local_10, String { repr: array.new_data("sum_bytes(\"ABC\"): "), used: 18 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_29 = __local_11; i32::fmt_decimal(__v0_0, __local_29); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -252,27 +252,27 @@ condition: sum_bytes(\"ABC\") == 198 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant.wado"), used: 50 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant.wado"), used: 50 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_35 = __local_13; i32::fmt_decimal(40, __local_35); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: sum_bytes(\"\") == 0 "), used: 31 }); - String::append(__local_12, String { repr: array.new_data("sum_bytes(\"\"): "), used: 15 }); + String::push_str(__local_12, String { repr: array.new_data("sum_bytes(\"\"): "), used: 15 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_40 = __local_13; i32::fmt_decimal(__v0_2, __local_40); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -282,27 +282,27 @@ condition: sum_bytes(\"\") == 0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant.wado"), used: 50 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant.wado"), used: 50 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_46 = __local_15; i32::fmt_decimal(41, __local_46); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: count_chars(\"hello\") == 5 "), used: 38 }); - String::append(__local_14, String { repr: array.new_data("count_chars(\"hello\"): "), used: 22 }); + String::push_str(__local_14, String { repr: array.new_data("count_chars(\"hello\"): "), used: 22 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_51 = __local_15; i32::fmt_decimal(__v0_4, __local_51); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -312,27 +312,27 @@ condition: count_chars(\"hello\") == 5 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant.wado"), used: 50 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant.wado"), used: 50 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_57 = __local_17; i32::fmt_decimal(42, __local_57); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: first_byte(\"Z\") == 90 "), used: 34 }); - String::append(__local_16, String { repr: array.new_data("first_byte(\"Z\"): "), used: 17 }); + String::push_str(__local_16, String { repr: array.new_data("first_byte(\"Z\"): "), used: 17 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_62 = __local_17; i32::fmt_decimal(__v0_6, __local_62); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -342,27 +342,27 @@ condition: first_byte(\"Z\") == 90 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant.wado"), used: 50 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant.wado"), used: 50 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_68 = __local_19; i32::fmt_decimal(43, __local_68); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: first_byte(\"\") == -1 "), used: 33 }); - String::append(__local_18, String { repr: array.new_data("first_byte(\"\"): "), used: 16 }); + String::push_str(__local_18, String { repr: array.new_data("first_byte(\"\"): "), used: 16 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_73 = __local_19; i32::fmt_decimal(__v0_8, __local_73); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -602,7 +602,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -661,7 +661,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -699,7 +699,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l40; }; @@ -733,20 +733,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -756,10 +756,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -769,10 +769,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -780,10 +780,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/opt_sroa_variant_per_case.wir.wado b/wado-compiler/tests/fixtures.golden/opt_sroa_variant_per_case.wir.wado index dbfc7fefd..cb1867bb2 100644 --- a/wado-compiler/tests/fixtures.golden/opt_sroa_variant_per_case.wir.wado +++ b/wado-compiler/tests/fixtures.golden/opt_sroa_variant_per_case.wir.wado @@ -80,13 +80,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -226,27 +226,27 @@ fn run() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_36 = __local_17; i32::fmt_decimal(65, __local_36); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: try_divide(10, 2) == 5 "), used: 35 }); - String::append(__local_16, String { repr: array.new_data("try_divide(10, 2): "), used: 19 }); + String::push_str(__local_16, String { repr: array.new_data("try_divide(10, 2): "), used: 19 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_41 = __local_17; i32::fmt_decimal(__v0_0, __local_41); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -256,27 +256,27 @@ condition: try_divide(10, 2) == 5 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_47 = __local_19; i32::fmt_decimal(66, __local_47); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: try_divide(10, 0) == -1 "), used: 36 }); - String::append(__local_18, String { repr: array.new_data("try_divide(10, 0): "), used: 19 }); + String::push_str(__local_18, String { repr: array.new_data("try_divide(10, 0): "), used: 19 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_52 = __local_19; i32::fmt_decimal(__v0_2, __local_52); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -286,27 +286,27 @@ condition: try_divide(10, 0) == -1 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_58 = __local_21; i32::fmt_decimal(67, __local_58); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: try_divide(100, 10) == 10 "), used: 38 }); - String::append(__local_20, String { repr: array.new_data("try_divide(100, 10): "), used: 21 }); + String::push_str(__local_20, String { repr: array.new_data("try_divide(100, 10): "), used: 21 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_63 = __local_21; i32::fmt_decimal(__v0_4, __local_63); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -316,27 +316,27 @@ condition: try_divide(100, 10) == 10 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_69 = __local_23; i32::fmt_decimal(70, __local_69); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: use_payload(5) == 10 "), used: 33 }); - String::append(__local_22, String { repr: array.new_data("use_payload(5): "), used: 16 }); + String::push_str(__local_22, String { repr: array.new_data("use_payload(5): "), used: 16 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_74 = __local_23; i32::fmt_decimal(__v0_6, __local_74); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -346,27 +346,27 @@ condition: use_payload(5) == 10 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_80 = __local_25; i32::fmt_decimal(71, __local_80); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: use_payload(0) == 0 "), used: 32 }); - String::append(__local_24, String { repr: array.new_data("use_payload(0): "), used: 16 }); + String::push_str(__local_24, String { repr: array.new_data("use_payload(0): "), used: 16 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_85 = __local_25; i32::fmt_decimal(__v0_8, __local_85); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -376,27 +376,27 @@ condition: use_payload(0) == 0 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_26, 114); - String::append_char(__local_26, 117); - String::append_char(__local_26, 110); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_26, 114); + String::push(__local_26, 117); + String::push(__local_26, 110); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_91 = __local_27; i32::fmt_decimal(72, __local_91); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: use_payload(-1) == -1 "), used: 34 }); - String::append(__local_26, String { repr: array.new_data("use_payload(-1): "), used: 17 }); + String::push_str(__local_26, String { repr: array.new_data("use_payload(-1): "), used: 17 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_96 = __local_27; i32::fmt_decimal(__v0_10, __local_96); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -406,26 +406,26 @@ condition: use_payload(-1) == -1 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(155), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_28, 114); - String::append_char(__local_28, 117); - String::append_char(__local_28, 110); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_28, 114); + String::push(__local_28, 117); + String::push(__local_28, 110); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_102 = __local_29; i32::fmt_decimal(75, __local_102); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: use_err_branch(-1) == \"negative\" "), used: 45 }); - String::append(__local_28, String { repr: array.new_data("use_err_branch(-1): "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("use_err_branch(-1): "), used: 20 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; String^Inspect::inspect(__v0_12, __local_29); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -435,26 +435,26 @@ condition: use_err_branch(-1) == \"negative\" if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_30, 114); - String::append_char(__local_30, 117); - String::append_char(__local_30, 110); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_30, 114); + String::push(__local_30, 117); + String::push(__local_30, 110); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/opt_sroa_variant_per_case.wado"), used: 59 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_109 = __local_31; i32::fmt_decimal(76, __local_109); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: use_err_branch(5) == \"ok\" "), used: 38 }); - String::append(__local_30, String { repr: array.new_data("use_err_branch(5): "), used: 19 }); + String::push_str(__local_30, String { repr: array.new_data("use_err_branch(5): "), used: 19 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; String^Inspect::inspect(__v0_14, __local_31); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -657,7 +657,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -745,7 +745,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -783,7 +783,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l45; }; @@ -817,20 +817,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -840,10 +840,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -853,10 +853,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -864,10 +864,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -879,7 +879,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -896,22 +896,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b64; @@ -919,7 +919,7 @@ fn String^Inspect::inspect(self, f) { continue l65; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/optimize_bce_field_access_equiv.wir.wado b/wado-compiler/tests/fixtures.golden/optimize_bce_field_access_equiv.wir.wado index 47a6bbe16..44c3df76e 100644 --- a/wado-compiler/tests/fixtures.golden/optimize_bce_field_access_equiv.wir.wado +++ b/wado-compiler/tests/fixtures.golden/optimize_bce_field_access_equiv.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -143,31 +143,31 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/optimize_bce_field_access_equiv.wado"), used: 65 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/optimize_bce_field_access_equiv.wado"), used: 65 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_18 = __local_7; i32::fmt_decimal(10, __local_18); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: sum == 4200 "), used: 24 }); - String::append_char(__local_6, 115); - String::append_char(__local_6, 117); - String::append_char(__local_6, 109); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 115); + String::push(__local_6, 117); + String::push(__local_6, 109); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_23 = __local_7; i32::fmt_decimal(__v0, __local_23); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -370,7 +370,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -385,7 +385,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -423,7 +423,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -457,20 +457,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -480,10 +480,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -493,10 +493,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -504,10 +504,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/optimize_bce_if_guard.wir.wado b/wado-compiler/tests/fixtures.golden/optimize_bce_if_guard.wir.wado index 96f79609e..c1f2e415b 100644 --- a/wado-compiler/tests/fixtures.golden/optimize_bce_if_guard.wir.wado +++ b/wado-compiler/tests/fixtures.golden/optimize_bce_if_guard.wir.wado @@ -73,11 +73,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -162,29 +162,29 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/optimize_bce_if_guard.wado"), used: 55 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_5, 114); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/optimize_bce_if_guard.wado"), used: 55 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_24 = __local_6; i32::fmt_decimal(18, __local_24); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == 270 "), used: 21 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_29 = __local_6; i32::fmt_decimal(s, __local_29); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -387,7 +387,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -402,7 +402,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -429,7 +429,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -482,7 +482,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l32; }; @@ -516,20 +516,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -539,10 +539,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -552,10 +552,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -563,10 +563,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/optimize_bce_ref_param.wir.wado b/wado-compiler/tests/fixtures.golden/optimize_bce_ref_param.wir.wado index 1e1890831..10cfedda5 100644 --- a/wado-compiler/tests/fixtures.golden/optimize_bce_ref_param.wir.wado +++ b/wado-compiler/tests/fixtures.golden/optimize_bce_ref_param.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -147,29 +147,29 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/optimize_bce_ref_param.wado"), used: 56 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/optimize_bce_ref_param.wado"), used: 56 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_13 = __local_5; i32::fmt_decimal(16, __local_13); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: s == 4200 "), used: 22 }); - String::append_char(__local_4, 115); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 115); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_18 = __local_5; i32::fmt_decimal(s, __local_18); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -372,7 +372,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -387,7 +387,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -425,7 +425,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -459,20 +459,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -482,10 +482,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -495,10 +495,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -506,10 +506,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/optimize_bitmask_bce.wir.wado b/wado-compiler/tests/fixtures.golden/optimize_bitmask_bce.wir.wado index 610d9de5e..ac2ac32cb 100644 --- a/wado-compiler/tests/fixtures.golden/optimize_bitmask_bce.wir.wado +++ b/wado-compiler/tests/fixtures.golden/optimize_bitmask_bce.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -142,31 +142,31 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/optimize_bitmask_bce.wado"), used: 54 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/optimize_bitmask_bce.wado"), used: 54 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_20 = __local_7; i32::fmt_decimal(10, __local_20); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: sum == -100 "), used: 24 }); - String::append_char(__local_6, 115); - String::append_char(__local_6, 117); - String::append_char(__local_6, 109); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 115); + String::push(__local_6, 117); + String::push(__local_6, 109); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_25 = __local_7; i32::fmt_decimal(__v0, __local_25); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -369,7 +369,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -384,7 +384,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -422,7 +422,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -456,20 +456,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -479,10 +479,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -492,10 +492,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -503,10 +503,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/option_i32_struct_field.wir.wado b/wado-compiler/tests/fixtures.golden/option_i32_struct_field.wir.wado index 946a3aba0..d46ed4b74 100644 --- a/wado-compiler/tests/fixtures.golden/option_i32_struct_field.wir.wado +++ b/wado-compiler/tests/fixtures.golden/option_i32_struct_field.wir.wado @@ -74,9 +74,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -114,13 +114,13 @@ fn run() with Stdout { w_1 = ref.cast Option::Some(__sroa_c_width).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_4, 119); - String::append_char(__local_4, 105); - String::append_char(__local_4, 100); - String::append_char(__local_4, 116); - String::append_char(__local_4, 104); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 119); + String::push(__local_4, 105); + String::push(__local_4, 100); + String::push(__local_4, 116); + String::push(__local_4, 104); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(w_1, __local_5); break __tmpl: __local_4; @@ -329,7 +329,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -344,7 +344,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -382,7 +382,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -416,20 +416,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -439,10 +439,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -452,10 +452,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -463,10 +463,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/ordering-basic.wir.wado b/wado-compiler/tests/fixtures.golden/ordering-basic.wir.wado index 04223e94c..e0792b5e7 100644 --- a/wado-compiler/tests/fixtures.golden/ordering-basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/ordering-basic.wir.wado @@ -62,7 +62,7 @@ type "functype/Array^Eq::eq" = fn(ref Array, ref Array) -> bool; type "functype/Array^Ord::cmp" = fn(ref Array, ref Array) -> enum:Ordering; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -342,7 +342,7 @@ fn Array^Eq::eq(self, other) { if self.used != other.used { return 0; }; - __for_3: block { + __for_9: block { i = 0; _licm_used_3 = self.used; _licm_repr_4 = self.repr; @@ -350,7 +350,7 @@ fn Array^Eq::eq(self, other) { block { l33: loop { if (i < _licm_used_3) == 0 { - break __for_3; + break __for_9; }; if (builtin::array_get(_licm_repr_4, i) == builtin::array_get(_licm_repr_5, i)) == 0 { return 0; @@ -377,14 +377,14 @@ fn Array^Ord::cmp(self, other) { __local_7 = other.used; break __inline_i32_min_0: select i32(__local_6 < __local_7, __local_6, __local_7); }; - __for_4: block { + __for_10: block { i = 0; _licm_repr_8 = self.repr; _licm_repr_9 = other.repr; block { l37: loop { if (i < min_len) == 0 { - break __for_4; + break __for_10; }; a = builtin::array_get(_licm_repr_8, i); b = builtin::array_get(_licm_repr_9, i); @@ -408,7 +408,7 @@ fn Array^Ord::cmp(self, other) { return 1; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_generic_self.wir.wado b/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_generic_self.wir.wado index 5cbe24624..573445582 100644 --- a/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_generic_self.wir.wado +++ b/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_generic_self.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -128,34 +128,34 @@ fn run() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/orphan_rule_allowed_local_generic_self.wado"), used: 72 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/orphan_rule_allowed_local_generic_self.wado"), used: 72 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_20 = __local_11; i32::fmt_decimal(18, __local_20); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: a == b "), used: 19 }); - String::append_char(__local_10, 97); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; MyBox^Inspect::inspect(__v0_3.value, __local_11); - String::append_char(__local_10, 10); - String::append_char(__local_10, 98); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 10); + String::push(__local_10, 98); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; MyBox^Inspect::inspect(__v1_4.value, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -167,42 +167,42 @@ condition: a == b if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/orphan_rule_allowed_local_generic_self.wado"), used: 72 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/orphan_rule_allowed_local_generic_self.wado"), used: 72 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_30 = __local_13; i32::fmt_decimal(19, __local_30); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: !a == c "), used: 20 }); - String::append_char(__local_12, 97); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; MyBox^Inspect::inspect(__v0_6.value, __local_13); - String::append_char(__local_12, 10); - String::append_char(__local_12, 99); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 10); + String::push(__local_12, 99); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; MyBox^Inspect::inspect(__v1_7.value, __local_13); - String::append_char(__local_12, 10); - String::append_char(__local_12, 97); - String::append_char(__local_12, 32); - String::append_char(__local_12, 61); - String::append_char(__local_12, 61); - String::append_char(__local_12, 32); - String::append_char(__local_12, 99); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 10); + String::push(__local_12, 97); + String::push(__local_12, 32); + String::push(__local_12, 61); + String::push(__local_12, 61); + String::push(__local_12, 32); + String::push(__local_12, 99); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_37 = __local_13; Formatter::pad(__local_37, if __v2 -> ref String { @@ -210,7 +210,7 @@ condition: !a == c } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -413,7 +413,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -428,7 +428,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -460,12 +460,12 @@ fn MyBox^Inspect::inspect(self, f) { let s_5: ref String; let s_11: ref String; s_3 = String { repr: array.new_data("MyBox { "), used: 8 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("value: "), used: 7 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self, f); s_11 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); } fn Formatter::write_char_n(self, c, n) { @@ -479,7 +479,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -499,7 +499,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -507,17 +507,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -547,20 +547,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -570,10 +570,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -583,10 +583,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -594,10 +594,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_self.wir.wado b/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_self.wir.wado index c9eb135e6..c63943026 100644 --- a/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_self.wir.wado +++ b/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_self.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/MyPoint^Inspect::inspect" = fn(ref MyPoint, ref Formatter); @@ -133,34 +133,34 @@ fn run() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/orphan_rule_allowed_local_self.wado"), used: 64 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/orphan_rule_allowed_local_self.wado"), used: 64 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_20 = __local_11; i32::fmt_decimal(19, __local_20); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: a == b "), used: 19 }); - String::append_char(__local_10, 97); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; MyPoint^Inspect::inspect(__v0_3, __local_11); - String::append_char(__local_10, 10); - String::append_char(__local_10, 98); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 10); + String::push(__local_10, 98); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; MyPoint^Inspect::inspect(__v1_4, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -176,42 +176,42 @@ condition: a == b if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/orphan_rule_allowed_local_self.wado"), used: 64 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/orphan_rule_allowed_local_self.wado"), used: 64 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_30 = __local_13; i32::fmt_decimal(20, __local_30); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: !a == c "), used: 20 }); - String::append_char(__local_12, 97); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; MyPoint^Inspect::inspect(__v0_6, __local_13); - String::append_char(__local_12, 10); - String::append_char(__local_12, 99); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 10); + String::push(__local_12, 99); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; MyPoint^Inspect::inspect(__v1_7, __local_13); - String::append_char(__local_12, 10); - String::append_char(__local_12, 97); - String::append_char(__local_12, 32); - String::append_char(__local_12, 61); - String::append_char(__local_12, 61); - String::append_char(__local_12, 32); - String::append_char(__local_12, 99); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 10); + String::push(__local_12, 97); + String::push(__local_12, 32); + String::push(__local_12, 61); + String::push(__local_12, 61); + String::push(__local_12, 32); + String::push(__local_12, 99); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_37 = __local_13; Formatter::pad(__local_37, if __v2 -> ref String { @@ -219,7 +219,7 @@ condition: !a == c } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -422,7 +422,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -437,7 +437,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -471,17 +471,17 @@ fn MyPoint^Inspect::inspect(self, f) { let s_13: ref String; let s_19: ref String; s_3 = String { repr: array.new_data("MyPoint { "), used: 10 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("x: "), used: 3 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self.x, f); s_11 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); s_13 = String { repr: array.new_data("y: "), used: 3 }; - String::append(f.buf, s_13); + String::push_str(f.buf, s_13); i32::fmt_decimal(self.y, f); s_19 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); } fn Formatter::write_char_n(self, c, n) { @@ -495,7 +495,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l28; }; @@ -515,7 +515,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -523,17 +523,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -563,20 +563,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -586,10 +586,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -599,10 +599,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -610,10 +610,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_trait.wir.wado b/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_trait.wir.wado index 00d9090b2..a43d33faa 100644 --- a/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_trait.wir.wado +++ b/wado-compiler/tests/fixtures.golden/orphan_rule_allowed_local_trait.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,15 +102,15 @@ fn run() with Stdout { "core:cli/println"(i32^Describable::describe(42)); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 115); - String::append_char(__local_4, 116); - String::append_char(__local_4, 114); - String::append_char(__local_4, 105); - String::append_char(__local_4, 110); - String::append_char(__local_4, 103); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); - String::append(__local_4, s); + String::push(__local_4, 115); + String::push(__local_4, 116); + String::push(__local_4, 114); + String::push(__local_4, 105); + String::push(__local_4, 110); + String::push(__local_4, 103); + String::push(__local_4, 58); + String::push(__local_4, 32); + String::push_str(__local_4, s); break __tmpl: __local_4; }); } @@ -126,15 +126,15 @@ fn __cm_export__run() { "core:cli/println"(i32^Describable::describe(42)); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 115); - String::append_char(__local_4, 116); - String::append_char(__local_4, 114); - String::append_char(__local_4, 105); - String::append_char(__local_4, 110); - String::append_char(__local_4, 103); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); - String::append(__local_4, s); + String::push(__local_4, 115); + String::push(__local_4, 116); + String::push(__local_4, 114); + String::push(__local_4, 105); + String::push(__local_4, 110); + String::push(__local_4, 103); + String::push(__local_4, 58); + String::push(__local_4, 32); + String::push_str(__local_4, s); break __tmpl: __local_4; }); "wasi/task-return"(0); @@ -326,7 +326,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -341,7 +341,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -373,14 +373,14 @@ fn i32^Describable::describe(self) { let __local_2: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_1, 110); - String::append_char(__local_1, 117); - String::append_char(__local_1, 109); - String::append_char(__local_1, 98); - String::append_char(__local_1, 101); - String::append_char(__local_1, 114); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 110); + String::push(__local_1, 117); + String::push(__local_1, 109); + String::push(__local_1, 98); + String::push(__local_1, 101); + String::push(__local_1, 114); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(self, __local_2); break __tmpl: __local_1; @@ -398,7 +398,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -432,20 +432,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -455,10 +455,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -468,10 +468,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -479,10 +479,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/pattern_mut_binding.wir.wado b/wado-compiler/tests/fixtures.golden/pattern_mut_binding.wir.wado index 33ed6b66d..65b5c78f7 100644 --- a/wado-compiler/tests/fixtures.golden/pattern_mut_binding.wir.wado +++ b/wado-compiler/tests/fixtures.golden/pattern_mut_binding.wir.wado @@ -105,15 +105,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -228,36 +228,36 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_30, 114); - String::append_char(__local_30, 117); - String::append_char(__local_30, 110); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_30, 114); + String::push(__local_30, 117); + String::push(__local_30, 110); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_71 = __local_31; i32::fmt_decimal(14, __local_71); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: x == 15 "), used: 20 }); - String::append_char(__local_30, 120); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 120); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_76 = __local_31; i32::fmt_decimal(__v0_2, __local_76); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_32, String { repr: array.new_data("mutated: "), used: 9 }); + String::push_str(__local_32, String { repr: array.new_data("mutated: "), used: 9 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; i32::fmt_decimal(x, __local_33); break __tmpl: __local_32; @@ -269,39 +269,39 @@ condition: x == 15 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_34, 114); - String::append_char(__local_34, 117); - String::append_char(__local_34, 110); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_34, 114); + String::push(__local_34, 117); + String::push(__local_34, 110); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_88 = __local_35; i32::fmt_decimal(19, __local_88); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: orig == 10 "), used: 23 }); - String::append_char(__local_34, 111); - String::append_char(__local_34, 114); - String::append_char(__local_34, 105); - String::append_char(__local_34, 103); - String::append_char(__local_34, 58); - String::append_char(__local_34, 32); + String::push(__local_34, 111); + String::push(__local_34, 114); + String::push(__local_34, 105); + String::push(__local_34, 103); + String::push(__local_34, 58); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_93 = __local_35; i32::fmt_decimal(orig_4, __local_93); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_36, String { repr: array.new_data("original: "), used: 10 }); + String::push_str(__local_36, String { repr: array.new_data("original: "), used: 10 }); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; i32::fmt_decimal(orig_4, __local_37); break __tmpl: __local_36; @@ -325,48 +325,48 @@ condition: orig == 10 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_38, 114); - String::append_char(__local_38, 117); - String::append_char(__local_38, 110); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_38, 114); + String::push(__local_38, 117); + String::push(__local_38, 110); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_105 = __local_39; i32::fmt_decimal(32, __local_105); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: result == 200 "), used: 26 }); - String::append_char(__local_38, 114); - String::append_char(__local_38, 101); - String::append_char(__local_38, 115); - String::append_char(__local_38, 117); - String::append_char(__local_38, 108); - String::append_char(__local_38, 116); - String::append_char(__local_38, 58); - String::append_char(__local_38, 32); + String::push(__local_38, 114); + String::push(__local_38, 101); + String::push(__local_38, 115); + String::push(__local_38, 117); + String::push(__local_38, 108); + String::push(__local_38, 116); + String::push(__local_38, 58); + String::push(__local_38, 32); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_110 = __local_39; i32::fmt_decimal(result, __local_110); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_40, 114); - String::append_char(__local_40, 101); - String::append_char(__local_40, 115); - String::append_char(__local_40, 117); - String::append_char(__local_40, 108); - String::append_char(__local_40, 116); - String::append_char(__local_40, 58); - String::append_char(__local_40, 32); + String::push(__local_40, 114); + String::push(__local_40, 101); + String::push(__local_40, 115); + String::push(__local_40, 117); + String::push(__local_40, 108); + String::push(__local_40, 116); + String::push(__local_40, 58); + String::push(__local_40, 32); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; i32::fmt_decimal(result, __local_41); break __tmpl: __local_40; @@ -377,39 +377,39 @@ condition: result == 200 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_42, 114); - String::append_char(__local_42, 117); - String::append_char(__local_42, 110); - String::append_char(__local_42, 32); - String::append_char(__local_42, 97); - String::append_char(__local_42, 116); - String::append_char(__local_42, 32); - String::append(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); - String::append_char(__local_42, 58); + String::push_str(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_42, 114); + String::push(__local_42, 117); + String::push(__local_42, 110); + String::push(__local_42, 32); + String::push(__local_42, 97); + String::push(__local_42, 116); + String::push(__local_42, 32); + String::push_str(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); + String::push(__local_42, 58); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_122 = __local_43; i32::fmt_decimal(36, __local_122); - String::append(__local_42, String { repr: array.new_data(" + String::push_str(__local_42, String { repr: array.new_data(" condition: orig == 100 "), used: 24 }); - String::append_char(__local_42, 111); - String::append_char(__local_42, 114); - String::append_char(__local_42, 105); - String::append_char(__local_42, 103); - String::append_char(__local_42, 58); - String::append_char(__local_42, 32); + String::push(__local_42, 111); + String::push(__local_42, 114); + String::push(__local_42, 105); + String::push(__local_42, 103); + String::push(__local_42, 58); + String::push(__local_42, 32); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_127 = __local_43; i32::fmt_decimal(orig_12, __local_127); - String::append_char(__local_42, 10); + String::push(__local_42, 10); break __tmpl: __local_42; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_44, String { repr: array.new_data("original: "), used: 10 }); + String::push_str(__local_44, String { repr: array.new_data("original: "), used: 10 }); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; i32::fmt_decimal(orig_12, __local_45); break __tmpl: __local_44; @@ -418,47 +418,47 @@ condition: orig == 100 opt_str = String { repr: array.new_data("hello"), used: 5 }; if ref.is_null(opt_str) == 0 { s = value_copy String(ref.as_non_null(opt_str)); - String::append_char(s, 32); - String::append_char(s, 119); - String::append_char(s, 111); - String::append_char(s, 114); - String::append_char(s, 108); - String::append_char(s, 100); + String::push(s, 32); + String::push(s, 119); + String::push(s, 111); + String::push(s, 114); + String::push(s, 108); + String::push(s, 100); __v0_17 = s; __cond_18 = String^Eq::eq(__v0_17, String { repr: array.new_data("hello world"), used: 11 }); if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_46 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_46, 114); - String::append_char(__local_46, 117); - String::append_char(__local_46, 110); - String::append_char(__local_46, 32); - String::append_char(__local_46, 97); - String::append_char(__local_46, 116); - String::append_char(__local_46, 32); - String::append(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); - String::append_char(__local_46, 58); + String::push_str(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_46, 114); + String::push(__local_46, 117); + String::push(__local_46, 110); + String::push(__local_46, 32); + String::push(__local_46, 97); + String::push(__local_46, 116); + String::push(__local_46, 32); + String::push_str(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); + String::push(__local_46, 58); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_139 = __local_47; i32::fmt_decimal(44, __local_139); - String::append(__local_46, String { repr: array.new_data(" + String::push_str(__local_46, String { repr: array.new_data(" condition: s == \"hello world\" "), used: 31 }); - String::append_char(__local_46, 115); - String::append_char(__local_46, 58); - String::append_char(__local_46, 32); + String::push(__local_46, 115); + String::push(__local_46, 58); + String::push(__local_46, 32); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; String^Inspect::inspect(__v0_17, __local_47); - String::append_char(__local_46, 10); + String::push(__local_46, 10); break __tmpl: __local_46; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_48 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_48, String { repr: array.new_data("mutated: "), used: 9 }); - String::append(__local_48, s); + String::push_str(__local_48, String { repr: array.new_data("mutated: "), used: 9 }); + String::push_str(__local_48, s); break __tmpl: __local_48; }); }; @@ -469,39 +469,39 @@ condition: s == \"hello world\" if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_49 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_49, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_49, 114); - String::append_char(__local_49, 117); - String::append_char(__local_49, 110); - String::append_char(__local_49, 32); - String::append_char(__local_49, 97); - String::append_char(__local_49, 116); - String::append_char(__local_49, 32); - String::append(__local_49, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); - String::append_char(__local_49, 58); + String::push_str(__local_49, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_49, 114); + String::push(__local_49, 117); + String::push(__local_49, 110); + String::push(__local_49, 32); + String::push(__local_49, 97); + String::push(__local_49, 116); + String::push(__local_49, 32); + String::push_str(__local_49, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); + String::push(__local_49, 58); __local_50 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_49 }; __local_147 = __local_50; i32::fmt_decimal(48, __local_147); - String::append(__local_49, String { repr: array.new_data(" + String::push_str(__local_49, String { repr: array.new_data(" condition: orig == \"hello\" "), used: 28 }); - String::append_char(__local_49, 111); - String::append_char(__local_49, 114); - String::append_char(__local_49, 105); - String::append_char(__local_49, 103); - String::append_char(__local_49, 58); - String::append_char(__local_49, 32); + String::push(__local_49, 111); + String::push(__local_49, 114); + String::push(__local_49, 105); + String::push(__local_49, 103); + String::push(__local_49, 58); + String::push(__local_49, 32); __local_50 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_49 }; String^Inspect::inspect(__v0_20, __local_50); - String::append_char(__local_49, 10); + String::push(__local_49, 10); break __tmpl: __local_49; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_51 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_51, String { repr: array.new_data("original: "), used: 10 }); - String::append(__local_51, orig_19); + String::push_str(__local_51, String { repr: array.new_data("original: "), used: 10 }); + String::push_str(__local_51, orig_19); break __tmpl: __local_51; }); }; @@ -511,40 +511,40 @@ condition: orig == \"hello\" }); if ref.is_null(opt_arr) == 0 { arr = value_copy Array(ref.as_non_null(opt_arr)); - Array::append(arr, 4); + Array::push(arr, 4); __v0_25 = arr.used; __cond_26 = __v0_25 == 4; if __cond_26 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_52 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_52, 114); - String::append_char(__local_52, 117); - String::append_char(__local_52, 110); - String::append_char(__local_52, 32); - String::append_char(__local_52, 97); - String::append_char(__local_52, 116); - String::append_char(__local_52, 32); - String::append(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); - String::append_char(__local_52, 58); + String::push_str(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_52, 114); + String::push(__local_52, 117); + String::push(__local_52, 110); + String::push(__local_52, 32); + String::push(__local_52, 97); + String::push(__local_52, 116); + String::push(__local_52, 32); + String::push_str(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); + String::push(__local_52, 58); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_165 = __local_53; i32::fmt_decimal(56, __local_165); - String::append(__local_52, String { repr: array.new_data(" + String::push_str(__local_52, String { repr: array.new_data(" condition: arr.len() == 4 "), used: 27 }); - String::append(__local_52, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_52, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_170 = __local_53; i32::fmt_decimal(__v0_25, __local_170); - String::append_char(__local_52, 10); + String::push(__local_52, 10); break __tmpl: __local_52; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_54 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_54, String { repr: array.new_data("mutated len: "), used: 13 }); + String::push_str(__local_54, String { repr: array.new_data("mutated len: "), used: 13 }); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; i32::fmt_decimal(arr.used, __local_55); break __tmpl: __local_54; @@ -557,34 +557,34 @@ condition: arr.len() == 4 if __cond_29 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_56 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_56, 114); - String::append_char(__local_56, 117); - String::append_char(__local_56, 110); - String::append_char(__local_56, 32); - String::append_char(__local_56, 97); - String::append_char(__local_56, 116); - String::append_char(__local_56, 32); - String::append(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); - String::append_char(__local_56, 58); + String::push_str(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_56, 114); + String::push(__local_56, 117); + String::push(__local_56, 110); + String::push(__local_56, 32); + String::push(__local_56, 97); + String::push(__local_56, 116); + String::push(__local_56, 32); + String::push_str(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/pattern_mut_binding.wado"), used: 53 }); + String::push(__local_56, 58); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_184 = __local_57; i32::fmt_decimal(60, __local_184); - String::append(__local_56, String { repr: array.new_data(" + String::push_str(__local_56, String { repr: array.new_data(" condition: orig.len() == 3 "), used: 28 }); - String::append(__local_56, String { repr: array.new_data("orig.len(): "), used: 12 }); + String::push_str(__local_56, String { repr: array.new_data("orig.len(): "), used: 12 }); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_189 = __local_57; i32::fmt_decimal(__v0_28, __local_189); - String::append_char(__local_56, 10); + String::push(__local_56, 10); break __tmpl: __local_56; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_58 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_58, String { repr: array.new_data("original len: "), used: 14 }); + String::push_str(__local_58, String { repr: array.new_data("original len: "), used: 14 }); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; i32::fmt_decimal(orig_27.used, __local_59); break __tmpl: __local_58; @@ -824,7 +824,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -912,7 +912,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -939,7 +939,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -992,7 +992,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l54; }; @@ -1026,20 +1026,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1049,10 +1049,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1062,10 +1062,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1073,10 +1073,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1088,7 +1088,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1105,22 +1105,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b73; @@ -1128,7 +1128,7 @@ fn String^Inspect::inspect(self, f) { continue l74; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/precedence_merged.wir.wado b/wado-compiler/tests/fixtures.golden/precedence_merged.wir.wado index 4de80d846..3129a0493 100644 --- a/wado-compiler/tests/fixtures.golden/precedence_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/precedence_merged.wir.wado @@ -101,7 +101,7 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -109,9 +109,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -173,27 +173,27 @@ fn __test_1_assignment_precedence() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_44, String { repr: array.new_data("__test_1_assignment_precedence"), used: 30 }); - String::append_char(__local_44, 32); - String::append_char(__local_44, 97); - String::append_char(__local_44, 116); - String::append_char(__local_44, 32); - String::append(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/precedence_merged.wado"), used: 51 }); - String::append_char(__local_44, 58); + String::push_str(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_44, String { repr: array.new_data("__test_1_assignment_precedence"), used: 30 }); + String::push(__local_44, 32); + String::push(__local_44, 97); + String::push(__local_44, 116); + String::push(__local_44, 32); + String::push_str(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/precedence_merged.wado"), used: 51 }); + String::push(__local_44, 58); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_130 = __local_45; i32::fmt_decimal(40, __local_130); - String::append(__local_44, String { repr: array.new_data(" + String::push_str(__local_44, String { repr: array.new_data(" condition: h == 42 "), used: 20 }); - String::append_char(__local_44, 104); - String::append_char(__local_44, 58); - String::append_char(__local_44, 32); + String::push(__local_44, 104); + String::push(__local_44, 58); + String::push(__local_44, 32); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_135 = __local_45; i32::fmt_decimal(__v0, __local_135); - String::append_char(__local_44, 10); + String::push(__local_44, 10); break __tmpl: __local_44; }); unreachable; @@ -503,7 +503,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -599,7 +599,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -614,7 +614,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -652,7 +652,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l45; }; @@ -686,20 +686,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -709,10 +709,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -722,10 +722,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -733,10 +733,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/primitive_arithmetic.wir.wado b/wado-compiler/tests/fixtures.golden/primitive_arithmetic.wir.wado index e17090dd1..ec50aad60 100644 --- a/wado-compiler/tests/fixtures.golden/primitive_arithmetic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/primitive_arithmetic.wir.wado @@ -111,7 +111,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -121,9 +121,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -191,50 +191,50 @@ fn arithmetic_i32() with Stdout { let __local_11: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_2, 97); - String::append_char(__local_2, 100); - String::append_char(__local_2, 100); - String::append_char(__local_2, 61); + String::push(__local_2, 97); + String::push(__local_2, 100); + String::push(__local_2, 100); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(55, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_4, 115); - String::append_char(__local_4, 117); - String::append_char(__local_4, 98); - String::append_char(__local_4, 61); + String::push(__local_4, 115); + String::push(__local_4, 117); + String::push(__local_4, 98); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(29, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_6, 109); - String::append_char(__local_6, 117); - String::append_char(__local_6, 108); - String::append_char(__local_6, 61); + String::push(__local_6, 109); + String::push(__local_6, 117); + String::push(__local_6, 108); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(546, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_8, 100); - String::append_char(__local_8, 105); - String::append_char(__local_8, 118); - String::append_char(__local_8, 61); + String::push(__local_8, 100); + String::push(__local_8, 105); + String::push(__local_8, 118); + String::push(__local_8, 61); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(3, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_10, 109); - String::append_char(__local_10, 111); - String::append_char(__local_10, 100); - String::append_char(__local_10, 61); + String::push(__local_10, 109); + String::push(__local_10, 111); + String::push(__local_10, 100); + String::push(__local_10, 61); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(3, __local_11); break __tmpl: __local_10; @@ -248,20 +248,20 @@ fn arithmetic_i64() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_2, 109); - String::append_char(__local_2, 117); - String::append_char(__local_2, 108); - String::append_char(__local_2, 61); + String::push(__local_2, 109); + String::push(__local_2, 117); + String::push(__local_2, 108); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i64::fmt_decimal(3000000000_i64, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_4, 100); - String::append_char(__local_4, 105); - String::append_char(__local_4, 118); - String::append_char(__local_4, 61); + String::push(__local_4, 100); + String::push(__local_4, 105); + String::push(__local_4, 118); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i64::fmt_decimal(333333333_i64, __local_5); break __tmpl: __local_4; @@ -277,30 +277,30 @@ fn arithmetic_f64() with Stdout { let __local_7: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_2, 97); - String::append_char(__local_2, 100); - String::append_char(__local_2, 100); - String::append_char(__local_2, 61); + String::push(__local_2, 97); + String::push(__local_2, 100); + String::push(__local_2, 100); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(5.140000000000001, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_4, 109); - String::append_char(__local_4, 117); - String::append_char(__local_4, 108); - String::append_char(__local_4, 61); + String::push(__local_4, 109); + String::push(__local_4, 117); + String::push(__local_4, 108); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; f64::fmt_into(6.28, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_6, 100); - String::append_char(__local_6, 105); - String::append_char(__local_6, 118); - String::append_char(__local_6, 61); + String::push(__local_6, 100); + String::push(__local_6, 105); + String::push(__local_6, 118); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; f64::fmt_into(1.57, __local_7); break __tmpl: __local_6; @@ -320,45 +320,45 @@ fn compound_assignments() with Stdout { let __local_10: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_1, 43); - String::append_char(__local_1, 61); - String::append_char(__local_1, 32); + String::push(__local_1, 43); + String::push(__local_1, 61); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(15, __local_2); break __tmpl: __local_1; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_3, 45); - String::append_char(__local_3, 61); - String::append_char(__local_3, 32); + String::push(__local_3, 45); + String::push(__local_3, 61); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(12, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_5, 42); - String::append_char(__local_5, 61); - String::append_char(__local_5, 32); + String::push(__local_5, 42); + String::push(__local_5, 61); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(24, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_7, 47); - String::append_char(__local_7, 61); - String::append_char(__local_7, 32); + String::push(__local_7, 47); + String::push(__local_7, 61); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(6, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_9, 37); - String::append_char(__local_9, 61); - String::append_char(__local_9, 32); + String::push(__local_9, 37); + String::push(__local_9, 61); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(2, __local_10); break __tmpl: __local_9; @@ -378,47 +378,47 @@ fn compound_bitwise() with Stdout { let __local_11: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_2, 38); - String::append_char(__local_2, 61); - String::append_char(__local_2, 32); + String::push(__local_2, 38); + String::push(__local_2, 61); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(15, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 124); - String::append_char(__local_4, 61); - String::append_char(__local_4, 32); + String::push(__local_4, 124); + String::push(__local_4, 61); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(255, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_6, 94); - String::append_char(__local_6, 61); - String::append_char(__local_6, 32); + String::push(__local_6, 94); + String::push(__local_6, 61); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(0, __local_7); break __tmpl: __local_6; }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_8, 60); - String::append_char(__local_8, 60); - String::append_char(__local_8, 61); - String::append_char(__local_8, 32); + String::push(__local_8, 60); + String::push(__local_8, 60); + String::push(__local_8, 61); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(16, __local_9); break __tmpl: __local_8; }); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_10, 62); - String::append_char(__local_10, 62); - String::append_char(__local_10, 61); - String::append_char(__local_10, 32); + String::push(__local_10, 62); + String::push(__local_10, 62); + String::push(__local_10, 61); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(4, __local_11); break __tmpl: __local_10; @@ -438,13 +438,13 @@ fn chained_comparison() with Stdout { let __local_12: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_3, 49); - String::append_char(__local_3, 60); - String::append_char(__local_3, 50); - String::append_char(__local_3, 60); - String::append_char(__local_3, 51); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 49); + String::push(__local_3, 60); + String::push(__local_3, 50); + String::push(__local_3, 60); + String::push(__local_3, 51); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; Formatter::pad(__local_4, block -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -453,11 +453,11 @@ fn chained_comparison() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_5, 49); - String::append_char(__local_5, 60); - String::append_char(__local_5, 50); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 49); + String::push(__local_5, 60); + String::push(__local_5, 50); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; Formatter::pad(__local_6, block -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -466,11 +466,11 @@ fn chained_comparison() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 50); - String::append_char(__local_7, 62); - String::append_char(__local_7, 51); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 50); + String::push(__local_7, 62); + String::push(__local_7, 51); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; Formatter::pad(__local_8, block -> ref String { String { repr: array.new_data("false"), used: 5 }; @@ -479,12 +479,12 @@ fn chained_comparison() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 49); - String::append_char(__local_9, 60); - String::append_char(__local_9, 61); - String::append_char(__local_9, 49); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 49); + String::push(__local_9, 60); + String::push(__local_9, 61); + String::push(__local_9, 49); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; Formatter::pad(__local_10, block -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -493,12 +493,12 @@ fn chained_comparison() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 51); - String::append_char(__local_11, 62); - String::append_char(__local_11, 61); - String::append_char(__local_11, 51); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 51); + String::push(__local_11, 62); + String::push(__local_11, 61); + String::push(__local_11, 51); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; Formatter::pad(__local_12, block -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -516,20 +516,20 @@ fn negation_and_not() with Stdout { let __local_8: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_3, 110); - String::append_char(__local_3, 101); - String::append_char(__local_3, 103); - String::append_char(__local_3, 61); + String::push(__local_3, 110); + String::push(__local_3, 101); + String::push(__local_3, 103); + String::push(__local_3, 61); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(-42, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_5, 110); - String::append_char(__local_5, 111); - String::append_char(__local_5, 116); - String::append_char(__local_5, 61); + String::push(__local_5, 110); + String::push(__local_5, 111); + String::push(__local_5, 116); + String::push(__local_5, 61); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; Formatter::pad(__local_6, block -> ref String { String { repr: array.new_data("false"), used: 5 }; @@ -538,13 +538,13 @@ fn negation_and_not() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_7, 98); - String::append_char(__local_7, 105); - String::append_char(__local_7, 116); - String::append_char(__local_7, 110); - String::append_char(__local_7, 111); - String::append_char(__local_7, 116); - String::append_char(__local_7, 61); + String::push(__local_7, 98); + String::push(__local_7, 105); + String::push(__local_7, 116); + String::push(__local_7, 110); + String::push(__local_7, 111); + String::push(__local_7, 116); + String::push(__local_7, 61); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(-241, __local_8); break __tmpl: __local_7; @@ -565,7 +565,7 @@ fn type_conversions() with Stdout { f = builtin::f64_convert_i32_s(42); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_8, String { repr: array.new_data("i32->f64: "), used: 10 }); + String::push_str(__local_8, String { repr: array.new_data("i32->f64: "), used: 10 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; f64::fmt_into(f, __local_9); break __tmpl: __local_8; @@ -573,21 +573,21 @@ fn type_conversions() with Stdout { i2 = builtin::i32_trunc_f64_s(3.99); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_10, String { repr: array.new_data("f64->i32: "), used: 10 }); + String::push_str(__local_10, String { repr: array.new_data("f64->i32: "), used: 10 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(i2, __local_11); break __tmpl: __local_10; }); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_12, String { repr: array.new_data("i8->i32: "), used: 9 }); + String::push_str(__local_12, String { repr: array.new_data("i8->i32: "), used: 9 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(127, __local_13); break __tmpl: __local_12; }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_14, String { repr: array.new_data("u32->i64: "), used: 10 }); + String::push_str(__local_14, String { repr: array.new_data("u32->i64: "), used: 10 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i64::fmt_decimal(255_i64, __local_15); break __tmpl: __local_14; @@ -1387,8 +1387,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1443,8 +1443,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1476,7 +1476,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1605,27 +1605,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1785,9 +1785,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1841,13 +1841,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1882,9 +1882,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1937,7 +1937,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1952,7 +1952,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1990,7 +1990,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l162; }; @@ -2010,7 +2010,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2018,17 +2018,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2182,20 +2182,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2205,10 +2205,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2218,10 +2218,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2229,10 +2229,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/pub_struct_field_access_ok.wir.wado b/wado-compiler/tests/fixtures.golden/pub_struct_field_access_ok.wir.wado index 3fc88ecd7..0e04fba5c 100644 --- a/wado-compiler/tests/fixtures.golden/pub_struct_field_access_ok.wir.wado +++ b/wado-compiler/tests/fixtures.golden/pub_struct_field_access_ok.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -313,7 +313,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -328,7 +328,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -366,7 +366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -400,20 +400,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/pub_struct_field_same_module.wir.wado b/wado-compiler/tests/fixtures.golden/pub_struct_field_same_module.wir.wado index ae841a868..c5bc3c5d4 100644 --- a/wado-compiler/tests/fixtures.golden/pub_struct_field_same_module.wir.wado +++ b/wado-compiler/tests/fixtures.golden/pub_struct_field_same_module.wir.wado @@ -83,13 +83,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Secret::describe" = fn(ref Secret) -> ref String; @@ -138,26 +138,26 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/pub_struct_field_same_module.wado"), used: 62 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/pub_struct_field_same_module.wado"), used: 62 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_27 = __local_9; i32::fmt_decimal(21, __local_27); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: s.label == \"answer\" "), used: 32 }); - String::append(__local_8, String { repr: array.new_data("s.label: "), used: 9 }); + String::push_str(__local_8, String { repr: array.new_data("s.label: "), used: 9 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -403,7 +403,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -491,7 +491,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -523,9 +523,9 @@ fn Secret::describe(self) { let __local_2: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_1, self.label); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push_str(__local_1, self.label); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(self.value, __local_2); break __tmpl: __local_1; @@ -543,7 +543,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -577,20 +577,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -600,10 +600,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -613,10 +613,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -624,10 +624,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -639,7 +639,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -656,22 +656,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b53; @@ -679,7 +679,7 @@ fn String^Inspect::inspect(self, f) { continue l54; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/ref_1.wir.wado b/wado-compiler/tests/fixtures.golden/ref_1.wir.wado index 5c799b4c3..b7bb24ef4 100644 --- a/wado-compiler/tests/fixtures.golden/ref_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/ref_1.wir.wado @@ -158,7 +158,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -168,11 +168,11 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -243,14 +243,14 @@ fn maybe_read(r) { v = ref.cast Option::Some(__pattern_temp_0).payload_0; return __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_2, 115); - String::append_char(__local_2, 111); - String::append_char(__local_2, 109); - String::append_char(__local_2, 101); - String::append_char(__local_2, 40); + String::push(__local_2, 115); + String::push(__local_2, 111); + String::push(__local_2, 109); + String::push(__local_2, 101); + String::push(__local_2, 40); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); - String::append_char(__local_2, 41); + String::push(__local_2, 41); break __tmpl: __local_2; }; }; @@ -262,12 +262,12 @@ fn read_and_format(r) { let __local_2: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_1, 118); - String::append_char(__local_1, 97); - String::append_char(__local_1, 108); - String::append_char(__local_1, 117); - String::append_char(__local_1, 101); - String::append_char(__local_1, 61); + String::push(__local_1, 118); + String::push(__local_1, 97); + String::push(__local_1, 108); + String::push(__local_1, 117); + String::push(__local_1, 101); + String::push(__local_1, 61); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(r, __local_2); break __tmpl: __local_1; @@ -329,14 +329,14 @@ fn ref_primitive_semantic() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_2, String { repr: array.new_data("original="), used: 9 }); + String::push_str(__local_2, String { repr: array.new_data("original="), used: 9 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(result, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_4, String { repr: array.new_data("modified="), used: 9 }); + String::push_str(__local_4, String { repr: array.new_data("modified="), used: 9 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(a.value, __local_5); break __tmpl: __local_4; @@ -368,11 +368,11 @@ fn ref_primitive_types() with Stdout { a = "core:internal/Box" { value: 100_i64 }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_3, 105); - String::append_char(__local_3, 54); - String::append_char(__local_3, 52); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 105); + String::push(__local_3, 54); + String::push(__local_3, 52); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_17 = "core:internal/Box" { value: a.value }; i64::fmt_decimal(__local_17.value, __local_4); @@ -382,11 +382,11 @@ fn ref_primitive_types() with Stdout { r_22.value = 200_i64; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_5, 105); - String::append_char(__local_5, 54); - String::append_char(__local_5, 52); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 105); + String::push(__local_5, 54); + String::push(__local_5, 52); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i64::fmt_decimal(a.value, __local_6); break __tmpl: __local_5; @@ -394,11 +394,11 @@ fn ref_primitive_types() with Stdout { b = "core:internal/Box" { value: 3.14 }; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 102); - String::append_char(__local_7, 54); - String::append_char(__local_7, 52); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 102); + String::push(__local_7, 54); + String::push(__local_7, 52); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_32 = "core:internal/Box" { value: b.value }; f64::fmt_into(__local_32.value, __local_8); @@ -408,11 +408,11 @@ fn ref_primitive_types() with Stdout { r_35.value = 2.718; "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_9, 102); - String::append_char(__local_9, 54); - String::append_char(__local_9, 52); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 102); + String::push(__local_9, 54); + String::push(__local_9, 52); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; f64::fmt_into(b.value, __local_10); break __tmpl: __local_9; @@ -420,12 +420,12 @@ fn ref_primitive_types() with Stdout { c = "core:internal/Box" { value: 1 }; "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 98); - String::append_char(__local_11, 111); - String::append_char(__local_11, 111); - String::append_char(__local_11, 108); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 98); + String::push(__local_11, 111); + String::push(__local_11, 111); + String::push(__local_11, 108); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_43 = "core:internal/Box" { value: c.value }; Formatter::pad(__local_12, if __local_43.value -> ref String { @@ -439,12 +439,12 @@ fn ref_primitive_types() with Stdout { r_48.value = 0; "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_13, 98); - String::append_char(__local_13, 111); - String::append_char(__local_13, 111); - String::append_char(__local_13, 108); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 98); + String::push(__local_13, 111); + String::push(__local_13, 111); + String::push(__local_13, 108); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; Formatter::pad(__local_14, if c.value -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -469,7 +469,7 @@ fn ref_deref_assign_struct() with Stdout { __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_8 = __local_2; i32::fmt_decimal(10, __local_8); - String::append_char(__local_1, 44); + String::push(__local_1, 44); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_13 = __local_2; i32::fmt_decimal(20, __local_13); @@ -480,7 +480,7 @@ fn ref_deref_assign_struct() with Stdout { __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_19 = __local_4; i32::fmt_decimal(0, __local_19); - String::append_char(__local_3, 44); + String::push(__local_3, 44); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_24 = __local_4; i32::fmt_decimal(0, __local_24); @@ -517,7 +517,7 @@ fn ref_deref_reassign() with Stdout { r.value = (val * 2) + 1; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_5, String { repr: array.new_data("modified: "), used: 10 }); + String::push_str(__local_5, String { repr: array.new_data("modified: "), used: 10 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(original.value, __local_6); break __tmpl: __local_5; @@ -526,19 +526,19 @@ fn ref_deref_reassign() with Stdout { r.value = 0; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_7, String { repr: array.new_data("original: "), used: 10 }); + String::push_str(__local_7, String { repr: array.new_data("original: "), used: 10 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(original.value, __local_8); break __tmpl: __local_7; }); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_9, 99); - String::append_char(__local_9, 111); - String::append_char(__local_9, 112); - String::append_char(__local_9, 121); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 99); + String::push(__local_9, 111); + String::push(__local_9, 112); + String::push(__local_9, 121); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(__sroa_val2_value, __local_10); break __tmpl: __local_9; @@ -561,7 +561,7 @@ fn ref_alias_mut() with Stdout { r1.value = 10; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_3, String { repr: array.new_data("after r1: "), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("after r1: "), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(x.value, __local_4); break __tmpl: __local_3; @@ -569,7 +569,7 @@ fn ref_alias_mut() with Stdout { r2.value = 20; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_5, String { repr: array.new_data("after r2: "), used: 10 }); + String::push_str(__local_5, String { repr: array.new_data("after r2: "), used: 10 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(x.value, __local_6); break __tmpl: __local_5; @@ -577,13 +577,13 @@ fn ref_alias_mut() with Stdout { r1.value = (r1.value + r2.value) + 5; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_7, 102); - String::append_char(__local_7, 105); - String::append_char(__local_7, 110); - String::append_char(__local_7, 97); - String::append_char(__local_7, 108); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 102); + String::push(__local_7, 105); + String::push(__local_7, 110); + String::push(__local_7, 97); + String::push(__local_7, 108); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(x.value, __local_8); break __tmpl: __local_7; @@ -608,19 +608,19 @@ fn ref_swap_test() with Stdout { y = "core:internal/Box" { value: 2 }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(42), used: 0 }; - String::append_char(__local_2, 98); - String::append_char(__local_2, 101); - String::append_char(__local_2, 102); - String::append_char(__local_2, 111); - String::append_char(__local_2, 114); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 98); + String::push(__local_2, 101); + String::push(__local_2, 102); + String::push(__local_2, 111); + String::push(__local_2, 114); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_9 = __local_3; i32::fmt_decimal(x.value, __local_9); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_14 = __local_3; i32::fmt_decimal(y.value, __local_14); @@ -633,18 +633,18 @@ fn ref_swap_test() with Stdout { b.value = tmp; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(41), used: 0 }; - String::append_char(__local_4, 97); - String::append_char(__local_4, 102); - String::append_char(__local_4, 116); - String::append_char(__local_4, 101); - String::append_char(__local_4, 114); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 102); + String::push(__local_4, 116); + String::push(__local_4, 101); + String::push(__local_4, 114); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_23 = __local_5; i32::fmt_decimal(x.value, __local_23); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); + String::push(__local_4, 44); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_28 = __local_5; i32::fmt_decimal(y.value, __local_28); @@ -706,27 +706,27 @@ fn ref_tuple_basic_test() with Stdout { let __local_6: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_3, 98); - String::append_char(__local_3, 101); - String::append_char(__local_3, 102); - String::append_char(__local_3, 111); - String::append_char(__local_3, 114); - String::append_char(__local_3, 101); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 98); + String::push(__local_3, 101); + String::push(__local_3, 102); + String::push(__local_3, 111); + String::push(__local_3, 114); + String::push(__local_3, 101); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(1, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_5, 97); - String::append_char(__local_5, 102); - String::append_char(__local_5, 116); - String::append_char(__local_5, 101); - String::append_char(__local_5, 114); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 102); + String::push(__local_5, 116); + String::push(__local_5, 101); + String::push(__local_5, 114); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(100, __local_6); break __tmpl: __local_5; @@ -1590,8 +1590,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1646,8 +1646,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1679,7 +1679,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1808,27 +1808,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1988,9 +1988,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -2044,13 +2044,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2085,9 +2085,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2140,7 +2140,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2155,7 +2155,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2182,7 +2182,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2235,7 +2235,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l163; }; @@ -2255,7 +2255,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2263,17 +2263,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2427,20 +2427,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2450,10 +2450,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2463,10 +2463,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2474,10 +2474,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/ref_2.wir.wado b/wado-compiler/tests/fixtures.golden/ref_2.wir.wado index e5213faf0..c8ce9c244 100644 --- a/wado-compiler/tests/fixtures.golden/ref_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/ref_2.wir.wado @@ -110,15 +110,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -228,18 +228,18 @@ fn process(arr, input, count) { break __inline_Array_u8__IndexValue__index_value_0: builtin::array_get(_licm_repr_15, __local_8); }; if val ::append(arr, val); + Array::push(arr, val); } else { dist = (val - 128) & 255; src = arr.used - dist; - Array::append(arr, __inline_Array_u8__IndexValue__index_value_2: block -> u8 { + Array::push(arr, __inline_Array_u8__IndexValue__index_value_2: block -> u8 { if src >= arr.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); unreachable; }; break __inline_Array_u8__IndexValue__index_value_2: builtin::array_get(arr.repr, src); }); - Array::append(arr, __inline_Array_u8__IndexValue__index_value_3: block -> u8 { + Array::push(arr, __inline_Array_u8__IndexValue__index_value_3: block -> u8 { __local_13 = src + 1; if __local_13 >= arr.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -274,25 +274,25 @@ fn ref_mut_array_ops() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_3, 108); - String::append_char(__local_3, 101); - String::append_char(__local_3, 110); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 108); + String::push(__local_3, 101); + String::push(__local_3, 110); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(nums.used, __local_4); break __tmpl: __local_3; }); arr = nums; - Array::append(arr, 4); - Array::append(arr, 5); + Array::push(arr, 4); + Array::push(arr, 5); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_5, 108); - String::append_char(__local_5, 101); - String::append_char(__local_5, 110); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 108); + String::push(__local_5, 101); + String::push(__local_5, 110); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(nums.used, __local_6); break __tmpl: __local_5; @@ -329,20 +329,20 @@ fn ref_mut_string() with Stdout { let s_3: ref String; let suffix: ref String; msg = String { repr: array.new_data("Hello"), used: 5 }; - String::append_char(msg, 44); - String::append_char(msg, 32); - String::append_char(msg, 87); - String::append_char(msg, 111); - String::append_char(msg, 114); - String::append_char(msg, 108); - String::append_char(msg, 100); - String::append_char(msg, 33); + String::push(msg, 44); + String::push(msg, 32); + String::push(msg, 87); + String::push(msg, 111); + String::push(msg, 114); + String::push(msg, 108); + String::push(msg, 100); + String::push(msg, 33); "core:cli/println"(msg); s_1 = String { repr: array.new_data("a"), used: 1 }; s_3 = s_1; suffix = String { repr: array.new_data("b"), used: 1 }; - String::append(s_3, suffix); - String::append(s_3, suffix); + String::push_str(s_3, suffix); + String::push_str(s_3, suffix); "core:cli/println"(s_1); } @@ -358,7 +358,7 @@ fn ref_loop_mut_test() with Stdout { accumulate(sum, 5); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_3, String { repr: array.new_data("sum 0..4: "), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("sum 0..4: "), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(sum.value, __local_4); break __tmpl: __local_3; @@ -376,13 +376,13 @@ fn ref_loop_mut_test() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_5, 99); - String::append_char(__local_5, 111); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 116); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 99); + String::push(__local_5, 111); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 116); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(count.value, __local_6); break __tmpl: __local_5; @@ -403,7 +403,7 @@ fn ref_conditional_mut_test() with Stdout { clamp(a, 0, 100); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_3, String { repr: array.new_data("clamped 50: "), used: 12 }); + String::push_str(__local_3, String { repr: array.new_data("clamped 50: "), used: 12 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(a.value, __local_4); break __tmpl: __local_3; @@ -412,7 +412,7 @@ fn ref_conditional_mut_test() with Stdout { clamp(b, 0, 100); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_5, String { repr: array.new_data("clamped -10: "), used: 13 }); + String::push_str(__local_5, String { repr: array.new_data("clamped -10: "), used: 13 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(b.value, __local_6); break __tmpl: __local_5; @@ -421,7 +421,7 @@ fn ref_conditional_mut_test() with Stdout { clamp(c, 0, 100); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_7, String { repr: array.new_data("clamped 200: "), used: 13 }); + String::push_str(__local_7, String { repr: array.new_data("clamped 200: "), used: 13 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(c.value, __local_8); break __tmpl: __local_7; @@ -446,11 +446,11 @@ fn ref_mut_while_condition_test() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_1, 112); - String::append_char(__local_1, 111); - String::append_char(__local_1, 115); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 112); + String::push(__local_1, 111); + String::push(__local_1, 115); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(pos_0.value, __local_2); break __tmpl: __local_1; @@ -467,37 +467,37 @@ fn ref_nested_mut_write_test() with Stdout { __sroa___sroa_data_middle_label = String { repr: array.new_data("initial"), used: 7 }; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(42), used: 0 }; - String::append_char(__local_1, 98); - String::append_char(__local_1, 101); - String::append_char(__local_1, 102); - String::append_char(__local_1, 111); - String::append_char(__local_1, 114); - String::append_char(__local_1, 101); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 98); + String::push(__local_1, 101); + String::push(__local_1, 102); + String::push(__local_1, 111); + String::push(__local_1, 114); + String::push(__local_1, 101); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(0, __local_2); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); - String::append(__local_1, __sroa___sroa_data_middle_label); + String::push(__local_1, 44); + String::push(__local_1, 32); + String::push_str(__local_1, __sroa___sroa_data_middle_label); break __tmpl: __local_1; }); s = String { repr: array.new_data("updated"), used: 7 }; __sroa___sroa_data_middle_label = s; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(41), used: 0 }; - String::append_char(__local_3, 97); - String::append_char(__local_3, 102); - String::append_char(__local_3, 116); - String::append_char(__local_3, 101); - String::append_char(__local_3, 114); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 102); + String::push(__local_3, 116); + String::push(__local_3, 101); + String::push(__local_3, 114); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(42, __local_4); - String::append_char(__local_3, 44); - String::append_char(__local_3, 32); - String::append(__local_3, __sroa___sroa_data_middle_label); + String::push(__local_3, 44); + String::push(__local_3, 32); + String::push_str(__local_3, __sroa___sroa_data_middle_label); break __tmpl: __local_3; }); } @@ -526,11 +526,11 @@ fn ref_mut_array_append_complex_test() with Stdout { process(out, input, 4); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_5, 108); - String::append_char(__local_5, 101); - String::append_char(__local_5, 110); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 108); + String::push(__local_5, 101); + String::push(__local_5, 110); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(out.used, __local_6); break __tmpl: __local_5; @@ -808,7 +808,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -823,7 +823,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -850,7 +850,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -892,7 +892,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -945,7 +945,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l59; }; @@ -979,20 +979,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1002,10 +1002,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1015,10 +1015,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1026,10 +1026,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/ref_3.wir.wado b/wado-compiler/tests/fixtures.golden/ref_3.wir.wado index 1e89bc243..fabd40927 100644 --- a/wado-compiler/tests/fixtures.golden/ref_3.wir.wado +++ b/wado-compiler/tests/fixtures.golden/ref_3.wir.wado @@ -123,11 +123,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -167,7 +167,7 @@ fn print_basic_point(p) with Stdout { __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_6 = __local_2; i32::fmt_decimal(p.x, __local_6); - String::append_char(__local_1, 44); + String::push(__local_1, 44); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_11 = __local_2; i32::fmt_decimal(p.y, __local_11); @@ -193,7 +193,7 @@ fn ref_struct_mut() with Stdout { __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_6 = __local_2; i32::fmt_decimal(p.x, __local_6); - String::append_char(__local_1, 44); + String::push(__local_1, 44); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_11 = __local_2; i32::fmt_decimal(p.y, __local_11); @@ -230,9 +230,9 @@ fn ref_struct_string_field() with Stdout { __sroa_u_name = String { repr: array.new_data("Alice"), used: 5 }; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_1, __sroa_u_name); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push_str(__local_1, __sroa_u_name); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(30, __local_2); break __tmpl: __local_1; @@ -241,9 +241,9 @@ fn ref_struct_string_field() with Stdout { __sroa_u_name = new_name; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_3, __sroa_u_name); - String::append_char(__local_3, 44); - String::append_char(__local_3, 32); + String::push_str(__local_3, __sroa_u_name); + String::push(__local_3, 44); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(31, __local_4); break __tmpl: __local_3; @@ -272,14 +272,14 @@ fn ref_array_basic() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 98); - String::append_char(__local_4, 101); - String::append_char(__local_4, 102); - String::append_char(__local_4, 111); - String::append_char(__local_4, 114); - String::append_char(__local_4, 101); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 98); + String::push(__local_4, 101); + String::push(__local_4, 102); + String::push(__local_4, 111); + String::push(__local_4, 114); + String::push(__local_4, 101); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(before, __local_5); break __tmpl: __local_4; @@ -298,13 +298,13 @@ fn ref_array_basic() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_6, 97); - String::append_char(__local_6, 102); - String::append_char(__local_6, 116); - String::append_char(__local_6, 101); - String::append_char(__local_6, 114); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 102); + String::push(__local_6, 116); + String::push(__local_6, 101); + String::push(__local_6, 114); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(after, __local_7); break __tmpl: __local_6; @@ -334,7 +334,7 @@ fn ref_array_ref_element() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_3, String { repr: array.new_data("ref element: "), used: 13 }); + String::push_str(__local_3, String { repr: array.new_data("ref element: "), used: 13 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(__sroa_r_value, __local_4); break __tmpl: __local_3; @@ -346,14 +346,14 @@ fn ref_array_ref_element() with Stdout { builtin::array_set(arr.repr, 1, 999); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_5, 97); - String::append_char(__local_5, 114); - String::append_char(__local_5, 114); - String::append_char(__local_5, 91); - String::append_char(__local_5, 49); - String::append_char(__local_5, 93); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 114); + String::push(__local_5, 114); + String::push(__local_5, 91); + String::push(__local_5, 49); + String::push(__local_5, 93); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_15: block -> i32 { if 1 >= arr.used { @@ -366,7 +366,7 @@ fn ref_array_ref_element() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_7, String { repr: array.new_data("ref still: "), used: 11 }); + String::push_str(__local_7, String { repr: array.new_data("ref still: "), used: 11 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(__sroa_r_value, __local_8); break __tmpl: __local_7; @@ -382,7 +382,7 @@ fn ref_closure_capture() with Stdout { let __local_29: i32; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_4, String { repr: array.new_data("doubled: "), used: 9 }); + String::push_str(__local_4, String { repr: array.new_data("doubled: "), used: 9 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(84, __local_5); break __tmpl: __local_4; @@ -393,7 +393,7 @@ fn ref_closure_capture() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_6, String { repr: array.new_data("tripled: "), used: 9 }); + String::push_str(__local_6, String { repr: array.new_data("tripled: "), used: 9 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(result2, __local_7); break __tmpl: __local_6; @@ -410,7 +410,7 @@ fn ref_closure_mut_param() with Stdout { r.value = r.value + 5; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_1, String { repr: array.new_data("modified: "), used: 10 }); + String::push_str(__local_1, String { repr: array.new_data("modified: "), used: 10 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(y.value, __local_2); break __tmpl: __local_1; @@ -424,18 +424,18 @@ fn ref_method_receivers_test() with Stdout { let __local_4: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_1, 103); - String::append_char(__local_1, 101); - String::append_char(__local_1, 116); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 103); + String::push(__local_1, 101); + String::push(__local_1, 116); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(0, __local_2); break __tmpl: __local_1; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_3, String { repr: array.new_data("after increment: "), used: 17 }); + String::push_str(__local_3, String { repr: array.new_data("after increment: "), used: 17 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(3, __local_4); break __tmpl: __local_3; @@ -768,7 +768,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -783,7 +783,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -810,7 +810,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -863,7 +863,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -897,20 +897,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -920,10 +920,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -933,10 +933,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -944,10 +944,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/ref_equality.wir.wado b/wado-compiler/tests/fixtures.golden/ref_equality.wir.wado index 970eca365..196246351 100644 --- a/wado-compiler/tests/fixtures.golden/ref_equality.wir.wado +++ b/wado-compiler/tests/fixtures.golden/ref_equality.wir.wado @@ -89,9 +89,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Point^Inspect::inspect" = fn(ref Point, ref Formatter); @@ -141,42 +141,42 @@ fn __test_0_same_reference_is_equal() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_0_same_reference_is_equal"), used: 32 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality.wado"), used: 46 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_0_same_reference_is_equal"), used: 32 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality.wado"), used: 46 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(11, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: r1 == r2 "), used: 21 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 49); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 114); + String::push(__local_6, 49); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; __local_20 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_17.buf, __local_20); + String::push_str(__local_17.buf, __local_20); __local_18 = __v0; Point^Inspect::inspect(__local_18, __local_17); - String::append_char(__local_6, 10); - String::append_char(__local_6, 114); - String::append_char(__local_6, 50); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 10); + String::push(__local_6, 114); + String::push(__local_6, 50); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_23 = __local_7; __local_26 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_23.buf, __local_26); + String::push_str(__local_23.buf, __local_26); __local_24 = __v1; Point^Inspect::inspect(__local_24, __local_23); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -206,42 +206,42 @@ fn __test_1_different_references_are_not_equal() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_1_different_references_are_not_equal"), used: 43 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality.wado"), used: 46 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_1_different_references_are_not_equal"), used: 43 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality.wado"), used: 46 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_13 = __local_8; i32::fmt_decimal(19, __local_13); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: r1 != r2 "), used: 21 }); - String::append_char(__local_7, 114); - String::append_char(__local_7, 49); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 114); + String::push(__local_7, 49); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_18 = __local_8; __local_21 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_18.buf, __local_21); + String::push_str(__local_18.buf, __local_21); __local_19 = __v0; Point^Inspect::inspect(__local_19, __local_18); - String::append_char(__local_7, 10); - String::append_char(__local_7, 114); - String::append_char(__local_7, 50); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 10); + String::push(__local_7, 114); + String::push(__local_7, 50); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_24 = __local_8; __local_27 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_24.buf, __local_27); + String::push_str(__local_24.buf, __local_27); __local_25 = __v1; Point^Inspect::inspect(__local_25, __local_24); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -271,44 +271,44 @@ fn __test_2_mut_ref_equality() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_2_mut_ref_equality"), used: 25 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality.wado"), used: 46 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_2_mut_ref_equality"), used: 25 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality.wado"), used: 46 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(26, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: r1 == r2 "), used: 21 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 49); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 114); + String::push(__local_6, 49); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_16 = __v0; __local_17 = __local_7; __local_20 = String { repr: array.new_data("&mut "), used: 5 }; - String::append(__local_17.buf, __local_20); + String::push_str(__local_17.buf, __local_20); __local_18 = __local_16; Point^Inspect::inspect(__local_18, __local_17); - String::append_char(__local_6, 10); - String::append_char(__local_6, 114); - String::append_char(__local_6, 50); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 10); + String::push(__local_6, 114); + String::push(__local_6, 50); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_22 = __v1; __local_23 = __local_7; __local_26 = String { repr: array.new_data("&mut "), used: 5 }; - String::append(__local_23.buf, __local_26); + String::push_str(__local_23.buf, __local_26); __local_24 = __local_22; Point^Inspect::inspect(__local_24, __local_23); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -336,42 +336,42 @@ fn __test_3_primitive_ref_equality() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_3_primitive_ref_equality"), used: 31 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality.wado"), used: 46 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_3_primitive_ref_equality"), used: 31 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality.wado"), used: 46 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(33, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: r1 == r2 "), used: 21 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 49); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 114); + String::push(__local_6, 49); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; __local_20 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_17.buf, __local_20); + String::push_str(__local_17.buf, __local_20); __local_18 = __v0; i32::fmt_decimal(__local_18.value, __local_17); - String::append_char(__local_6, 10); - String::append_char(__local_6, 114); - String::append_char(__local_6, 50); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 10); + String::push(__local_6, 114); + String::push(__local_6, 50); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_27 = __local_7; __local_30 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_27.buf, __local_30); + String::push_str(__local_27.buf, __local_30); __local_28 = __v1; i32::fmt_decimal(__local_28.value, __local_27); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -401,42 +401,42 @@ fn __test_4_primitive_ref_inequality() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_4_primitive_ref_inequality"), used: 33 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality.wado"), used: 46 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_4_primitive_ref_inequality"), used: 33 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality.wado"), used: 46 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_13 = __local_8; i32::fmt_decimal(41, __local_13); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: r1 != r2 "), used: 21 }); - String::append_char(__local_7, 114); - String::append_char(__local_7, 49); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 114); + String::push(__local_7, 49); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_18 = __local_8; __local_21 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_18.buf, __local_21); + String::push_str(__local_18.buf, __local_21); __local_19 = __v0; i32::fmt_decimal(__local_19.value, __local_18); - String::append_char(__local_7, 10); - String::append_char(__local_7, 114); - String::append_char(__local_7, 50); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 10); + String::push(__local_7, 114); + String::push(__local_7, 50); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_28 = __local_8; __local_31 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_28.buf, __local_31); + String::push_str(__local_28.buf, __local_31); __local_29 = __v1; i32::fmt_decimal(__local_29.value, __local_28); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -659,7 +659,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -674,7 +674,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -708,17 +708,17 @@ fn Point^Inspect::inspect(self, f) { let s_13: ref String; let s_19: ref String; s_3 = String { repr: array.new_data("Point { "), used: 8 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("x: "), used: 3 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self.x, f); s_11 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); s_13 = String { repr: array.new_data("y: "), used: 3 }; - String::append(f.buf, s_13); + String::push_str(f.buf, s_13); i32::fmt_decimal(self.y, f); s_19 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); } fn Formatter::write_char_n(self, c, n) { @@ -732,7 +732,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l28; }; @@ -766,20 +766,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -789,10 +789,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -802,10 +802,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -813,10 +813,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/ref_equality_no_eq.wir.wado b/wado-compiler/tests/fixtures.golden/ref_equality_no_eq.wir.wado index daac14423..2dfb7a842 100644 --- a/wado-compiler/tests/fixtures.golden/ref_equality_no_eq.wir.wado +++ b/wado-compiler/tests/fixtures.golden/ref_equality_no_eq.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -134,42 +134,42 @@ fn __test_0_ref_identity_works_without_inner_eq() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_0_ref_identity_works_without_inner_eq"), used: 44 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_no_eq.wado"), used: 52 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_0_ref_identity_works_without_inner_eq"), used: 44 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_no_eq.wado"), used: 52 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_19 = __local_12; i32::fmt_decimal(15, __local_19); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: r1 == r2 "), used: 21 }); - String::append_char(__local_11, 114); - String::append_char(__local_11, 49); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 114); + String::push(__local_11, 49); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_24 = __local_12; __local_27 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_24.buf, __local_27); + String::push_str(__local_24.buf, __local_27); __local_25 = __v0_5; i32::fmt_decimal(__local_25.value, __local_24); - String::append_char(__local_11, 10); - String::append_char(__local_11, 114); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 10); + String::push(__local_11, 114); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_34 = __local_12; __local_37 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_34.buf, __local_37); + String::push_str(__local_34.buf, __local_37); __local_35 = __v1_6; i32::fmt_decimal(__local_35.value, __local_34); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -180,42 +180,42 @@ condition: r1 == r2 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_0_ref_identity_works_without_inner_eq"), used: 44 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_no_eq.wado"), used: 52 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_0_ref_identity_works_without_inner_eq"), used: 44 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_no_eq.wado"), used: 52 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_45 = __local_14; i32::fmt_decimal(16, __local_45); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: r1 != r3 "), used: 21 }); - String::append_char(__local_13, 114); - String::append_char(__local_13, 49); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 114); + String::push(__local_13, 49); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_50 = __local_14; __local_53 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_50.buf, __local_53); + String::push_str(__local_50.buf, __local_53); __local_51 = __v0_8; i32::fmt_decimal(__local_51.value, __local_50); - String::append_char(__local_13, 10); - String::append_char(__local_13, 114); - String::append_char(__local_13, 51); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 10); + String::push(__local_13, 114); + String::push(__local_13, 51); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_60 = __local_14; __local_63 = String { repr: array.new_data("&"), used: 1 }; - String::append(__local_60.buf, __local_63); + String::push_str(__local_60.buf, __local_63); __local_61 = __v1_9; i32::fmt_decimal(__local_61.value, __local_60); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -418,7 +418,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -433,7 +433,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -471,7 +471,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -505,20 +505,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -528,10 +528,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -541,10 +541,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -552,10 +552,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/ref_equality_struct_with_ref.wir.wado b/wado-compiler/tests/fixtures.golden/ref_equality_struct_with_ref.wir.wado index a707a0d31..0819469ee 100644 --- a/wado-compiler/tests/fixtures.golden/ref_equality_struct_with_ref.wir.wado +++ b/wado-compiler/tests/fixtures.golden/ref_equality_struct_with_ref.wir.wado @@ -91,13 +91,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Container^Eq::eq" = fn(ref Container, ref Container) -> bool; @@ -153,34 +153,34 @@ fn __test_0_struct_eq_with_same_ref_field() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_0_struct_eq_with_same_ref_field"), used: 38 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_struct_with_ref.wado"), used: 62 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_0_struct_eq_with_same_ref_field"), used: 38 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_struct_with_ref.wado"), used: 62 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(15, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: c1 == c2 "), used: 21 }); - String::append_char(__local_6, 99); - String::append_char(__local_6, 49); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 99); + String::push(__local_6, 49); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; Container^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); - String::append_char(__local_6, 99); - String::append_char(__local_6, 50); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 10); + String::push(__local_6, 99); + String::push(__local_6, 50); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; Container^Inspect::inspect(__v1, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -208,34 +208,34 @@ fn __test_1_struct_neq_with_different_ref_field() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_1_struct_neq_with_different_ref_field"), used: 44 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_struct_with_ref.wado"), used: 62 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_1_struct_neq_with_different_ref_field"), used: 44 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_struct_with_ref.wado"), used: 62 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_13 = __local_8; i32::fmt_decimal(24, __local_13); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: c1 != c2 "), used: 21 }); - String::append_char(__local_7, 99); - String::append_char(__local_7, 49); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 99); + String::push(__local_7, 49); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; Container^Inspect::inspect(__v0, __local_8); - String::append_char(__local_7, 10); - String::append_char(__local_7, 99); - String::append_char(__local_7, 50); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 10); + String::push(__local_7, 99); + String::push(__local_7, 50); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; Container^Inspect::inspect(__v1, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -261,34 +261,34 @@ fn __test_2_struct_neq_with_different_name_same_ref() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_2_struct_neq_with_different_name_same_ref"), used: 48 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_struct_with_ref.wado"), used: 62 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_2_struct_neq_with_different_name_same_ref"), used: 48 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_struct_with_ref.wado"), used: 62 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(31, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: c1 != c2 "), used: 21 }); - String::append_char(__local_6, 99); - String::append_char(__local_6, 49); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 99); + String::push(__local_6, 49); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; Container^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); - String::append_char(__local_6, 99); - String::append_char(__local_6, 50); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 10); + String::push(__local_6, 99); + String::push(__local_6, 50); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; Container^Inspect::inspect(__v1, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -314,34 +314,34 @@ fn __test_3_struct_with_mut_ref_field() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_3_struct_with_mut_ref_field"), used: 34 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_struct_with_ref.wado"), used: 62 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_3_struct_with_mut_ref_field"), used: 34 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/ref_equality_struct_with_ref.wado"), used: 62 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(38, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: c1 == c2 "), used: 21 }); - String::append_char(__local_6, 99); - String::append_char(__local_6, 49); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 99); + String::push(__local_6, 49); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; Container^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); - String::append_char(__local_6, 99); - String::append_char(__local_6, 50); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 10); + String::push(__local_6, 99); + String::push(__local_6, 50); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; Container^Inspect::inspect(__v1, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -559,7 +559,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -647,7 +647,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -693,12 +693,12 @@ fn Inner^Inspect::inspect(self, f) { let s_5: ref String; let s_11: ref String; s_3 = String { repr: array.new_data("Inner { "), used: 8 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("value: "), used: 7 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self, f); s_11 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); } fn Container^Inspect::inspect(self, f) { @@ -711,21 +711,21 @@ fn Container^Inspect::inspect(self, f) { let s_14: ref String; let s_16: ref String; s_3 = String { repr: array.new_data("Container { "), used: 12 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("name: "), used: 6 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); String^Inspect::inspect(self.name, f); s_7 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_7); + String::push_str(f.buf, s_7); s_9 = String { repr: array.new_data("data: "), used: 6 }; - String::append(f.buf, s_9); + String::push_str(f.buf, s_9); self_10 = self.data; s_14 = String { repr: array.new_data("&"), used: 1 }; - String::append(f.buf, s_14); + String::push_str(f.buf, s_14); inner = self_10; Inner^Inspect::inspect(inner.value, f); s_16 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_16); + String::push_str(f.buf, s_16); } fn Formatter::write_char_n(self, c, n) { @@ -739,7 +739,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l37; }; @@ -773,20 +773,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -796,10 +796,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -809,10 +809,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -820,10 +820,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -835,7 +835,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -852,22 +852,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b56; @@ -875,7 +875,7 @@ fn String^Inspect::inspect(self, f) { continue l57; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_struct_eq_with_same_ref_field as "__test_0_struct_eq_with_same_ref_field" diff --git a/wado-compiler/tests/fixtures.golden/result-if-let-err.wir.wado b/wado-compiler/tests/fixtures.golden/result-if-let-err.wir.wado index e6d627fda..6b725ed33 100644 --- a/wado-compiler/tests/fixtures.golden/result-if-let-err.wir.wado +++ b/wado-compiler/tests/fixtures.golden/result-if-let-err.wir.wado @@ -60,7 +60,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/wasi/stream-drop-writable" = fn(i32); @@ -90,8 +90,8 @@ fn run() with Stdout { e = value_copy String(ref.cast Result::Err(r).payload_0); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(21), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Err: "), used: 5 }); - String::append(__local_2, e); + String::push_str(__local_2, String { repr: array.new_data("Err: "), used: 5 }); + String::push_str(__local_2, e); break __tmpl: __local_2; }); } else { @@ -215,7 +215,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/result-if-let-mismatch.wir.wado b/wado-compiler/tests/fixtures.golden/result-if-let-mismatch.wir.wado index f88e97909..46f356eed 100644 --- a/wado-compiler/tests/fixtures.golden/result-if-let-mismatch.wir.wado +++ b/wado-compiler/tests/fixtures.golden/result-if-let-mismatch.wir.wado @@ -79,9 +79,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -118,10 +118,10 @@ fn run() with Stdout { x = ref.cast Result::Ok(r).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_2, 79); - String::append_char(__local_2, 107); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 79); + String::push(__local_2, 107); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(x, __local_3); break __tmpl: __local_2; @@ -326,7 +326,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -341,7 +341,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -379,7 +379,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -413,20 +413,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -449,10 +449,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -460,10 +460,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/result-if-let-ok.wir.wado b/wado-compiler/tests/fixtures.golden/result-if-let-ok.wir.wado index 7d26d4fab..b1a4cb2c3 100644 --- a/wado-compiler/tests/fixtures.golden/result-if-let-ok.wir.wado +++ b/wado-compiler/tests/fixtures.golden/result-if-let-ok.wir.wado @@ -79,9 +79,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -118,10 +118,10 @@ fn run() with Stdout { x = ref.cast Result::Ok(r).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_2, 79); - String::append_char(__local_2, 107); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 79); + String::push(__local_2, 107); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(x, __local_3); break __tmpl: __local_2; @@ -326,7 +326,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -341,7 +341,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -379,7 +379,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -413,20 +413,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -449,10 +449,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -460,10 +460,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/result-match-payload.wir.wado b/wado-compiler/tests/fixtures.golden/result-match-payload.wir.wado index e23e15848..346769623 100644 --- a/wado-compiler/tests/fixtures.golden/result-match-payload.wir.wado +++ b/wado-compiler/tests/fixtures.golden/result-match-payload.wir.wado @@ -60,7 +60,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/wasi/stream-drop-writable" = fn(i32); @@ -104,8 +104,8 @@ fn run() with Stdout { __local_2 = __cast_2.payload_0; __tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(20), used: 0 }; - String::append(__local_8, String { repr: array.new_data("ok: "), used: 4 }); - String::append(__local_8, __local_2); + String::push_str(__local_8, String { repr: array.new_data("ok: "), used: 4 }); + String::push_str(__local_8, __local_2); break __tmpl: __local_8; }; } else if ref.test Result::Err(__match_scrut_0) -> ref String { @@ -114,8 +114,8 @@ fn run() with Stdout { __local_3 = __cast_1.payload_0; __tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(21), used: 0 }; - String::append(__local_9, String { repr: array.new_data("err: "), used: 5 }); - String::append(__local_9, __local_3); + String::push_str(__local_9, String { repr: array.new_data("err: "), used: 5 }); + String::push_str(__local_9, __local_3); break __tmpl: __local_9; }; } else { @@ -130,8 +130,8 @@ fn run() with Stdout { __local_5 = __cast_4.payload_0; __tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(20), used: 0 }; - String::append(__local_10, String { repr: array.new_data("ok: "), used: 4 }); - String::append(__local_10, __local_5); + String::push_str(__local_10, String { repr: array.new_data("ok: "), used: 4 }); + String::push_str(__local_10, __local_5); break __tmpl: __local_10; }; } else if ref.test Result::Err(__match_scrut_1) -> ref String { @@ -140,8 +140,8 @@ fn run() with Stdout { __local_6 = __cast_3.payload_0; __tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(21), used: 0 }; - String::append(__local_11, String { repr: array.new_data("err: "), used: 5 }); - String::append(__local_11, __local_6); + String::push_str(__local_11, String { repr: array.new_data("err: "), used: 5 }); + String::push_str(__local_11, __local_6); break __tmpl: __local_11; }; } else { @@ -266,7 +266,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/result-match.wir.wado b/wado-compiler/tests/fixtures.golden/result-match.wir.wado index 40e6c0490..b3dbe86f3 100644 --- a/wado-compiler/tests/fixtures.golden/result-match.wir.wado +++ b/wado-compiler/tests/fixtures.golden/result-match.wir.wado @@ -79,9 +79,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -137,7 +137,7 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_6, String { repr: array.new_data("match Ok: "), used: 10 }); + String::push_str(__local_6, String { repr: array.new_data("match Ok: "), used: 10 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(x, __local_7); break __tmpl: __local_6; @@ -158,7 +158,7 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_8, String { repr: array.new_data("match Err: "), used: 11 }); + String::push_str(__local_8, String { repr: array.new_data("match Err: "), used: 11 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(y, __local_9); break __tmpl: __local_8; @@ -360,7 +360,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -375,7 +375,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -413,7 +413,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -447,20 +447,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -470,10 +470,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -483,10 +483,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -494,10 +494,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/result-mut-ref-side-effect.wir.wado b/wado-compiler/tests/fixtures.golden/result-mut-ref-side-effect.wir.wado index 726edceae..d6ebb1c6a 100644 --- a/wado-compiler/tests/fixtures.golden/result-mut-ref-side-effect.wir.wado +++ b/wado-compiler/tests/fixtures.golden/result-mut-ref-side-effect.wir.wado @@ -330,9 +330,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Parser::last_end" = fn(ref Parser) -> i32; @@ -340,11 +340,11 @@ type "functype/Parser::advance" = fn(ref Parser) -> ref Token; type "functype/Parser::expect" = fn(ref Parser, i32, ref String) -> ref Result; -type "functype/Array::append" = fn(ref Array, ref Token); +type "functype/Array::push" = fn(ref Array, ref Token); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -2044,8 +2044,8 @@ fn run() { e = ref.cast Result::Err(__sroa_r_value).payload_0; "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_7, String { repr: array.new_data("parse failed: "), used: 14 }); - String::append(__local_7, e.message); + String::push_str(__local_7, String { repr: array.new_data("parse failed: "), used: 14 }); + String::push_str(__local_7, e.message); break __tmpl: __local_7; }); unreachable; @@ -2055,42 +2055,42 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/result-mut-ref-side-effect.wado"), used: 60 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/result-mut-ref-side-effect.wado"), used: 60 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_45 = __local_11; i32::fmt_decimal(267, __local_45); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); - String::append(__local_10, __tmpl: block -> ref String { + String::push(__local_10, 58); + String::push(__local_10, 32); + String::push_str(__local_10, __tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(40), used: 0 }; - String::append(__local_8, String { repr: array.new_data("expected pos=3, got pos="), used: 24 }); + String::push_str(__local_8, String { repr: array.new_data("expected pos=3, got pos="), used: 24 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(p.pos, __local_9); break __tmpl: __local_8; }); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: p.pos == 3 "), used: 23 }); - String::append_char(__local_10, 112); - String::append_char(__local_10, 46); - String::append_char(__local_10, 112); - String::append_char(__local_10, 111); - String::append_char(__local_10, 115); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 112); + String::push(__local_10, 46); + String::push(__local_10, 112); + String::push(__local_10, 111); + String::push(__local_10, 115); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_56 = __local_11; i32::fmt_decimal(__v0, __local_56); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -2293,7 +2293,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2308,7 +2308,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2403,17 +2403,17 @@ fn Parser::expect(self, kind, name) { return Result::Err { discriminant: 1, payload_0: ref.as_non_null(__inline_ParseError__new_7: block -> ref ParseError { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(49), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected "), used: 9 }); - String::append(__local_5, name); - String::append_char(__local_5, 44); - String::append_char(__local_5, 32); - String::append_char(__local_5, 103); - String::append_char(__local_5, 111); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append_char(__local_5, 34); - String::append(__local_5, tok.text); - String::append_char(__local_5, 34); + String::push_str(__local_5, String { repr: array.new_data("expected "), used: 9 }); + String::push_str(__local_5, name); + String::push(__local_5, 44); + String::push(__local_5, 32); + String::push(__local_5, 103); + String::push(__local_5, 111); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push(__local_5, 34); + String::push_str(__local_5, tok.text); + String::push(__local_5, 34); break __tmpl: __local_5; }; __local_17 = tok.span; @@ -2425,7 +2425,7 @@ fn Parser::expect(self, kind, name) { }) }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2467,7 +2467,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2520,7 +2520,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l234; }; @@ -2554,20 +2554,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2577,10 +2577,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2590,10 +2590,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2601,10 +2601,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/result_unwrap_fresh_elision.wir.wado b/wado-compiler/tests/fixtures.golden/result_unwrap_fresh_elision.wir.wado index b1356dc70..974d35750 100644 --- a/wado-compiler/tests/fixtures.golden/result_unwrap_fresh_elision.wir.wado +++ b/wado-compiler/tests/fixtures.golden/result_unwrap_fresh_elision.wir.wado @@ -94,11 +94,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -135,9 +135,9 @@ fn make_result() { __local_0 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_0; }; - Array::append(arr, 1); - Array::append(arr, 2); - Array::append(arr, 3); + Array::push(arr, 1); + Array::push(arr, 2); + Array::push(arr, 3); return Result,String>::Ok { discriminant: 0, payload_0: arr }; } @@ -165,27 +165,27 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/result_unwrap_fresh_elision.wado"), used: 61 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_3, 114); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/result_unwrap_fresh_elision.wado"), used: 61 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_13 = __local_4; i32::fmt_decimal(17, __local_13); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: data.len() == 3 "), used: 28 }); - String::append(__local_3, String { repr: array.new_data("data.len(): "), used: 12 }); + String::push_str(__local_3, String { repr: array.new_data("data.len(): "), used: 12 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_18 = __local_4; i32::fmt_decimal(__v0, __local_18); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -425,7 +425,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -440,7 +440,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -467,7 +467,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -520,7 +520,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l30; }; @@ -554,20 +554,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -577,10 +577,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -590,10 +590,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -601,10 +601,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/return_merged.wir.wado b/wado-compiler/tests/fixtures.golden/return_merged.wir.wado index 2cd838c05..cf44476bd 100644 --- a/wado-compiler/tests/fixtures.golden/return_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/return_merged.wir.wado @@ -96,15 +96,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -173,25 +173,25 @@ fn __test_0_array_var() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_0_array_var"), used: 18 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_0_array_var"), used: 18 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_18 = __local_8; i32::fmt_decimal(21, __local_18); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: nums.len() == 3 "), used: 28 }); - String::append(__local_7, String { repr: array.new_data("nums.len(): "), used: 12 }); + String::push_str(__local_7, String { repr: array.new_data("nums.len(): "), used: 12 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_23 = __local_8; i32::fmt_decimal(__v0_1, __local_23); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -207,25 +207,25 @@ condition: nums.len() == 3 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_0_array_var"), used: 18 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_0_array_var"), used: 18 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_31 = __local_10; i32::fmt_decimal(22, __local_31); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: nums[0] == 1 "), used: 25 }); - String::append(__local_9, String { repr: array.new_data("nums[0]: "), used: 9 }); + String::push_str(__local_9, String { repr: array.new_data("nums[0]: "), used: 9 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_36 = __local_10; i32::fmt_decimal(__v0_3, __local_36); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -241,25 +241,25 @@ condition: nums[0] == 1 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_0_array_var"), used: 18 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_0_array_var"), used: 18 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_44 = __local_12; i32::fmt_decimal(23, __local_44); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: nums[2] == 3 "), used: 25 }); - String::append(__local_11, String { repr: array.new_data("nums[2]: "), used: 9 }); + String::push_str(__local_11, String { repr: array.new_data("nums[2]: "), used: 9 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_49 = __local_12; i32::fmt_decimal(__v0_5, __local_49); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -283,25 +283,25 @@ fn __test_1_empty_array() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_1_empty_array"), used: 20 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_1_empty_array"), used: 20 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; i32::fmt_decimal(28, __local_14); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: arr.len() == 0 "), used: 27 }); - String::append(__local_3, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_3, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_19 = __local_4; i32::fmt_decimal(__v0, __local_19); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -334,32 +334,32 @@ fn __test_3_tuple_var() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_3_tuple_var"), used: 18 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_3_tuple_var"), used: 18 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_14 = __local_6; i32::fmt_decimal(40, __local_14); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: pair.0 == 42 "), used: 25 }); - String::append_char(__local_5, 112); - String::append_char(__local_5, 97); - String::append_char(__local_5, 105); - String::append_char(__local_5, 114); - String::append_char(__local_5, 46); - String::append_char(__local_5, 48); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 112); + String::push(__local_5, 97); + String::push(__local_5, 105); + String::push(__local_5, 114); + String::push(__local_5, 46); + String::push(__local_5, 48); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_19 = __local_6; i32::fmt_decimal(__v0_1, __local_19); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -369,31 +369,31 @@ condition: pair.0 == 42 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_3_tuple_var"), used: 18 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_3_tuple_var"), used: 18 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/return_merged.wado"), used: 47 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_25 = __local_8; i32::fmt_decimal(41, __local_25); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: pair.1 == \"hello\" "), used: 30 }); - String::append_char(__local_7, 112); - String::append_char(__local_7, 97); - String::append_char(__local_7, 105); - String::append_char(__local_7, 114); - String::append_char(__local_7, 46); - String::append_char(__local_7, 49); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 112); + String::push(__local_7, 97); + String::push(__local_7, 105); + String::push(__local_7, 114); + String::push(__local_7, 46); + String::push(__local_7, 49); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0_3, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -610,7 +610,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -698,7 +698,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -725,7 +725,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -778,7 +778,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l44; }; @@ -812,20 +812,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -835,10 +835,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -848,10 +848,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -859,10 +859,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -874,7 +874,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -891,22 +891,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b63; @@ -914,7 +914,7 @@ fn String^Inspect::inspect(self, f) { continue l64; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_array_var as "__test_0_array_var" diff --git a/wado-compiler/tests/fixtures.golden/scalarize_chain.wir.wado b/wado-compiler/tests/fixtures.golden/scalarize_chain.wir.wado index 9070b0475..2680962d4 100644 --- a/wado-compiler/tests/fixtures.golden/scalarize_chain.wir.wado +++ b/wado-compiler/tests/fixtures.golden/scalarize_chain.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -124,8 +124,8 @@ fn run() with Stdout { __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_9 = __local_2; i32::fmt_decimal(__sroa_r_x, __local_9); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_14 = __local_2; i32::fmt_decimal(__sroa_r_y, __local_14); @@ -328,7 +328,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -343,7 +343,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -381,7 +381,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -415,20 +415,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -438,10 +438,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -451,10 +451,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -462,10 +462,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/scope_nested_blocks.wir.wado b/wado-compiler/tests/fixtures.golden/scope_nested_blocks.wir.wado index b517737c4..772bdf249 100644 --- a/wado-compiler/tests/fixtures.golden/scope_nested_blocks.wir.wado +++ b/wado-compiler/tests/fixtures.golden/scope_nested_blocks.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -110,11 +110,11 @@ fn run() with Stdout { __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_13 = __local_4; i32::fmt_decimal(1, __local_13); - String::append_char(__local_3, 44); + String::push(__local_3, 44); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_18 = __local_4; i32::fmt_decimal(2, __local_18); - String::append_char(__local_3, 44); + String::push(__local_3, 44); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_23 = __local_4; i32::fmt_decimal(3, __local_23); @@ -125,7 +125,7 @@ fn run() with Stdout { __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_29 = __local_6; i32::fmt_decimal(1, __local_29); - String::append_char(__local_5, 44); + String::push(__local_5, 44); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_34 = __local_6; i32::fmt_decimal(2, __local_34); @@ -334,7 +334,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -349,7 +349,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -387,7 +387,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -421,20 +421,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -444,10 +444,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -457,10 +457,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -468,10 +468,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/scope_shadow_self_ref.wir.wado b/wado-compiler/tests/fixtures.golden/scope_shadow_self_ref.wir.wado index 49dd833be..bb5d5a776 100644 --- a/wado-compiler/tests/fixtures.golden/scope_shadow_self_ref.wir.wado +++ b/wado-compiler/tests/fixtures.golden/scope_shadow_self_ref.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -108,13 +108,13 @@ fn run() with Stdout { y_2 = String { repr: array.new_data("hello"), used: 5 }; y_3 = __tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(22), used: 0 }; - String::append(__local_6, y_2); - String::append_char(__local_6, 32); - String::append_char(__local_6, 119); - String::append_char(__local_6, 111); - String::append_char(__local_6, 114); - String::append_char(__local_6, 108); - String::append_char(__local_6, 100); + String::push_str(__local_6, y_2); + String::push(__local_6, 32); + String::push(__local_6, 119); + String::push(__local_6, 111); + String::push(__local_6, 114); + String::push(__local_6, 108); + String::push(__local_6, 100); break __tmpl: __local_6; }; "core:cli/println"(y_3); @@ -315,7 +315,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -330,7 +330,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -368,7 +368,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -402,20 +402,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -425,10 +425,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -438,10 +438,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -449,10 +449,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/scope_shadow_self_ref_closure.wir.wado b/wado-compiler/tests/fixtures.golden/scope_shadow_self_ref_closure.wir.wado index 2bc1b8741..510763951 100644 --- a/wado-compiler/tests/fixtures.golden/scope_shadow_self_ref_closure.wir.wado +++ b/wado-compiler/tests/fixtures.golden/scope_shadow_self_ref_closure.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -299,7 +299,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -314,7 +314,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -352,7 +352,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -386,20 +386,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -409,10 +409,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -422,10 +422,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -433,10 +433,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/scope_shadowing_in_block.wir.wado b/wado-compiler/tests/fixtures.golden/scope_shadowing_in_block.wir.wado index 13546bdf0..e9612930f 100644 --- a/wado-compiler/tests/fixtures.golden/scope_shadowing_in_block.wir.wado +++ b/wado-compiler/tests/fixtures.golden/scope_shadowing_in_block.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,26 +100,26 @@ fn run() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_2, 105); - String::append_char(__local_2, 110); - String::append_char(__local_2, 110); - String::append_char(__local_2, 101); - String::append_char(__local_2, 114); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 105); + String::push(__local_2, 110); + String::push(__local_2, 110); + String::push(__local_2, 101); + String::push(__local_2, 114); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(43, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_4, 111); - String::append_char(__local_4, 117); - String::append_char(__local_4, 116); - String::append_char(__local_4, 101); - String::append_char(__local_4, 114); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 111); + String::push(__local_4, 117); + String::push(__local_4, 116); + String::push(__local_4, 101); + String::push(__local_4, 114); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(42, __local_5); break __tmpl: __local_4; @@ -321,7 +321,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -336,7 +336,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -374,7 +374,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -408,20 +408,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -431,10 +431,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -444,10 +444,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -455,10 +455,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/scope_shadowing_same_block.wir.wado b/wado-compiler/tests/fixtures.golden/scope_shadowing_same_block.wir.wado index 95eb9b8a1..c6354f16a 100644 --- a/wado-compiler/tests/fixtures.golden/scope_shadowing_same_block.wir.wado +++ b/wado-compiler/tests/fixtures.golden/scope_shadowing_same_block.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -299,7 +299,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -314,7 +314,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -352,7 +352,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -386,20 +386,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -409,10 +409,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -422,10 +422,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -433,10 +433,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/select_basic.wir.wado b/wado-compiler/tests/fixtures.golden/select_basic.wir.wado index 92cb82cd9..60400e349 100644 --- a/wado-compiler/tests/fixtures.golden/select_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/select_basic.wir.wado @@ -72,9 +72,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -123,19 +123,19 @@ fn run() with Stdout { if __cond_33 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_69 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_69, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_69, 114); - String::append_char(__local_69, 117); - String::append_char(__local_69, 110); - String::append_char(__local_69, 32); - String::append_char(__local_69, 97); - String::append_char(__local_69, 116); - String::append_char(__local_69, 32); - String::append(__local_69, String { repr: array.new_data("wado-compiler/tests/fixtures/select_basic.wado"), used: 46 }); - String::append_char(__local_69, 58); + String::push_str(__local_69, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_69, 114); + String::push(__local_69, 117); + String::push(__local_69, 110); + String::push(__local_69, 32); + String::push(__local_69, 97); + String::push(__local_69, 116); + String::push(__local_69, 32); + String::push_str(__local_69, String { repr: array.new_data("wado-compiler/tests/fixtures/select_basic.wado"), used: 46 }); + String::push(__local_69, 58); __local_70 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_69 }; i32::fmt_decimal(126, __local_70); - String::append(__local_69, String { repr: array.new_data(" + String::push_str(__local_69, String { repr: array.new_data(" condition: if fa32 > fb32 { fa32; } else { fb32; } == 3.0 as f32 "), used: 66 }); break __tmpl: __local_69; @@ -146,19 +146,19 @@ condition: if fa32 > fb32 { fa32; } else { fb32; } == 3.0 as f32 if __cond_34 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_71 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_71, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_71, 114); - String::append_char(__local_71, 117); - String::append_char(__local_71, 110); - String::append_char(__local_71, 32); - String::append_char(__local_71, 97); - String::append_char(__local_71, 116); - String::append_char(__local_71, 32); - String::append(__local_71, String { repr: array.new_data("wado-compiler/tests/fixtures/select_basic.wado"), used: 46 }); - String::append_char(__local_71, 58); + String::push_str(__local_71, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_71, 114); + String::push(__local_71, 117); + String::push(__local_71, 110); + String::push(__local_71, 32); + String::push(__local_71, 97); + String::push(__local_71, 116); + String::push(__local_71, 32); + String::push_str(__local_71, String { repr: array.new_data("wado-compiler/tests/fixtures/select_basic.wado"), used: 46 }); + String::push(__local_71, 58); __local_72 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_71 }; i32::fmt_decimal(133, __local_72); - String::append(__local_71, String { repr: array.new_data(" + String::push_str(__local_71, String { repr: array.new_data(" condition: if false { 1.0 as f32; } else { 2.0 as f32; } == 2.0 as f32 "), used: 72 }); break __tmpl: __local_71; @@ -169,19 +169,19 @@ condition: if false { 1.0 as f32; } else { 2.0 as f32; } == 2.0 as f32 if __cond_41 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_77 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_77, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_77, 114); - String::append_char(__local_77, 117); - String::append_char(__local_77, 110); - String::append_char(__local_77, 32); - String::append_char(__local_77, 97); - String::append_char(__local_77, 116); - String::append_char(__local_77, 32); - String::append(__local_77, String { repr: array.new_data("wado-compiler/tests/fixtures/select_basic.wado"), used: 46 }); - String::append_char(__local_77, 58); + String::push_str(__local_77, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_77, 114); + String::push(__local_77, 117); + String::push(__local_77, 110); + String::push(__local_77, 32); + String::push(__local_77, 97); + String::push(__local_77, 116); + String::push(__local_77, 32); + String::push_str(__local_77, String { repr: array.new_data("wado-compiler/tests/fixtures/select_basic.wado"), used: 46 }); + String::push(__local_77, 58); __local_78 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_77 }; i32::fmt_decimal(160, __local_78); - String::append(__local_77, String { repr: array.new_data(" + String::push_str(__local_77, String { repr: array.new_data(" condition: if true { ca; } else { cb; } == 'a' "), used: 48 }); break __tmpl: __local_77; @@ -192,19 +192,19 @@ condition: if true { ca; } else { cb; } == 'a' if __cond_42 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_79 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_79, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_79, 114); - String::append_char(__local_79, 117); - String::append_char(__local_79, 110); - String::append_char(__local_79, 32); - String::append_char(__local_79, 97); - String::append_char(__local_79, 116); - String::append_char(__local_79, 32); - String::append(__local_79, String { repr: array.new_data("wado-compiler/tests/fixtures/select_basic.wado"), used: 46 }); - String::append_char(__local_79, 58); + String::push_str(__local_79, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_79, 114); + String::push(__local_79, 117); + String::push(__local_79, 110); + String::push(__local_79, 32); + String::push(__local_79, 97); + String::push(__local_79, 116); + String::push(__local_79, 32); + String::push_str(__local_79, String { repr: array.new_data("wado-compiler/tests/fixtures/select_basic.wado"), used: 46 }); + String::push(__local_79, 58); __local_80 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_79 }; i32::fmt_decimal(167, __local_80); - String::append(__local_79, String { repr: array.new_data(" + String::push_str(__local_79, String { repr: array.new_data(" condition: if false { ca; } else { cb; } == 'z' "), used: 49 }); break __tmpl: __local_79; @@ -446,7 +446,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -461,7 +461,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -499,7 +499,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l28; }; @@ -533,20 +533,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -556,10 +556,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -569,10 +569,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -580,10 +580,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/select_no_opt.wir.wado b/wado-compiler/tests/fixtures.golden/select_no_opt.wir.wado index 9ccefb60b..d3eea87b5 100644 --- a/wado-compiler/tests/fixtures.golden/select_no_opt.wir.wado +++ b/wado-compiler/tests/fixtures.golden/select_no_opt.wir.wado @@ -66,9 +66,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,7 +100,7 @@ fn side_effect(x) with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_1, String { repr: array.new_data("called with "), used: 12 }); + String::push_str(__local_1, String { repr: array.new_data("called with "), used: 12 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(x, __local_2); break __tmpl: __local_1; @@ -324,7 +324,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -339,7 +339,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -377,7 +377,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -411,20 +411,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -434,10 +434,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -458,10 +458,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/sequence-literal-custom.wir.wado b/wado-compiler/tests/fixtures.golden/sequence-literal-custom.wir.wado index f5a422fba..86e8ab63c 100644 --- a/wado-compiler/tests/fixtures.golden/sequence-literal-custom.wir.wado +++ b/wado-compiler/tests/fixtures.golden/sequence-literal-custom.wir.wado @@ -83,11 +83,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -164,9 +164,9 @@ fn run() with Stdout { __local_26 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_26; }) }; - Array::append(__local_0.items, 10); - Array::append(__local_0.items, 20); - Array::append(__local_0.items, 30); + Array::push(__local_0.items, 10); + Array::push(__local_0.items, 20); + Array::push(__local_0.items, 30); break __seq_lit: __local_0; }; __v0_2 = __inline_Array_i32___len_9: block -> i32 { @@ -177,27 +177,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-custom.wado"), used: 57 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-custom.wado"), used: 57 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_39 = __local_15; i32::fmt_decimal(44, __local_39); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: s.len() == 3 "), used: 25 }); - String::append(__local_14, String { repr: array.new_data("s.len(): "), used: 9 }); + String::push_str(__local_14, String { repr: array.new_data("s.len(): "), used: 9 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_44 = __local_15; i32::fmt_decimal(__v0_2, __local_44); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -214,27 +214,27 @@ condition: s.len() == 3 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-custom.wado"), used: 57 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-custom.wado"), used: 57 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_54 = __local_17; i32::fmt_decimal(45, __local_54); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: s.get(0) == 10 "), used: 27 }); - String::append(__local_16, String { repr: array.new_data("s.get(0): "), used: 10 }); + String::push_str(__local_16, String { repr: array.new_data("s.get(0): "), used: 10 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_59 = __local_17; i32::fmt_decimal(__v0_4, __local_59); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -251,27 +251,27 @@ condition: s.get(0) == 10 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-custom.wado"), used: 57 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-custom.wado"), used: 57 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_69 = __local_19; i32::fmt_decimal(46, __local_69); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: s.get(1) == 20 "), used: 27 }); - String::append(__local_18, String { repr: array.new_data("s.get(1): "), used: 10 }); + String::push_str(__local_18, String { repr: array.new_data("s.get(1): "), used: 10 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_74 = __local_19; i32::fmt_decimal(__v0_6, __local_74); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -288,27 +288,27 @@ condition: s.get(1) == 20 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-custom.wado"), used: 57 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-custom.wado"), used: 57 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_84 = __local_21; i32::fmt_decimal(47, __local_84); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: s.get(2) == 30 "), used: 27 }); - String::append(__local_20, String { repr: array.new_data("s.get(2): "), used: 10 }); + String::push_str(__local_20, String { repr: array.new_data("s.get(2): "), used: 10 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_89 = __local_21; i32::fmt_decimal(__v0_8, __local_89); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -318,9 +318,9 @@ condition: s.get(2) == 30 __local_93 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_93; }) }; - Array::append(__local_10.items, 1); - Array::append(__local_10.items, 2); - Array::append(__local_10.items, 3); + Array::push(__local_10.items, 1); + Array::push(__local_10.items, 2); + Array::push(__local_10.items, 3); break __seq_lit: __local_10; }; __v0_12 = __inline_Array_i32___len_51: block -> i32 { @@ -331,27 +331,27 @@ condition: s.get(2) == 30 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-custom.wado"), used: 57 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-custom.wado"), used: 57 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_106 = __local_23; i32::fmt_decimal(51, __local_106); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: s2.len() == 3 "), used: 26 }); - String::append(__local_22, String { repr: array.new_data("s2.len(): "), used: 10 }); + String::push_str(__local_22, String { repr: array.new_data("s2.len(): "), used: 10 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_111 = __local_23; i32::fmt_decimal(__v0_12, __local_111); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -591,7 +591,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -606,7 +606,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -633,7 +633,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -686,7 +686,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l36; }; @@ -720,20 +720,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -743,10 +743,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -756,10 +756,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -767,10 +767,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/sequence-literal-fn-arg.wir.wado b/wado-compiler/tests/fixtures.golden/sequence-literal-fn-arg.wir.wado index 23588ea93..c036c7c69 100644 --- a/wado-compiler/tests/fixtures.golden/sequence-literal-fn-arg.wir.wado +++ b/wado-compiler/tests/fixtures.golden/sequence-literal-fn-arg.wir.wado @@ -83,11 +83,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -144,11 +144,11 @@ fn run() with Stdout { __local_15 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_15; }) }; - Array::append(__local_0.items, 1); - Array::append(__local_0.items, 2); - Array::append(__local_0.items, 3); - Array::append(__local_0.items, 4); - Array::append(__local_0.items, 5); + Array::push(__local_0.items, 1); + Array::push(__local_0.items, 2); + Array::push(__local_0.items, 3); + Array::push(__local_0.items, 4); + Array::push(__local_0.items, 5); break __seq_lit: __local_0; }; __inline_Array_i32___len_2: block -> i32 { @@ -161,34 +161,34 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-fn-arg.wado"), used: 57 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-fn-arg.wado"), used: 57 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_31 = __local_9; i32::fmt_decimal(46, __local_31); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: result == 5 "), used: 24 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 101); - String::append_char(__local_8, 115); - String::append_char(__local_8, 117); - String::append_char(__local_8, 108); - String::append_char(__local_8, 116); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 114); + String::push(__local_8, 101); + String::push(__local_8, 115); + String::push(__local_8, 117); + String::push(__local_8, 108); + String::push(__local_8, 116); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_36 = __local_9; i32::fmt_decimal(result, __local_36); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -208,27 +208,27 @@ condition: result == 5 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-fn-arg.wado"), used: 57 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-fn-arg.wado"), used: 57 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_47 = __local_11; i32::fmt_decimal(50, __local_47); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: empty.len() == 0 "), used: 29 }); - String::append(__local_10, String { repr: array.new_data("empty.len(): "), used: 13 }); + String::push_str(__local_10, String { repr: array.new_data("empty.len(): "), used: 13 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_52 = __local_11; i32::fmt_decimal(__v0, __local_52); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -468,7 +468,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -483,7 +483,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -510,7 +510,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -563,7 +563,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l30; }; @@ -597,20 +597,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -620,10 +620,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -633,10 +633,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -644,10 +644,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/sequence-literal-immutable.wir.wado b/wado-compiler/tests/fixtures.golden/sequence-literal-immutable.wir.wado index 67eff05dc..d7064c21b 100644 --- a/wado-compiler/tests/fixtures.golden/sequence-literal-immutable.wir.wado +++ b/wado-compiler/tests/fixtures.golden/sequence-literal-immutable.wir.wado @@ -83,11 +83,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -176,27 +176,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_47 = __local_17; i32::fmt_decimal(48, __local_47); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: v.len() == 5 "), used: 25 }); - String::append(__local_16, String { repr: array.new_data("v.len(): "), used: 9 }); + String::push_str(__local_16, String { repr: array.new_data("v.len(): "), used: 9 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_52 = __local_17; i32::fmt_decimal(__v0_2, __local_52); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -213,27 +213,27 @@ condition: v.len() == 5 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_62 = __local_19; i32::fmt_decimal(49, __local_62); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: v.get(0) == 1 "), used: 26 }); - String::append(__local_18, String { repr: array.new_data("v.get(0): "), used: 10 }); + String::push_str(__local_18, String { repr: array.new_data("v.get(0): "), used: 10 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_67 = __local_19; i32::fmt_decimal(__v0_4, __local_67); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -250,27 +250,27 @@ condition: v.get(0) == 1 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_77 = __local_21; i32::fmt_decimal(50, __local_77); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: v.get(2) == 3 "), used: 26 }); - String::append(__local_20, String { repr: array.new_data("v.get(2): "), used: 10 }); + String::push_str(__local_20, String { repr: array.new_data("v.get(2): "), used: 10 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_82 = __local_21; i32::fmt_decimal(__v0_6, __local_82); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -287,27 +287,27 @@ condition: v.get(2) == 3 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_22, 114); - String::append_char(__local_22, 117); - String::append_char(__local_22, 110); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_22, 114); + String::push(__local_22, 117); + String::push(__local_22, 110); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_92 = __local_23; i32::fmt_decimal(51, __local_92); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: v.get(4) == 5 "), used: 26 }); - String::append(__local_22, String { repr: array.new_data("v.get(4): "), used: 10 }); + String::push_str(__local_22, String { repr: array.new_data("v.get(4): "), used: 10 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_97 = __local_23; i32::fmt_decimal(__v0_8, __local_97); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -324,27 +324,27 @@ condition: v.get(4) == 5 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_112 = __local_25; i32::fmt_decimal(55, __local_112); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: v2.len() == 2 "), used: 26 }); - String::append(__local_24, String { repr: array.new_data("v2.len(): "), used: 10 }); + String::push_str(__local_24, String { repr: array.new_data("v2.len(): "), used: 10 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_117 = __local_25; i32::fmt_decimal(__v0_12, __local_117); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -361,27 +361,27 @@ condition: v2.len() == 2 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_26, 114); - String::append_char(__local_26, 117); - String::append_char(__local_26, 110); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_26, 114); + String::push(__local_26, 117); + String::push(__local_26, 110); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-immutable.wado"), used: 60 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_127 = __local_27; i32::fmt_decimal(56, __local_127); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: v2.get(1) == 20 "), used: 28 }); - String::append(__local_26, String { repr: array.new_data("v2.get(1): "), used: 11 }); + String::push_str(__local_26, String { repr: array.new_data("v2.get(1): "), used: 11 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_132 = __local_27; i32::fmt_decimal(__v0_14, __local_132); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -621,7 +621,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -636,7 +636,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -663,7 +663,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -716,7 +716,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l38; }; @@ -750,20 +750,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -773,10 +773,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -786,10 +786,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -797,10 +797,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/sequence-literal-newtype.wir.wado b/wado-compiler/tests/fixtures.golden/sequence-literal-newtype.wir.wado index 080da9a82..55bbc27fc 100644 --- a/wado-compiler/tests/fixtures.golden/sequence-literal-newtype.wir.wado +++ b/wado-compiler/tests/fixtures.golden/sequence-literal-newtype.wir.wado @@ -108,7 +108,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -118,11 +118,11 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, f64); +type "functype/Array::push" = fn(ref Array, f64); type "functype/Array::grow" = fn(ref Array); @@ -221,31 +221,31 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-newtype.wado"), used: 58 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-newtype.wado"), used: 58 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_31 = __local_13; i32::fmt_decimal(41, __local_31); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: p.x == 1.0 "), used: 23 }); - String::append_char(__local_12, 112); - String::append_char(__local_12, 46); - String::append_char(__local_12, 120); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 112); + String::push(__local_12, 46); + String::push(__local_12, 120); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_36 = __local_13; f64::inspect_into(__v0_2, __local_36); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -255,31 +255,31 @@ condition: p.x == 1.0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-newtype.wado"), used: 58 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-newtype.wado"), used: 58 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_40 = __local_15; i32::fmt_decimal(42, __local_40); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: p.y == 2.0 "), used: 23 }); - String::append_char(__local_14, 112); - String::append_char(__local_14, 46); - String::append_char(__local_14, 121); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 112); + String::push(__local_14, 46); + String::push(__local_14, 121); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_45 = __local_15; f64::inspect_into(__v0_4, __local_45); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -289,31 +289,31 @@ condition: p.y == 2.0 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-newtype.wado"), used: 58 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-newtype.wado"), used: 58 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_49 = __local_17; i32::fmt_decimal(43, __local_49); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: p.z == 3.0 "), used: 23 }); - String::append_char(__local_16, 112); - String::append_char(__local_16, 46); - String::append_char(__local_16, 122); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 112); + String::push(__local_16, 46); + String::push(__local_16, 122); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_54 = __local_17; f64::inspect_into(__v0_6, __local_54); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -328,31 +328,31 @@ condition: p.z == 3.0 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-newtype.wado"), used: 58 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/sequence-literal-newtype.wado"), used: 58 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_66 = __local_19; i32::fmt_decimal(47, __local_66); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: v.x == 4.0 "), used: 23 }); - String::append_char(__local_18, 118); - String::append_char(__local_18, 46); - String::append_char(__local_18, 120); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 118); + String::push(__local_18, 46); + String::push(__local_18, 120); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_71 = __local_19; f64::inspect_into(__v0_10, __local_71); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -1121,8 +1121,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1177,13 +1177,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1191,25 +1191,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1217,7 +1217,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1259,8 +1259,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1292,7 +1292,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1421,27 +1421,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1564,9 +1564,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1576,8 +1576,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1632,13 +1632,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1673,9 +1673,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1728,7 +1728,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1743,7 +1743,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1798,7 +1798,7 @@ fn Vec3Builder^SequenceLiteralBuilder::build(self) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1851,7 +1851,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l173; }; @@ -2009,20 +2009,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2032,10 +2032,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2045,10 +2045,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2056,10 +2056,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_default_init.wir.wado b/wado-compiler/tests/fixtures.golden/serde_default_init.wir.wado index 9e6ec2997..088412770 100644 --- a/wado-compiler/tests/fixtures.golden/serde_default_init.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_default_init.wir.wado @@ -206,13 +206,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/JsonStructSerializer^SerializeStruct::field" = fn(ref "core:json/JsonStructSerializer", ref String, ref String) -> ref null "core:serde/SerializeError"; @@ -336,33 +336,33 @@ fn run() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_11, 114); - String::append_char(__local_11, 117); - String::append_char(__local_11, 110); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_default_init.wado"), used: 52 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_11, 114); + String::push(__local_11, 117); + String::push(__local_11, 110); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_default_init.wado"), used: 52 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_23 = __local_12; i32::fmt_decimal(21, __local_23); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: p.host == \"localhost\" "), used: 34 }); - String::append_char(__local_11, 112); - String::append_char(__local_11, 46); - String::append_char(__local_11, 104); - String::append_char(__local_11, 111); - String::append_char(__local_11, 115); - String::append_char(__local_11, 116); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 112); + String::push(__local_11, 46); + String::push(__local_11, 104); + String::push(__local_11, 111); + String::push(__local_11, 115); + String::push(__local_11, 116); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; String^Inspect::inspect(__v0_5, __local_12); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -372,34 +372,34 @@ condition: p.host == \"localhost\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_13, 114); - String::append_char(__local_13, 117); - String::append_char(__local_13, 110); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_default_init.wado"), used: 52 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_13, 114); + String::push(__local_13, 117); + String::push(__local_13, 110); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_default_init.wado"), used: 52 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_30 = __local_14; i32::fmt_decimal(22, __local_30); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: p.port == 8080 "), used: 27 }); - String::append_char(__local_13, 112); - String::append_char(__local_13, 46); - String::append_char(__local_13, 112); - String::append_char(__local_13, 111); - String::append_char(__local_13, 114); - String::append_char(__local_13, 116); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 112); + String::push(__local_13, 46); + String::push(__local_13, 112); + String::push(__local_13, 111); + String::push(__local_13, 114); + String::push(__local_13, 116); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_35 = __local_14; i32::fmt_decimal(__v0_7, __local_35); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -409,23 +409,23 @@ condition: p.port == 8080 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_15, 114); - String::append_char(__local_15, 117); - String::append_char(__local_15, 110); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_default_init.wado"), used: 52 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_15, 114); + String::push(__local_15, 117); + String::push(__local_15, 110); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_default_init.wado"), used: 52 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_41 = __local_16; i32::fmt_decimal(23, __local_41); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: p.debug == true "), used: 28 }); - String::append(__local_15, String { repr: array.new_data("p.debug: "), used: 9 }); + String::push_str(__local_15, String { repr: array.new_data("p.debug: "), used: 9 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_46 = __local_16; Formatter::pad(__local_46, if __v0_9 -> ref String { @@ -433,7 +433,7 @@ condition: p.debug == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -1073,7 +1073,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b107: block { l108: loop { @@ -1083,32 +1083,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b107; @@ -1116,7 +1116,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l108; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } fn char::from_u32(value) { @@ -1158,10 +1158,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1204,7 +1204,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1292,7 +1292,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1423,13 +1423,13 @@ fn Config^Deserialize::deserialize(d) { fn Config^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("host"), used: 4 }, self.host)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("port"), used: 4 }, self.port)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("debug"), used: 5 }, self.debug)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -1440,10 +1440,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_bool"(ser.buf, value); self.buf = ser.buf; @@ -1455,10 +1455,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i32"(ser.buf, value); self.buf = ser.buf; @@ -1470,10 +1470,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_JsonSerializer_Serializer__serialize_string_1: block -> ref null "core:serde/SerializeError" { "core:json/write_escaped_string"(ser.buf, value); @@ -1491,7 +1491,7 @@ fn __Closure_0::__call(self, __input, __start, __end) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -1502,16 +1502,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core fn "core:json/JsonSerializer^Serializer::serialize_bool"(self, v) { // from core:json if v { - String::append_char(self, 116); - String::append_char(self, 114); - String::append_char(self, 117); - String::append_char(self, 101); + String::push(self, 116); + String::push(self, 114); + String::push(self, 117); + String::push(self, 101); } else { - String::append_char(self, 102); - String::append_char(self, 97); - String::append_char(self, 108); - String::append_char(self, 115); - String::append_char(self, 101); + String::push(self, 102); + String::push(self, 97); + String::push(self, 108); + String::push(self, 115); + String::push(self, 101); }; return ref.null none; } @@ -1591,13 +1591,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -1663,9 +1663,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -1925,21 +1925,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -1949,7 +1949,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -1961,10 +1961,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return Result::Err { discriminant: 1, payload_0: ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -1989,7 +1989,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }) }; }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2004,7 +2004,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2026,7 +2026,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2054,7 +2054,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -2924,10 +2924,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -3155,7 +3155,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l343; }; @@ -3175,7 +3175,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3183,17 +3183,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3223,20 +3223,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3246,10 +3246,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3259,10 +3259,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3270,10 +3270,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3285,7 +3285,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3302,22 +3302,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b366; @@ -3325,7 +3325,7 @@ fn String^Inspect::inspect(self, f) { continue l367; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/serde_default_init.wado/__closure_wrapper_0"(__env, __p0, __p1, __p2) { diff --git a/wado-compiler/tests/fixtures.golden/serde_deserialize_trait.wir.wado b/wado-compiler/tests/fixtures.golden/serde_deserialize_trait.wir.wado index c2bcf4d50..0282c27cc 100644 --- a/wado-compiler/tests/fixtures.golden/serde_deserialize_trait.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_deserialize_trait.wir.wado @@ -120,9 +120,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -166,11 +166,11 @@ fn run() with Stdout { v_2 = ref.cast Result::Ok(i).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_7, 105); - String::append_char(__local_7, 51); - String::append_char(__local_7, 50); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 105); + String::push(__local_7, 51); + String::push(__local_7, 50); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(v_2, __local_8); break __tmpl: __local_7; @@ -181,15 +181,15 @@ fn run() with Stdout { v_4 = value_copy String(ref.cast Result::Ok(s).payload_0); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_9, 83); - String::append_char(__local_9, 116); - String::append_char(__local_9, 114); - String::append_char(__local_9, 105); - String::append_char(__local_9, 110); - String::append_char(__local_9, 103); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); - String::append(__local_9, v_4); + String::push(__local_9, 83); + String::push(__local_9, 116); + String::push(__local_9, 114); + String::push(__local_9, 105); + String::push(__local_9, 110); + String::push(__local_9, 103); + String::push(__local_9, 58); + String::push(__local_9, 32); + String::push_str(__local_9, v_4); break __tmpl: __local_9; }); }; @@ -399,7 +399,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -414,7 +414,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -452,7 +452,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -486,20 +486,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -509,10 +509,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -522,10 +522,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -533,10 +533,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_error_types.wir.wado b/wado-compiler/tests/fixtures.golden/serde_error_types.wir.wado index 3b9728609..f40a1c050 100644 --- a/wado-compiler/tests/fixtures.golden/serde_error_types.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_error_types.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -109,16 +109,16 @@ fn run() with Stdout { __sroa_se_message = String { repr: array.new_data("test error"), used: 10 }; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_4, String { repr: array.new_data("SerializeError: "), used: 16 }); - String::append(__local_4, __sroa_se_message); + String::push_str(__local_4, String { repr: array.new_data("SerializeError: "), used: 16 }); + String::push_str(__local_4, __sroa_se_message); break __tmpl: __local_4; }); __sroa_de_message = String { repr: array.new_data("field 'name' is missing"), used: 23 }; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(61), used: 0 }; - String::append(__local_5, String { repr: array.new_data("DeserializeError: "), used: 18 }); - String::append(__local_5, __sroa_de_message); - String::append(__local_5, String { repr: array.new_data(" at offset "), used: 11 }); + String::push_str(__local_5, String { repr: array.new_data("DeserializeError: "), used: 18 }); + String::push_str(__local_5, __sroa_de_message); + String::push_str(__local_5, String { repr: array.new_data(" at offset "), used: 11 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i64::fmt_decimal(42_i64, __local_6); break __tmpl: __local_5; @@ -173,13 +173,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_7, 75); - String::append_char(__local_7, 105); - String::append_char(__local_7, 110); - String::append_char(__local_7, 100); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); - String::append(__local_7, label); + String::push(__local_7, 75); + String::push(__local_7, 105); + String::push(__local_7, 110); + String::push(__local_7, 100); + String::push(__local_7, 58); + String::push(__local_7, 32); + String::push_str(__local_7, label); break __tmpl: __local_7; }); } @@ -402,7 +402,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -417,7 +417,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -455,7 +455,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l36; }; @@ -489,20 +489,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -512,10 +512,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -525,10 +525,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -536,10 +536,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_full_json_serialize.wir.wado b/wado-compiler/tests/fixtures.golden/serde_full_json_serialize.wir.wado index c19223dfc..8f070d2d2 100644 --- a/wado-compiler/tests/fixtures.golden/serde_full_json_serialize.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_full_json_serialize.wir.wado @@ -148,7 +148,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -158,11 +158,11 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -1062,8 +1062,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1118,8 +1118,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1151,7 +1151,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1280,27 +1280,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1421,9 +1421,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1477,13 +1477,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1518,9 +1518,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1573,7 +1573,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1588,7 +1588,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1627,7 +1627,7 @@ fn JsonSerializer^Serializer::serialize_i32(self, v) { i32::fmt_decimal(v, __local_3); break __tmpl: __local_2; }; - String::append(self_4.buf, s); + String::push_str(self_4.buf, s); return ref.null none; } @@ -1643,7 +1643,7 @@ fn JsonSerializer^Serializer::serialize_f64(self, v) { f64::fmt_into(v, __local_3); break __tmpl: __local_2; }; - String::append(self_4.buf, s); + String::push_str(self_4.buf, s); return ref.null none; } @@ -1655,11 +1655,11 @@ fn JsonSerializer^Serializer::serialize_bool(self, v) { if v { self_2 = self; s_3 = String { repr: array.new_data("true"), used: 4 }; - String::append(self_2.buf, s_3); + String::push_str(self_2.buf, s_3); } else { self_4 = self; s_5 = String { repr: array.new_data("false"), used: 5 }; - String::append(self_4.buf, s_5); + String::push_str(self_4.buf, s_5); }; return ref.null none; } @@ -1671,16 +1671,16 @@ fn JsonSerializer^Serializer::serialize_string(self, v) { self_3 = self; s = __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); - String::append(__local_2, v); - String::append_char(__local_2, 34); + String::push(__local_2, 34); + String::push_str(__local_2, v); + String::push(__local_2, 34); break __tmpl: __local_2; }; - String::append(self_3.buf, s); + String::push_str(self_3.buf, s); return ref.null none; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1732,7 +1732,7 @@ fn User^Serialize::serialize(self, s) { __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { self_8 = s; s_9 = String { repr: array.new_data("{"), used: 1 }; - String::append(self_8.buf, s_9); + String::push_str(self_8.buf, s_9); __fused_payload_13 = JsonStructSerializer { w: s, count: 0 }; st = __fused_payload_13; drop(JsonStructSerializer^SerializeStruct::field(st, String { repr: array.new_data("name"), used: 4 }, self.name)); @@ -1743,7 +1743,7 @@ fn User^Serialize::serialize(self, s) { return __inline_JsonStructSerializer_SerializeStruct__end_2: block -> ref null SerializeError { __local_11 = st.w; __local_12 = String { repr: array.new_data("}"), used: 1 }; - String::append(__local_11.buf, __local_12); + String::push_str(__local_11.buf, __local_12); break __inline_JsonStructSerializer_SerializeStruct__end_2: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -1761,18 +1761,18 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value) if self.count > 0 { self_5 = self.w; s_6 = String { repr: array.new_data(","), used: 1 }; - String::append(self_5.buf, s_6); + String::push_str(self_5.buf, s_6); }; self_7 = self.w; s_8 = __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 34); - String::append(__local_4, name); - String::append_char(__local_4, 34); - String::append_char(__local_4, 58); + String::push(__local_4, 34); + String::push_str(__local_4, name); + String::push(__local_4, 34); + String::push(__local_4, 58); break __tmpl: __local_4; }; - String::append(self_7.buf, s_8); + String::push_str(self_7.buf, s_8); ser = JsonSerializer { w: self.w }; drop(Array^Serialize::serialize(value, ser.w)); self.w = ser.w; @@ -1794,7 +1794,7 @@ fn Array^Serialize::serialize(self, s) { __fused___inline_JsonSerializer_Serializer__begin_seq_0: block { self_11 = s; s_12 = String { repr: array.new_data("["), used: 1 }; - String::append(self_11.buf, s_12); + String::push_str(self_11.buf, s_12); __fused_payload_17 = JsonSeqSerializer { w: s, count: 0 }; seq = __fused_payload_17; __iter_4 = __inline_Array_String__IntoIterator__into_iter_3: block -> ref ArrayIter { @@ -1816,7 +1816,7 @@ fn Array^Serialize::serialize(self, s) { return __inline_JsonSeqSerializer_SerializeSeq__end_4: block -> ref null SerializeError { __local_15 = seq.w; __local_16 = String { repr: array.new_data("]"), used: 1 }; - String::append(__local_15.buf, __local_16); + String::push_str(__local_15.buf, __local_16); break __inline_JsonSeqSerializer_SerializeSeq__end_4: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_seq_0; @@ -1831,7 +1831,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { if self.count > 0 { self_3 = self.w; s = String { repr: array.new_data(","), used: 1 }; - String::append(self_3.buf, s); + String::push_str(self_3.buf, s); }; ser = JsonSerializer { w: self.w }; drop(JsonSerializer^Serializer::serialize_string(ser.w, value)); @@ -1865,18 +1865,18 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value) if self.count > 0 { self_5 = self.w; s_6 = String { repr: array.new_data(","), used: 1 }; - String::append(self_5.buf, s_6); + String::push_str(self_5.buf, s_6); }; self_7 = self.w; s_8 = __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 34); - String::append(__local_4, name); - String::append_char(__local_4, 34); - String::append_char(__local_4, 58); + String::push(__local_4, 34); + String::push_str(__local_4, name); + String::push(__local_4, 34); + String::push(__local_4, 58); break __tmpl: __local_4; }; - String::append(self_7.buf, s_8); + String::push_str(self_7.buf, s_8); ser = JsonSerializer { w: self.w }; drop(__inline_Option_Point__Serialize__serialize_JsonSerializer__3: block -> ref null SerializeError { __local_11 = ser; @@ -1888,7 +1888,7 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value) __inline_JsonSerializer_Serializer__serialize_null_4: block -> ref null SerializeError { __local_15 = __local_11.w; __local_16 = String { repr: array.new_data("null"), used: 4 }; - String::append(__local_15.buf, __local_16); + String::push_str(__local_15.buf, __local_16); break __inline_JsonSerializer_Serializer__serialize_null_4: ref.null none; }; break __inline_Option_Point__Serialize__serialize_JsonSerializer__3; @@ -1908,7 +1908,7 @@ fn Point^Serialize::serialize(self, s) { __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { self_8 = s; s_9 = String { repr: array.new_data("{"), used: 1 }; - String::append(self_8.buf, s_9); + String::push_str(self_8.buf, s_9); __fused_payload_13 = JsonStructSerializer { w: s, count: 0 }; st = __fused_payload_13; drop(JsonStructSerializer^SerializeStruct::field(st, String { repr: array.new_data("x"), used: 1 }, self.x)); @@ -1916,7 +1916,7 @@ fn Point^Serialize::serialize(self, s) { return __inline_JsonStructSerializer_SerializeStruct__end_2: block -> ref null SerializeError { __local_11 = st.w; __local_12 = String { repr: array.new_data("}"), used: 1 }; - String::append(__local_11.buf, __local_12); + String::push_str(__local_11.buf, __local_12); break __inline_JsonStructSerializer_SerializeStruct__end_2: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -1934,18 +1934,18 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { if self.count > 0 { self_5 = self.w; s_6 = String { repr: array.new_data(","), used: 1 }; - String::append(self_5.buf, s_6); + String::push_str(self_5.buf, s_6); }; self_7 = self.w; s_8 = __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 34); - String::append(__local_4, name); - String::append_char(__local_4, 34); - String::append_char(__local_4, 58); + String::push(__local_4, 34); + String::push_str(__local_4, name); + String::push(__local_4, 34); + String::push(__local_4, 58); break __tmpl: __local_4; }; - String::append(self_7.buf, s_8); + String::push_str(self_7.buf, s_8); ser = JsonSerializer { w: self.w }; drop(JsonSerializer^Serializer::serialize_f64(ser.w, value)); self.w = ser.w; @@ -1963,18 +1963,18 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { if self.count > 0 { self_5 = self.w; s_6 = String { repr: array.new_data(","), used: 1 }; - String::append(self_5.buf, s_6); + String::push_str(self_5.buf, s_6); }; self_7 = self.w; s_8 = __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 34); - String::append(__local_4, name); - String::append_char(__local_4, 34); - String::append_char(__local_4, 58); + String::push(__local_4, 34); + String::push_str(__local_4, name); + String::push(__local_4, 34); + String::push(__local_4, 58); break __tmpl: __local_4; }; - String::append(self_7.buf, s_8); + String::push_str(self_7.buf, s_8); ser = JsonSerializer { w: self.w }; drop(JsonSerializer^Serializer::serialize_bool(ser.w, value)); self.w = ser.w; @@ -1992,18 +1992,18 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { if self.count > 0 { self_5 = self.w; s_6 = String { repr: array.new_data(","), used: 1 }; - String::append(self_5.buf, s_6); + String::push_str(self_5.buf, s_6); }; self_7 = self.w; s_8 = __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 34); - String::append(__local_4, name); - String::append_char(__local_4, 34); - String::append_char(__local_4, 58); + String::push(__local_4, 34); + String::push_str(__local_4, name); + String::push(__local_4, 34); + String::push(__local_4, 58); break __tmpl: __local_4; }; - String::append(self_7.buf, s_8); + String::push_str(self_7.buf, s_8); ser = JsonSerializer { w: self.w }; drop(JsonSerializer^Serializer::serialize_i32(ser.w, value)); self.w = ser.w; @@ -2021,18 +2021,18 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { if self.count > 0 { self_5 = self.w; s_6 = String { repr: array.new_data(","), used: 1 }; - String::append(self_5.buf, s_6); + String::push_str(self_5.buf, s_6); }; self_7 = self.w; s_8 = __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 34); - String::append(__local_4, name); - String::append_char(__local_4, 34); - String::append_char(__local_4, 58); + String::push(__local_4, 34); + String::push_str(__local_4, name); + String::push(__local_4, 34); + String::push(__local_4, 58); break __tmpl: __local_4; }; - String::append(self_7.buf, s_8); + String::push_str(self_7.buf, s_8); ser = JsonSerializer { w: self.w }; drop(JsonSerializer^Serializer::serialize_string(ser.w, value)); self.w = ser.w; @@ -2051,7 +2051,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l170; }; @@ -2209,20 +2209,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2232,10 +2232,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2245,10 +2245,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2256,10 +2256,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_generic_trait_method.wir.wado b/wado-compiler/tests/fixtures.golden/serde_generic_trait_method.wir.wado index b52d9ada6..f3dce6410 100644 --- a/wado-compiler/tests/fixtures.golden/serde_generic_trait_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_generic_trait_method.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -99,15 +99,15 @@ fn run() with Stdout { let __local_8: ref Formatter; let __sroa_buf_data: ref String; __sroa_buf_data = String { repr: builtin::array_new(0), used: 0 }; - String::append(__sroa_buf_data, __tmpl: block -> ref String { + String::push_str(__sroa_buf_data, __tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(16), used: 0 }; __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(42, __local_8); break __tmpl: __local_7; }); - String::append_char(__sroa_buf_data, 44); + String::push(__sroa_buf_data, 44); s = String { repr: array.new_data("hello"), used: 5 }; - String::append(__sroa_buf_data, s); + String::push_str(__sroa_buf_data, s); "core:cli/println"(__sroa_buf_data); } @@ -306,7 +306,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -321,7 +321,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -359,7 +359,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -393,20 +393,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -416,10 +416,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -440,10 +440,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_json_array_string.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_array_string.wir.wado index 7581ec080..7a434053a 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_array_string.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_array_string.wir.wado @@ -51,10 +51,10 @@ struct Formatter { mut buf: ref String, } -array array (mut i32); - array array (mut ref String); +array array (mut i32); + struct ArrayIter { // from wasi:cli/types.wado // ArrayIter with T=String mut repr: ref array, mut used: i32, @@ -158,15 +158,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -174,7 +174,7 @@ type "functype/JsonSeqSerializer^SerializeSeq::element" = fn(ref "core:j type "functype/ArrayIter^Iterator::next" = fn(ref "wasi:cli/types.wado/ArrayIter") -> ref null String; -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -257,26 +257,26 @@ fn __test_0_serialize_array_string_() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_0_serialize_array_string_"), used: 32 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_array_string.wado"), used: 57 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_0_serialize_array_string_"), used: 32 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_array_string.wado"), used: 57 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_20 = __local_7; i32::fmt_decimal(11, __local_20); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: s == `[\"hello\",\"world\"]` "), used: 37 }); - String::append_char(__local_6, 115); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 115); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -311,26 +311,26 @@ fn __test_1_serialize_array_i32_() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_1_serialize_array_i32_"), used: 29 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_array_string.wado"), used: 57 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_1_serialize_array_i32_"), used: 29 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_array_string.wado"), used: 57 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_22 = __local_7; i32::fmt_decimal(21, __local_22); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: s == \"[1,2,3]\" "), used: 27 }); - String::append_char(__local_6, 115); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 115); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -365,27 +365,27 @@ fn __test_2_roundtrip_i32() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_2_roundtrip_i32"), used: 22 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_array_string.wado"), used: 57 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_2_roundtrip_i32"), used: 22 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_array_string.wado"), used: 57 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_15 = __local_8; i32::fmt_decimal(33, __local_15); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: v == 42 "), used: 20 }); - String::append_char(__local_7, 118); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 118); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_20 = __local_8; i32::fmt_decimal(v, __local_20); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -981,7 +981,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b91: block { l92: loop { @@ -991,32 +991,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b91; @@ -1024,7 +1024,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l92; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } fn i32::fmt_decimal(self, f) { @@ -1081,7 +1081,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1169,7 +1169,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1207,7 +1207,7 @@ fn Array^Serialize::serialize(self, s) { let __local_16: ref Array; seq_2 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { __local_14 = self.used; - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(seq_2) { @@ -1234,7 +1234,7 @@ fn Array^Serialize::serialize(self, s) { }; }; return __inline_JsonSeqSerializer_SerializeSeq__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(seq_3.buf, 93); + String::push(seq_3.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_3: ref.null none; }; }; @@ -1249,7 +1249,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i32"(ser.buf, value); @@ -1268,7 +1268,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1323,7 +1323,7 @@ fn Array^Serialize::serialize(self, s) { let __local_16: ref Array; seq_2 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { __local_14 = self.used; - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(seq_2) { @@ -1349,7 +1349,7 @@ fn Array^Serialize::serialize(self, s) { }; }; return __inline_JsonSeqSerializer_SerializeSeq__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(seq_3.buf, 93); + String::push(seq_3.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_3: ref.null none; }; }; @@ -1364,7 +1364,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_JsonSerializer_Serializer__serialize_string_1: block -> ref null "core:serde/SerializeError" { @@ -1386,7 +1386,7 @@ fn ArrayIter^Iterator::next(self) { return item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1431,7 +1431,7 @@ fn Array::grow(self) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -1750,7 +1750,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l186; }; @@ -1784,20 +1784,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1807,10 +1807,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1820,10 +1820,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1831,10 +1831,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1846,7 +1846,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1863,22 +1863,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b205; @@ -1886,7 +1886,7 @@ fn String^Inspect::inspect(self, f) { continue l206; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_serialize_array_string_ as "__test_0_serialize_array_string_" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_default.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_default.wir.wado index b12dcb51a..18e8c66c5 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_default.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_default.wir.wado @@ -240,19 +240,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Option^Deserialize::deserialize" = fn(ref "core:json/JsonDeserializer") -> ref Result,DeserializeError>; type "functype/Array^Deserialize::deserialize" = fn(ref "core:json/JsonDeserializer") -> ref Result,DeserializeError>; -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -369,31 +369,31 @@ fn __test_0_missing_default_fields_use_zero_values() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_0_missing_default_fields_use_zero_values"), used: 47 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_0_missing_default_fields_use_zero_values"), used: 47 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_24 = __local_11; i32::fmt_decimal(29, __local_24); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: c.host == \"localhost\" "), used: 34 }); - String::append_char(__local_10, 99); - String::append_char(__local_10, 46); - String::append_char(__local_10, 104); - String::append_char(__local_10, 111); - String::append_char(__local_10, 115); - String::append_char(__local_10, 116); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 99); + String::push(__local_10, 46); + String::push(__local_10, 104); + String::push(__local_10, 111); + String::push(__local_10, 115); + String::push(__local_10, 116); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_2, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -403,32 +403,32 @@ condition: c.host == \"localhost\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_0_missing_default_fields_use_zero_values"), used: 47 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_0_missing_default_fields_use_zero_values"), used: 47 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_31 = __local_13; i32::fmt_decimal(30, __local_31); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: c.port == 0 "), used: 24 }); - String::append_char(__local_12, 99); - String::append_char(__local_12, 46); - String::append_char(__local_12, 112); - String::append_char(__local_12, 111); - String::append_char(__local_12, 114); - String::append_char(__local_12, 116); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 99); + String::push(__local_12, 46); + String::push(__local_12, 112); + String::push(__local_12, 111); + String::push(__local_12, 114); + String::push(__local_12, 116); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_36 = __local_13; i32::fmt_decimal(__v0_4, __local_36); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -438,21 +438,21 @@ condition: c.port == 0 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_0_missing_default_fields_use_zero_values"), used: 47 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_0_missing_default_fields_use_zero_values"), used: 47 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_42 = __local_15; i32::fmt_decimal(31, __local_42); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: c.verbose == false "), used: 31 }); - String::append(__local_14, String { repr: array.new_data("c.verbose: "), used: 11 }); + String::push_str(__local_14, String { repr: array.new_data("c.verbose: "), used: 11 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_47 = __local_15; Formatter::pad(__local_47, if __v0_6 -> ref String { @@ -460,7 +460,7 @@ condition: c.verbose == false } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -473,25 +473,25 @@ condition: c.verbose == false if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_0_missing_default_fields_use_zero_values"), used: 47 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_0_missing_default_fields_use_zero_values"), used: 47 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_54 = __local_17; i32::fmt_decimal(32, __local_54); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: c.tags.len() == 0 "), used: 30 }); - String::append(__local_16, String { repr: array.new_data("c.tags.len(): "), used: 14 }); + String::push_str(__local_16, String { repr: array.new_data("c.tags.len(): "), used: 14 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_59 = __local_17; i32::fmt_decimal(__v0_8, __local_59); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -552,31 +552,31 @@ fn __test_1_provided_fields_override_defaults() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_1_provided_fields_override_defaults"), used: 42 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_1_provided_fields_override_defaults"), used: 42 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_29 = __local_14; i32::fmt_decimal(46, __local_29); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: c.host == \"example.com\" "), used: 36 }); - String::append_char(__local_13, 99); - String::append_char(__local_13, 46); - String::append_char(__local_13, 104); - String::append_char(__local_13, 111); - String::append_char(__local_13, 115); - String::append_char(__local_13, 116); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 99); + String::push(__local_13, 46); + String::push(__local_13, 104); + String::push(__local_13, 111); + String::push(__local_13, 115); + String::push(__local_13, 116); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; String^Inspect::inspect(__v0_2, __local_14); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -586,32 +586,32 @@ condition: c.host == \"example.com\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_1_provided_fields_override_defaults"), used: 42 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_1_provided_fields_override_defaults"), used: 42 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_36 = __local_16; i32::fmt_decimal(47, __local_36); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: c.port == 8080 "), used: 27 }); - String::append_char(__local_15, 99); - String::append_char(__local_15, 46); - String::append_char(__local_15, 112); - String::append_char(__local_15, 111); - String::append_char(__local_15, 114); - String::append_char(__local_15, 116); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 99); + String::push(__local_15, 46); + String::push(__local_15, 112); + String::push(__local_15, 111); + String::push(__local_15, 114); + String::push(__local_15, 116); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_41 = __local_16; i32::fmt_decimal(__v0_4, __local_41); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -621,21 +621,21 @@ condition: c.port == 8080 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_1_provided_fields_override_defaults"), used: 42 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_1_provided_fields_override_defaults"), used: 42 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_47 = __local_18; i32::fmt_decimal(48, __local_47); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: c.verbose == true "), used: 30 }); - String::append(__local_17, String { repr: array.new_data("c.verbose: "), used: 11 }); + String::push_str(__local_17, String { repr: array.new_data("c.verbose: "), used: 11 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_52 = __local_18; Formatter::pad(__local_52, if __v0_6 -> ref String { @@ -643,7 +643,7 @@ condition: c.verbose == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -656,25 +656,25 @@ condition: c.verbose == true if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_1_provided_fields_override_defaults"), used: 42 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_1_provided_fields_override_defaults"), used: 42 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_59 = __local_20; i32::fmt_decimal(49, __local_59); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: c.tags.len() == 1 "), used: 30 }); - String::append(__local_19, String { repr: array.new_data("c.tags.len(): "), used: 14 }); + String::push_str(__local_19, String { repr: array.new_data("c.tags.len(): "), used: 14 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_64 = __local_20; i32::fmt_decimal(__v0_8, __local_64); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -687,26 +687,26 @@ condition: c.tags.len() == 1 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_1_provided_fields_override_defaults"), used: 42 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_1_provided_fields_override_defaults"), used: 42 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_default.wado"), used: 52 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_70 = __local_22; i32::fmt_decimal(51, __local_70); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: d == \"test\" "), used: 24 }); - String::append_char(__local_21, 100); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 100); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; String^Inspect::inspect(__v0_11, __local_22); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -1463,10 +1463,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1509,7 +1509,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1597,7 +1597,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1822,7 +1822,7 @@ fn Array^Deserialize::deserialize(d) { if ref.is_null(first_opt) == 0 { first_elem = value_copy String(ref.as_non_null(first_opt)); items = Array { repr: builtin::array_new(2), used: 0 }; - Array::append(items, first_elem); + Array::push(items, first_elem); block { l182: loop { let __sroa_next_discriminant: i32; @@ -1833,7 +1833,7 @@ fn Array^Deserialize::deserialize(d) { next_opt = __sroa_next_case0_payload_0; if ref.is_null(next_opt) == 0 { item = value_copy String(ref.as_non_null(next_opt)); - Array::append(items, item); + Array::push(items, item); } else { end_result_12 = "core:json/JsonDeserializer::expect_char"(seq.de, 93); if ref.is_null(end_result_12) == 0 { @@ -1877,7 +1877,7 @@ fn Array^Deserialize::deserialize(d) { unreachable; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2050,13 +2050,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -2122,9 +2122,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -2384,21 +2384,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -2408,7 +2408,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -2420,10 +2420,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return Result::Err { discriminant: 1, payload_0: ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -2448,7 +2448,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }) }; }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2463,7 +2463,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2485,7 +2485,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2513,7 +2513,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -3383,10 +3383,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -3676,7 +3676,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l395; }; @@ -3696,7 +3696,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3704,17 +3704,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3744,20 +3744,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3767,10 +3767,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3780,10 +3780,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3791,10 +3791,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3806,7 +3806,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3823,22 +3823,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b418; @@ -3846,7 +3846,7 @@ fn String^Inspect::inspect(self, f) { continue l419; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/serde_json_default.wado/__closure_wrapper_0"(__env, __p0, __p1, __p2) { diff --git a/wado-compiler/tests/fixtures.golden/serde_json_deser_error.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_deser_error.wir.wado index f88be2e1a..13ac9bec8 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_deser_error.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_deser_error.wir.wado @@ -237,13 +237,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/__Closure_0::__call" = fn(ref __Closure_0, ref String, i32, i32) -> ref Option; @@ -334,24 +334,24 @@ fn __test_0_invalid_json___not_an_object() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(186), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_0_invalid_json___not_an_object"), used: 37 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_0_invalid_json___not_an_object"), used: 37 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_12 = __local_3; i32::fmt_decimal(23, __local_12); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: deser_msg(\"not json at all\") == \"begin_struct failed\" "), used: 66 }); - String::append(__local_2, String { repr: array.new_data("deser_msg(\"not json at all\"): "), used: 30 }); + String::push_str(__local_2, String { repr: array.new_data("deser_msg(\"not json at all\"): "), used: 30 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; String^Inspect::inspect(__v0, __local_3); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -380,24 +380,24 @@ fn __test_1_invalid_json___empty_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_1_invalid_json___empty_string"), used: 36 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_1_invalid_json___empty_string"), used: 36 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_12 = __local_3; i32::fmt_decimal(27, __local_12); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: deser_msg(\"\") == \"begin_struct failed\" "), used: 51 }); - String::append(__local_2, String { repr: array.new_data("deser_msg(\"\"): "), used: 15 }); + String::push_str(__local_2, String { repr: array.new_data("deser_msg(\"\"): "), used: 15 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; String^Inspect::inspect(__v0, __local_3); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -426,24 +426,24 @@ fn __test_2_invalid_json___truncated_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(184), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_2_invalid_json___truncated_string"), used: 40 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_2_invalid_json___truncated_string"), used: 40 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_12 = __local_3; i32::fmt_decimal(31, __local_12); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: deser_msg(`\\{\"name\":\"Al`) == \"unexpected end of input\" "), used: 67 }); - String::append(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":\"Al`): "), used: 27 }); + String::push_str(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":\"Al`): "), used: 27 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; String^Inspect::inspect(__v0, __local_3); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -472,24 +472,24 @@ fn __test_3_missing_required_field() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(223), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_3_missing_required_field"), used: 31 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_3_missing_required_field"), used: 31 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_12 = __local_3; i32::fmt_decimal(35, __local_12); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: deser_msg(`\\{\"name\":\"Alice\",\"active\":true\\}`) == \"required field missing\" "), used: 86 }); - String::append(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":\"Alice\",\"active\":true\\}`): "), used: 47 }); + String::push_str(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":\"Alice\",\"active\":true\\}`): "), used: 47 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; String^Inspect::inspect(__v0, __local_3); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -518,24 +518,24 @@ fn __test_4_type_mismatch___string_where_number_expected() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(246), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_4_type_mismatch___string_where_number_expected"), used: 53 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_4_type_mismatch___string_where_number_expected"), used: 53 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_12 = __local_3; i32::fmt_decimal(39, __local_12); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: deser_msg(`\\{\"name\":\"Alice\",\"age\":\"thirty\",\"active\":true\\}`) == \"expected number\" "), used: 94 }); - String::append(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":\"Alice\",\"age\":\"thirty\",\"active\":true\\}`): "), used: 62 }); + String::push_str(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":\"Alice\",\"age\":\"thirty\",\"active\":true\\}`): "), used: 62 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; String^Inspect::inspect(__v0, __local_3); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -564,24 +564,24 @@ fn __test_5_type_mismatch___number_where_string_expected() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(224), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_5_type_mismatch___number_where_string_expected"), used: 53 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_5_type_mismatch___number_where_string_expected"), used: 53 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_12 = __local_3; i32::fmt_decimal(43, __local_12); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: deser_msg(`\\{\"name\":42,\"age\":30,\"active\":true\\}`) == \"expected string\" "), used: 83 }); - String::append(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":42,\"age\":30,\"active\":true\\}`): "), used: 51 }); + String::push_str(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":42,\"age\":30,\"active\":true\\}`): "), used: 51 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; String^Inspect::inspect(__v0, __local_3); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -610,24 +610,24 @@ fn __test_6_type_mismatch___number_where_bool_expected() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(226), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_6_type_mismatch___number_where_bool_expected"), used: 51 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_6_type_mismatch___number_where_bool_expected"), used: 51 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_12 = __local_3; i32::fmt_decimal(47, __local_12); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: deser_msg(`\\{\"name\":\"Alice\",\"age\":30,\"active\":1\\}`) == \"expected bool\" "), used: 83 }); - String::append(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":\"Alice\",\"age\":30,\"active\":1\\}`): "), used: 53 }); + String::push_str(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":\"Alice\",\"age\":30,\"active\":1\\}`): "), used: 53 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; String^Inspect::inspect(__v0, __local_3); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -656,24 +656,24 @@ fn __test_7_trailing_data_after_valid_json() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(254), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_7_trailing_data_after_valid_json"), used: 39 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_7_trailing_data_after_valid_json"), used: 39 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_12 = __local_3; i32::fmt_decimal(51, __local_12); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: deser_msg(`\\{\"name\":\"Alice\",\"age\":30,\"active\":true\\}extra`) == \"trailing data after value\" "), used: 103 }); - String::append(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":\"Alice\",\"age\":30,\"active\":true\\}extra`): "), used: 61 }); + String::push_str(__local_2, String { repr: array.new_data("deser_msg(`\\{\"name\":\"Alice\",\"age\":30,\"active\":true\\}extra`): "), used: 61 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; String^Inspect::inspect(__v0, __local_3); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -708,31 +708,31 @@ fn __test_8_valid_input_still_works() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_8_valid_input_still_works"), used: 32 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_8_valid_input_still_works"), used: 32 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_19 = __local_9; i32::fmt_decimal(57, __local_19); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: u.name == \"Alice\" "), used: 30 }); - String::append_char(__local_8, 117); - String::append_char(__local_8, 46); - String::append_char(__local_8, 110); - String::append_char(__local_8, 97); - String::append_char(__local_8, 109); - String::append_char(__local_8, 101); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 117); + String::push(__local_8, 46); + String::push(__local_8, 110); + String::push(__local_8, 97); + String::push(__local_8, 109); + String::push(__local_8, 101); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0_2, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -742,31 +742,31 @@ condition: u.name == \"Alice\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_8_valid_input_still_works"), used: 32 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_8_valid_input_still_works"), used: 32 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_26 = __local_11; i32::fmt_decimal(58, __local_26); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: u.age == 30 "), used: 24 }); - String::append_char(__local_10, 117); - String::append_char(__local_10, 46); - String::append_char(__local_10, 97); - String::append_char(__local_10, 103); - String::append_char(__local_10, 101); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 117); + String::push(__local_10, 46); + String::push(__local_10, 97); + String::push(__local_10, 103); + String::push(__local_10, 101); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_31 = __local_11; i32::fmt_decimal(__v0_4, __local_31); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -776,21 +776,21 @@ condition: u.age == 30 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_8_valid_input_still_works"), used: 32 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_8_valid_input_still_works"), used: 32 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error.wado"), used: 56 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_37 = __local_13; i32::fmt_decimal(59, __local_37); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: u.active == true "), used: 29 }); - String::append(__local_12, String { repr: array.new_data("u.active: "), used: 10 }); + String::push_str(__local_12, String { repr: array.new_data("u.active: "), used: 10 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_42 = __local_13; Formatter::pad(__local_42, if __v0_6 -> ref String { @@ -798,7 +798,7 @@ condition: u.active == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -1487,10 +1487,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1533,7 +1533,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1621,7 +1621,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1828,13 +1828,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -1900,9 +1900,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -2162,21 +2162,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -2186,7 +2186,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -2198,10 +2198,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return Result::Err { discriminant: 1, payload_0: ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -2226,7 +2226,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }) }; }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2241,7 +2241,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2263,7 +2263,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2291,7 +2291,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -3161,10 +3161,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -3392,7 +3392,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l343; }; @@ -3412,7 +3412,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3420,17 +3420,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3460,20 +3460,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3483,10 +3483,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3496,10 +3496,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3507,10 +3507,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3522,7 +3522,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3539,22 +3539,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b366; @@ -3562,7 +3562,7 @@ fn String^Inspect::inspect(self, f) { continue l367; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/serde_json_deser_error.wado/__closure_wrapper_0"(__env, __p0, __p1, __p2) { diff --git a/wado-compiler/tests/fixtures.golden/serde_json_deser_error_edge.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_deser_error_edge.wir.wado index c62fa162b..25142b1ba 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_deser_error_edge.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_deser_error_edge.wir.wado @@ -351,7 +351,7 @@ type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, re type "functype/core:json/utf8_sequence_length" = fn(i32) -> i32; -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -363,15 +363,15 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -566,24 +566,24 @@ fn __test_2_number_where_bool_expected() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_2_number_where_bool_expected"), used: 35 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_2_number_where_bool_expected"), used: 35 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(28, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: e.message == \"expected bool\" "), used: 41 }); - String::append(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -619,24 +619,24 @@ fn __test_3_number_where_string_expected() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_3_number_where_string_expected"), used: 37 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_3_number_where_string_expected"), used: 37 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(37, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: e.message == \"expected string\" "), used: 43 }); - String::append(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -767,24 +767,24 @@ fn __test_9_truncated_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_9_truncated_string"), used: 25 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_9_truncated_string"), used: 25 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(93, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: e.message == \"unexpected end of input\" "), used: 51 }); - String::append(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -820,24 +820,24 @@ fn __test_10_trailing_garbage() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_10_trailing_garbage"), used: 26 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_10_trailing_garbage"), used: 26 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(102, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: e.message == \"trailing data after value\" "), used: 53 }); - String::append(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -873,24 +873,24 @@ fn __test_11_multiple_values() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_11_multiple_values"), used: 25 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_11_multiple_values"), used: 25 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(111, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: e.message == \"trailing data after value\" "), used: 53 }); - String::append(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -945,24 +945,24 @@ fn __test_13_u32_too_large() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(155), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_13_u32_too_large"), used: 23 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_13_u32_too_large"), used: 23 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(131, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: e.message == \"value out of range for u32\" "), used: 54 }); - String::append(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -998,24 +998,24 @@ fn __test_14_f64_nan_serialize_error() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(155), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_14_f64_nan_serialize_error"), used: 33 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_14_f64_nan_serialize_error"), used: 33 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(143, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: e.message == \"NaN is not allowed in JSON\" "), used: 54 }); - String::append(__local_5, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_5, String { repr: array.new_data("e.message: "), used: 11 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1051,24 +1051,24 @@ fn __test_15_f64_infinity_serialize_error() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(160), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_15_f64_infinity_serialize_error"), used: 38 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_15_f64_infinity_serialize_error"), used: 38 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(153, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: e.message == \"Infinity is not allowed in JSON\" "), used: 59 }); - String::append(__local_5, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_5, String { repr: array.new_data("e.message: "), used: 11 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1104,24 +1104,24 @@ fn __test_16_f64_negative_infinity_serialize_error() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(160), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_16_f64_negative_infinity_serialize_error"), used: 47 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_16_f64_negative_infinity_serialize_error"), used: 47 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(163, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: e.message == \"Infinity is not allowed in JSON\" "), used: 59 }); - String::append(__local_5, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_5, String { repr: array.new_data("e.message: "), used: 11 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1157,24 +1157,24 @@ fn __test_17_f32_nan_serialize_error() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(155), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_17_f32_nan_serialize_error"), used: 33 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_17_f32_nan_serialize_error"), used: 33 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(173, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: e.message == \"NaN is not allowed in JSON\" "), used: 54 }); - String::append(__local_5, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_5, String { repr: array.new_data("e.message: "), used: 11 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1210,24 +1210,24 @@ fn __test_18_f32_infinity_serialize_error() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(160), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_18_f32_infinity_serialize_error"), used: 38 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_18_f32_infinity_serialize_error"), used: 38 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(183, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: e.message == \"Infinity is not allowed in JSON\" "), used: 59 }); - String::append(__local_5, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_5, String { repr: array.new_data("e.message: "), used: 11 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1301,24 +1301,24 @@ fn __test_21_struct_missing_required_field() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(151), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_21_struct_missing_required_field"), used: 39 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_21_struct_missing_required_field"), used: 39 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(220, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: e.message == \"required field missing\" "), used: 50 }); - String::append(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1439,27 +1439,27 @@ fn __test_26_option_some_deserialize() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_26_option_some_deserialize"), used: 33 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_26_option_some_deserialize"), used: 33 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(274, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: n == 42 "), used: 20 }); - String::append_char(__local_5, 110); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 110); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_17 = __local_6; i32::fmt_decimal(n, __local_17); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1499,24 +1499,24 @@ fn __test_27_enum_unknown_variant() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_27_enum_unknown_variant"), used: 30 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_27_enum_unknown_variant"), used: 30 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado"), used: 61 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(297, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: e.message == \"unknown variant\" "), used: 43 }); - String::append(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("e.message: "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -2929,8 +2929,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2985,8 +2985,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -3018,7 +3018,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -3197,22 +3197,22 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } @@ -3230,7 +3230,7 @@ fn "core:json/utf8_sequence_length"(leading_byte) { // from core:json return 4; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3365,9 +3365,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -3421,13 +3421,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -3462,9 +3462,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -3475,10 +3475,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -3534,7 +3534,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -3622,7 +3622,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -3798,7 +3798,7 @@ fn Array^Deserialize::deserialize(d) { if ref.test Option::Some(first_opt) { first_elem = ref.cast Option::Some(first_opt).payload_0; items = Array { repr: builtin::array_new(2), used: 0 }; - Array::append(items, first_elem); + Array::push(items, first_elem); block { l323: loop { let __sroa_next_discriminant: i32; @@ -3809,7 +3809,7 @@ fn Array^Deserialize::deserialize(d) { next_opt = __sroa_next_case0_payload_0; if ref.test Option::Some(next_opt) { item = ref.cast Option::Some(next_opt).payload_0; - Array::append(items, item); + Array::push(items, item); } else { end_result_12 = "core:json/JsonDeserializer::expect_char"(seq.de, 93); if ref.is_null(end_result_12) == 0 { @@ -3853,7 +3853,7 @@ fn Array^Deserialize::deserialize(d) { unreachable; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -4050,7 +4050,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f32"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(builtin::f64_promote_f32(v), __local_3); @@ -4076,7 +4076,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(v, __local_3); @@ -4160,13 +4160,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -4232,9 +4232,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -4494,21 +4494,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -4518,7 +4518,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -4530,10 +4530,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -4558,7 +4558,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -4573,7 +4573,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -4595,7 +4595,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -4623,7 +4623,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -5733,10 +5733,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -6130,7 +6130,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l596; }; @@ -6150,7 +6150,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -6158,17 +6158,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -6322,20 +6322,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -6345,10 +6345,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -6358,10 +6358,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -6369,10 +6369,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -6384,7 +6384,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -6401,22 +6401,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b635; @@ -6424,7 +6424,7 @@ fn String^Inspect::inspect(self, f) { continue l636; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/serde_json_deser_error_edge.wado/__closure_wrapper_0"(__env, __p0, __p1, __p2) { diff --git a/wado-compiler/tests/fixtures.golden/serde_json_duplicate_fields.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_duplicate_fields.wir.wado index 115f0486c..86cc15f58 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_duplicate_fields.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_duplicate_fields.wir.wado @@ -168,7 +168,7 @@ type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, re type "functype/core:json/utf8_sequence_length" = fn(i32) -> i32; -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -180,9 +180,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/__Closure_0::__call" = fn(ref __Closure_0, ref String, i32, i32) -> ref Option; @@ -298,29 +298,29 @@ fn __test_0_duplicate_field_last_value_wins() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_0_duplicate_field_last_value_wins"), used: 40 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_duplicate_fields.wado"), used: 61 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_0_duplicate_field_last_value_wins"), used: 40 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_duplicate_fields.wado"), used: 61 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_14 = __local_7; i32::fmt_decimal(18, __local_14); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: p.x == 99.0 "), used: 24 }); - String::append_char(__local_6, 112); - String::append_char(__local_6, 46); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 112); + String::push(__local_6, 46); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_19 = __local_7; f64::inspect_into(__v0_2, __local_19); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -330,29 +330,29 @@ condition: p.x == 99.0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_0_duplicate_field_last_value_wins"), used: 40 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_duplicate_fields.wado"), used: 61 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_0_duplicate_field_last_value_wins"), used: 40 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_duplicate_fields.wado"), used: 61 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_23 = __local_9; i32::fmt_decimal(19, __local_23); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p.y == 2.0 "), used: 23 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 46); - String::append_char(__local_8, 121); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 46); + String::push(__local_8, 121); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_28 = __local_9; f64::inspect_into(__v0_4, __local_28); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1141,8 +1141,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1197,13 +1197,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1211,25 +1211,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1237,7 +1237,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1279,8 +1279,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1312,7 +1312,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1491,22 +1491,22 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } @@ -1524,7 +1524,7 @@ fn "core:json/utf8_sequence_length"(leading_byte) { // from core:json return 4; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1661,9 +1661,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1673,8 +1673,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1729,13 +1729,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1770,9 +1770,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1783,10 +1783,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1842,7 +1842,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1857,7 +1857,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2045,13 +2045,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -2117,9 +2117,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -2379,21 +2379,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -2403,7 +2403,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -2415,10 +2415,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -2443,7 +2443,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2458,7 +2458,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2480,7 +2480,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2508,7 +2508,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -3398,10 +3398,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -3581,7 +3581,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l372; }; @@ -3601,7 +3601,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3609,17 +3609,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3773,20 +3773,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3796,10 +3796,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3809,10 +3809,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3820,10 +3820,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_json_error_kind.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_error_kind.wir.wado index 8d88ee7f6..2805e49df 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_error_kind.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_error_kind.wir.wado @@ -108,9 +108,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/core:serde/DeserializeErrorKind^Inspect::inspect" = fn("core:serde/enum:DeserializeErrorKind", ref Formatter); @@ -167,17 +167,17 @@ fn __test_0_enum_field_access_on_cross_module_struct() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_0_enum_field_access_on_cross_module_struct"), used: 49 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_error_kind.wado"), used: 55 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_0_enum_field_access_on_cross_module_struct"), used: 49 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_error_kind.wado"), used: 55 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(11, __local_4); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: r matches { Err(e) && e.kind == DeserializeErrorKind::TrailingData } "), used: 81 }); break __tmpl: __local_3; @@ -204,35 +204,35 @@ fn __test_1_enum_field_compared_directly() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(212), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_1_enum_field_compared_directly"), used: 37 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_error_kind.wado"), used: 55 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_1_enum_field_compared_directly"), used: 37 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_error_kind.wado"), used: 55 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(17, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: e.kind == DeserializeErrorKind::UnexpectedType "), used: 59 }); - String::append_char(__local_5, 101); - String::append_char(__local_5, 46); - String::append_char(__local_5, 107); - String::append_char(__local_5, 105); - String::append_char(__local_5, 110); - String::append_char(__local_5, 100); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 101); + String::push(__local_5, 46); + String::push(__local_5, 107); + String::push(__local_5, 105); + String::push(__local_5, 110); + String::push(__local_5, 100); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; "core:serde/DeserializeErrorKind^Inspect::inspect"(__v0, __local_6); - String::append_char(__local_5, 10); - String::append(__local_5, String { repr: array.new_data("DeserializeErrorKind::UnexpectedType: "), used: 38 }); + String::push(__local_5, 10); + String::push_str(__local_5, String { repr: array.new_data("DeserializeErrorKind::UnexpectedType: "), used: 38 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; "core:serde/DeserializeErrorKind^Inspect::inspect"(__v1, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -818,7 +818,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -833,7 +833,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -873,34 +873,34 @@ fn "core:serde/DeserializeErrorKind^Inspect::inspect"(self, f) { // from core:s let __local_21: ref String; if self == 0 { __local_3 = String { repr: array.new_data("DeserializeErrorKind::UnexpectedType"), used: 36 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); } else if self == 1 { __local_5 = String { repr: array.new_data("DeserializeErrorKind::MissingField"), used: 34 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if self == 2 { __local_7 = String { repr: array.new_data("DeserializeErrorKind::UnknownVariant"), used: 36 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); } else if self == 3 { __local_9 = String { repr: array.new_data("DeserializeErrorKind::DuplicateField"), used: 36 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); } else if self == 4 { __local_11 = String { repr: array.new_data("DeserializeErrorKind::InvalidValue"), used: 34 }; - String::append(f.buf, __local_11); + String::push_str(f.buf, __local_11); } else if self == 5 { __local_13 = String { repr: array.new_data("DeserializeErrorKind::Overflow"), used: 30 }; - String::append(f.buf, __local_13); + String::push_str(f.buf, __local_13); } else if self == 6 { __local_15 = String { repr: array.new_data("DeserializeErrorKind::MalformedInput"), used: 36 }; - String::append(f.buf, __local_15); + String::push_str(f.buf, __local_15); } else if self == 7 { __local_17 = String { repr: array.new_data("DeserializeErrorKind::TrailingData"), used: 34 }; - String::append(f.buf, __local_17); + String::push_str(f.buf, __local_17); } else if self == 8 { __local_19 = String { repr: array.new_data("DeserializeErrorKind::Eof"), used: 25 }; - String::append(f.buf, __local_19); + String::push_str(f.buf, __local_19); } else if self == 9 { __local_21 = String { repr: array.new_data("DeserializeErrorKind::Custom"), used: 28 }; - String::append(f.buf, __local_21); + String::push_str(f.buf, __local_21); }; } @@ -1214,7 +1214,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l147; }; @@ -1248,20 +1248,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1271,10 +1271,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1284,10 +1284,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1295,10 +1295,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_json_int_types.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_int_types.wir.wado index 9fef657ba..e6cf0cbe5 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_int_types.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_int_types.wir.wado @@ -164,13 +164,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/core:json/JsonDeserializer::skip_whitespace" = fn(ref "core:json/JsonDeserializer"); @@ -287,26 +287,26 @@ fn __test_0_i8_max_and_min() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_0_i8_max_and_min"), used: 23 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_0_i8_max_and_min"), used: 23 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_20 = __local_11; i32::fmt_decimal(11, __local_20); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: s == \"127\" "), used: 23 }); - String::append_char(__local_10, 115); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 115); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_3, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -326,27 +326,27 @@ condition: s == \"127\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_0_i8_max_and_min"), used: 23 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_0_i8_max_and_min"), used: 23 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_27 = __local_13; i32::fmt_decimal(18, __local_27); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: s2 == \"-128\" "), used: 25 }); - String::append_char(__local_12, 115); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 115); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_8, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -375,26 +375,26 @@ fn __test_1_i16_max() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_1_i16_max"), used: 16 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_1_i16_max"), used: 16 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(30, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"32767\" "), used: 25 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -423,26 +423,26 @@ fn __test_2_u8_max() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_2_u8_max"), used: 15 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_2_u8_max"), used: 15 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(42, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"255\" "), used: 23 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -471,26 +471,26 @@ fn __test_3_u16_max() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_3_u16_max"), used: 16 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_3_u16_max"), used: 16 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(54, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"65535\" "), used: 25 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -519,26 +519,26 @@ fn __test_4_i64_at_safe_limit_as_number() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_4_i64_at_safe_limit_as_number"), used: 36 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_4_i64_at_safe_limit_as_number"), used: 36 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(66, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"9007199254740991\" "), used: 36 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -567,26 +567,26 @@ fn __test_5_i64_above_safe_limit_as_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_5_i64_above_safe_limit_as_string"), used: 39 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_5_i64_above_safe_limit_as_string"), used: 39 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(76, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\"9007199254740992\"` "), used: 38 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -614,27 +614,27 @@ fn __test_6_i64_deserialize_from_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_6_i64_deserialize_from_string"), used: 36 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_6_i64_deserialize_from_string"), used: 36 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_11 = __local_5; i32::fmt_decimal(85, __local_11); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 9007199254740992 as i64 "), used: 41 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_16 = __local_5; i64::fmt_decimal(v, __local_16); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -663,26 +663,26 @@ fn __test_7_u64_at_safe_limit_as_number() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_7_u64_at_safe_limit_as_number"), used: 36 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_7_u64_at_safe_limit_as_number"), used: 36 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(97, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"9007199254740991\" "), used: 36 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -717,26 +717,26 @@ fn __test_8_u64_max_as_string() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_8_u64_max_as_string"), used: 26 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_8_u64_max_as_string"), used: 26 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_19 = __local_10; i32::fmt_decimal(107, __local_19); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: s == `\"18446744073709551615\"` "), used: 42 }); - String::append_char(__local_9, 115); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 115); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -755,28 +755,28 @@ condition: s == `\"18446744073709551615\"` if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_8_u64_max_as_string"), used: 26 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_8_u64_max_as_string"), used: 26 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_int_types.wado"), used: 54 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_26 = __local_12; i32::fmt_decimal(113, __local_26); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: v2 == 18446744073709551615 as u64 "), used: 46 }); - String::append_char(__local_11, 118); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 118); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_31 = __local_12; u64::fmt_decimal(v2, __local_31); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -2041,10 +2041,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -2083,7 +2083,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2171,7 +2171,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2201,7 +2201,7 @@ fn String::append_char(self, c) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -2220,16 +2220,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_i64"(self, v) { // from core } else { v < -9007199254740991_i64; } { - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); + String::push(__local_2, 34); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i64::fmt_decimal(v, __local_3); - String::append_char(__local_2, 34); + String::push(__local_2, 34); break __tmpl: __local_2; }); } else { - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(16), used: 0 }; __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i64::fmt_decimal(v, __local_5); @@ -2242,7 +2242,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_i64"(self, v) { // from core fn "core:json/JsonSerializer^Serializer::serialize_u32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; u32::fmt_decimal(v, __local_3); @@ -2257,16 +2257,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_u64"(self, v) { // from core let __local_4: ref String; let __local_5: ref Formatter; if v >u 9007199254740991_i64 { - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); + String::push(__local_2, 34); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; u64::fmt_decimal(v, __local_3); - String::append_char(__local_2, 34); + String::push(__local_2, 34); break __tmpl: __local_2; }); } else { - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(16), used: 0 }; __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; u64::fmt_decimal(v, __local_5); @@ -2562,21 +2562,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -2586,7 +2586,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -2598,10 +2598,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -2626,7 +2626,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2641,7 +2641,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2663,7 +2663,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2691,7 +2691,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -3556,7 +3556,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l378; }; @@ -3576,7 +3576,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3584,17 +3584,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3624,20 +3624,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3647,10 +3647,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3660,10 +3660,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3671,10 +3671,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3686,7 +3686,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3703,22 +3703,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b401; @@ -3726,7 +3726,7 @@ fn String^Inspect::inspect(self, f) { continue l402; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_i8_max_and_min as "__test_0_i8_max_and_min" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_large_int.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_large_int.wir.wado index 71c051d2c..991a1174c 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_large_int.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_large_int.wir.wado @@ -199,13 +199,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/core:json/JsonDeserializer::skip_whitespace" = fn(ref "core:json/JsonDeserializer"); @@ -312,26 +312,26 @@ fn __test_0_i64_small_value_as_number() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_i64_small_value_as_number"), used: 34 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_i64_small_value_as_number"), used: 34 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(12, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"42\" "), used: 22 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -360,26 +360,26 @@ fn __test_1_i64_at_max_safe_integer_as_number() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_1_i64_at_max_safe_integer_as_number"), used: 42 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_1_i64_at_max_safe_integer_as_number"), used: 42 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(23, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"9007199254740991\" "), used: 36 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -408,26 +408,26 @@ fn __test_2_i64_above_max_safe_integer_as_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_2_i64_above_max_safe_integer_as_string"), used: 45 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_2_i64_above_max_safe_integer_as_string"), used: 45 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(34, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\"9007199254740992\"` "), used: 38 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -456,26 +456,26 @@ fn __test_3_u64_large_value_as_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_3_u64_large_value_as_string"), used: 34 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_3_u64_large_value_as_string"), used: 34 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(44, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\"18446744073709551615\"` "), used: 42 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -504,26 +504,26 @@ fn __test_4_i64_negative_large_value_as_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_4_i64_negative_large_value_as_string"), used: 43 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_4_i64_negative_large_value_as_string"), used: 43 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(54, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\"-9007199254740992\"` "), used: 39 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -551,27 +551,27 @@ fn __test_5_deserialize_i64_from_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_5_deserialize_i64_from_string"), used: 36 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_5_deserialize_i64_from_string"), used: 36 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_11 = __local_5; i32::fmt_decimal(63, __local_11); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 9007199254740992 as i64 "), used: 41 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_16 = __local_5; i64::fmt_decimal(v, __local_16); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -599,27 +599,27 @@ fn __test_6_deserialize_u64_from_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_6_deserialize_u64_from_string"), used: 36 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_6_deserialize_u64_from_string"), used: 36 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_11 = __local_5; i32::fmt_decimal(72, __local_11); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 18446744073709551615 as u64 "), used: 45 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_16 = __local_5; u64::fmt_decimal(v, __local_16); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -650,26 +650,26 @@ fn __test_7_i128_large_value_as_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_7_i128_large_value_as_string"), used: 35 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_7_i128_large_value_as_string"), used: 35 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_14 = __local_6; i32::fmt_decimal(82, __local_14); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\"170141183460469231731687303715884105727\"` "), used: 61 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -700,26 +700,26 @@ fn __test_8_u128_large_value_as_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_8_u128_large_value_as_string"), used: 35 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_8_u128_large_value_as_string"), used: 35 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_large_int.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_14 = __local_6; i32::fmt_decimal(92, __local_14); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\"340282366920938463463374607431768211455\"` "), used: 61 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -2260,10 +2260,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -2302,7 +2302,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2390,7 +2390,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2427,16 +2427,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_i64"(self, v) { // from core } else { v < -9007199254740991_i64; } { - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); + String::push(__local_2, 34); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i64::fmt_decimal(v, __local_3); - String::append_char(__local_2, 34); + String::push(__local_2, 34); break __tmpl: __local_2; }); } else { - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(16), used: 0 }; __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i64::fmt_decimal(v, __local_5); @@ -2452,16 +2452,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_u64"(self, v) { // from core let __local_4: ref String; let __local_5: ref Formatter; if v >u 9007199254740991_i64 { - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); + String::push(__local_2, 34); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; u64::fmt_decimal(v, __local_3); - String::append_char(__local_2, 34); + String::push(__local_2, 34); break __tmpl: __local_2; }); } else { - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(16), used: 0 }; __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; u64::fmt_decimal(v, __local_5); @@ -2474,12 +2474,12 @@ fn "core:json/JsonSerializer^Serializer::serialize_u64"(self, v) { // from core fn "core:json/JsonSerializer^Serializer::serialize_i128"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); + String::push(__local_2, 34); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i128::fmt_decimal(v, __local_3); - String::append_char(__local_2, 34); + String::push(__local_2, 34); break __tmpl: __local_2; }); return ref.null none; @@ -2488,12 +2488,12 @@ fn "core:json/JsonSerializer^Serializer::serialize_i128"(self, v) { // from cor fn "core:json/JsonSerializer^Serializer::serialize_u128"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); + String::push(__local_2, 34); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; u128::fmt_decimal(v, __local_3); - String::append_char(__local_2, 34); + String::push(__local_2, 34); break __tmpl: __local_2; }); return ref.null none; @@ -2785,21 +2785,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -2809,7 +2809,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -2821,10 +2821,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -2849,7 +2849,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2864,7 +2864,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2886,7 +2886,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2914,7 +2914,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -3779,7 +3779,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l407; }; @@ -3799,7 +3799,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3807,17 +3807,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3847,20 +3847,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3870,10 +3870,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3883,10 +3883,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3894,10 +3894,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3909,7 +3909,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3926,22 +3926,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b430; @@ -3949,7 +3949,7 @@ fn String^Inspect::inspect(self, f) { continue l431; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_i64_small_value_as_number as "__test_0_i64_small_value_as_number" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_multi_type_deser.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_multi_type_deser.wir.wado index ab04704ef..8fc13119c 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_multi_type_deser.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_multi_type_deser.wir.wado @@ -95,9 +95,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/core:json/JsonDeserializer::skip_whitespace" = fn(ref "core:json/JsonDeserializer"); @@ -161,11 +161,11 @@ fn run() with Stdout { v = __sroa_r_case0_payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_4, 105); - String::append_char(__local_4, 51); - String::append_char(__local_4, 50); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 105); + String::push(__local_4, 51); + String::push(__local_4, 50); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(v, __local_5); break __tmpl: __local_4; @@ -182,15 +182,15 @@ fn run() with Stdout { v2 = __sroa_r2_case0_payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_6, 115); - String::append_char(__local_6, 116); - String::append_char(__local_6, 114); - String::append_char(__local_6, 105); - String::append_char(__local_6, 110); - String::append_char(__local_6, 103); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); - String::append(__local_6, v2); + String::push(__local_6, 115); + String::push(__local_6, 116); + String::push(__local_6, 114); + String::push(__local_6, 105); + String::push(__local_6, 110); + String::push(__local_6, 103); + String::push(__local_6, 58); + String::push(__local_6, 32); + String::push_str(__local_6, v2); break __tmpl: __local_6; }); } else { @@ -839,10 +839,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -881,7 +881,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -896,7 +896,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1209,21 +1209,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -1233,7 +1233,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -1245,10 +1245,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -1273,7 +1273,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -1288,7 +1288,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -1310,7 +1310,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -1338,7 +1338,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -1705,7 +1705,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l196; }; @@ -1725,7 +1725,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1733,17 +1733,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1773,20 +1773,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1796,10 +1796,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1809,10 +1809,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1820,10 +1820,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_json_nested_struct.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_nested_struct.wir.wado index 3576249b1..d6fa7b4ed 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_nested_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_nested_struct.wir.wado @@ -224,7 +224,7 @@ type "functype/core:json/utf8_sequence_length" = fn(i32) -> i32; type "functype/core:json/write_escaped_string" = fn(ref String, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -236,13 +236,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Point^Deserialize::deserialize" = fn(ref "core:json/JsonDeserializer") -> ref Result; @@ -375,26 +375,26 @@ fn __test_0_nested_struct_serialize() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(172), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_nested_struct_serialize"), used: 32 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_nested_struct.wado"), used: 58 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_nested_struct_serialize"), used: 32 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_nested_struct.wado"), used: 58 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(29, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"startPoint\":\\{\"x\":1,\"y\":2\\},\"endPoint\":\\{\"x\":3,\"y\":4\\}\\}` "), used: 79 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -458,25 +458,25 @@ fn __test_1_nested_struct_roundtrip() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(153), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_1_nested_struct_roundtrip"), used: 32 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_nested_struct.wado"), used: 58 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_1_nested_struct_roundtrip"), used: 32 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_nested_struct.wado"), used: 58 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_26 = __local_14; i32::fmt_decimal(44, __local_26); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: parsed.start_point.x == 10.5 "), used: 41 }); - String::append(__local_13, String { repr: array.new_data("parsed.start_point.x: "), used: 22 }); + String::push_str(__local_13, String { repr: array.new_data("parsed.start_point.x: "), used: 22 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_31 = __local_14; f64::inspect_into(__v0_5, __local_31); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -486,25 +486,25 @@ condition: parsed.start_point.x == 10.5 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(153), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_1_nested_struct_roundtrip"), used: 32 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_nested_struct.wado"), used: 58 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_1_nested_struct_roundtrip"), used: 32 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_nested_struct.wado"), used: 58 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_35 = __local_16; i32::fmt_decimal(45, __local_35); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: parsed.start_point.y == 20.5 "), used: 41 }); - String::append(__local_15, String { repr: array.new_data("parsed.start_point.y: "), used: 22 }); + String::push_str(__local_15, String { repr: array.new_data("parsed.start_point.y: "), used: 22 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_40 = __local_16; f64::inspect_into(__v0_7, __local_40); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -514,25 +514,25 @@ condition: parsed.start_point.y == 20.5 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_1_nested_struct_roundtrip"), used: 32 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_nested_struct.wado"), used: 58 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_1_nested_struct_roundtrip"), used: 32 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_nested_struct.wado"), used: 58 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_44 = __local_18; i32::fmt_decimal(46, __local_44); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: parsed.end_point.x == 30.5 "), used: 39 }); - String::append(__local_17, String { repr: array.new_data("parsed.end_point.x: "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("parsed.end_point.x: "), used: 20 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_49 = __local_18; f64::inspect_into(__v0_9, __local_49); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -542,25 +542,25 @@ condition: parsed.end_point.x == 30.5 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_1_nested_struct_roundtrip"), used: 32 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_nested_struct.wado"), used: 58 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_1_nested_struct_roundtrip"), used: 32 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_nested_struct.wado"), used: 58 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_53 = __local_20; i32::fmt_decimal(47, __local_53); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: parsed.end_point.y == 40.5 "), used: 39 }); - String::append(__local_19, String { repr: array.new_data("parsed.end_point.y: "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("parsed.end_point.y: "), used: 20 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_58 = __local_20; f64::inspect_into(__v0_11, __local_58); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -1455,8 +1455,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1511,13 +1511,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1525,25 +1525,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1551,7 +1551,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1593,8 +1593,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1626,7 +1626,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1805,22 +1805,22 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } @@ -1851,7 +1851,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b166: block { l167: loop { @@ -1861,32 +1861,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b166; @@ -1894,10 +1894,10 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l167; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2032,9 +2032,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -2101,9 +2101,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2113,8 +2113,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2169,13 +2169,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2210,9 +2210,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2223,10 +2223,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -2282,7 +2282,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2370,7 +2370,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2556,12 +2556,12 @@ fn Point^Deserialize::deserialize(d) { fn Line^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("startPoint"), used: 10 }, self.start_point)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("endPoint"), used: 8 }, self.end_point)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -2572,10 +2572,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = Point^Serialize::serialize(value, ser.buf); self.buf = ser.buf; @@ -2586,12 +2586,12 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { fn Point^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("x"), used: 1 }, self.x)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("y"), used: 1 }, self.y)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -2602,10 +2602,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_f64"(ser.buf, value); self.buf = ser.buf; @@ -2638,7 +2638,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(v, __local_3); @@ -2722,13 +2722,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -2794,9 +2794,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -3056,21 +3056,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -3080,7 +3080,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -3092,10 +3092,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -3120,7 +3120,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -3135,7 +3135,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -3157,7 +3157,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -3185,7 +3185,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -4075,10 +4075,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -4258,7 +4258,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l438; }; @@ -4278,7 +4278,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -4286,17 +4286,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -4450,20 +4450,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -4473,10 +4473,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -4486,10 +4486,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -4497,10 +4497,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -4512,7 +4512,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -4529,22 +4529,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b477; @@ -4552,7 +4552,7 @@ fn String^Inspect::inspect(self, f) { continue l478; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/serde_json_nested_struct.wado/__closure_wrapper_0"(__env, __p0, __p1, __p2) { diff --git a/wado-compiler/tests/fixtures.golden/serde_json_option_array_fields.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_option_array_fields.wir.wado index 73d6d7745..37275ec25 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_option_array_fields.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_option_array_fields.wir.wado @@ -261,17 +261,17 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Array^Deserialize::deserialize" = fn(ref "core:json/JsonDeserializer") -> ref Result,DeserializeError>; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -392,26 +392,26 @@ fn __test_0_serialize_with_some_and_non_empty_array() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(179), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_0_serialize_with_some_and_non_empty_array"), used: 48 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_0_serialize_with_some_and_non_empty_array"), used: 48 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_22 = __local_7; i32::fmt_decimal(23, __local_22); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: s == `\\{\"name\":\"Alice\",\"email\":\"alice@example.com\",\"scores\":[95,87,92]\\}` "), used: 86 }); - String::append_char(__local_6, 115); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 115); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -446,26 +446,26 @@ fn __test_1_serialize_with_none_and_empty_array() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_1_serialize_with_none_and_empty_array"), used: 44 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_1_serialize_with_none_and_empty_array"), used: 44 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_16 = __local_7; i32::fmt_decimal(37, __local_16); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: s == `\\{\"name\":\"Bob\",\"email\":null,\"scores\":[]\\}` "), used: 61 }); - String::append_char(__local_6, 115); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 115); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -528,24 +528,24 @@ fn __test_2_roundtrip_with_some() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_2_roundtrip_with_some"), used: 28 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_2_roundtrip_with_some"), used: 28 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_35 = __local_16; i32::fmt_decimal(53, __local_35); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: parsed.name == \"Charlie\" "), used: 37 }); - String::append(__local_15, String { repr: array.new_data("parsed.name: "), used: 13 }); + String::push_str(__local_15, String { repr: array.new_data("parsed.name: "), used: 13 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; String^Inspect::inspect(__v0_6, __local_16); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -558,26 +558,26 @@ condition: parsed.name == \"Charlie\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_2_roundtrip_with_some"), used: 28 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_2_roundtrip_with_some"), used: 28 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_42 = __local_18; i32::fmt_decimal(55, __local_42); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: e == \"charlie@test.com\" "), used: 36 }); - String::append_char(__local_17, 101); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 101); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; String^Inspect::inspect(__v0_9, __local_18); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -594,25 +594,25 @@ condition: e == \"charlie@test.com\" if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_2_roundtrip_with_some"), used: 28 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_2_roundtrip_with_some"), used: 28 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_50 = __local_20; i32::fmt_decimal(59, __local_50); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: parsed.scores.len() == 1 "), used: 37 }); - String::append(__local_19, String { repr: array.new_data("parsed.scores.len(): "), used: 21 }); + String::push_str(__local_19, String { repr: array.new_data("parsed.scores.len(): "), used: 21 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_55 = __local_20; i32::fmt_decimal(__v0_11, __local_55); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -629,25 +629,25 @@ condition: parsed.scores.len() == 1 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_2_roundtrip_with_some"), used: 28 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_2_roundtrip_with_some"), used: 28 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_63 = __local_22; i32::fmt_decimal(60, __local_63); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: parsed.scores[0] == 100 "), used: 36 }); - String::append(__local_21, String { repr: array.new_data("parsed.scores[0]: "), used: 18 }); + String::push_str(__local_21, String { repr: array.new_data("parsed.scores[0]: "), used: 18 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_68 = __local_22; i32::fmt_decimal(__v0_13, __local_68); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -701,24 +701,24 @@ fn __test_3_roundtrip_with_none() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_3_roundtrip_with_none"), used: 28 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_3_roundtrip_with_none"), used: 28 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_24 = __local_11; i32::fmt_decimal(79, __local_24); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: parsed.name == \"Dave\" "), used: 34 }); - String::append(__local_10, String { repr: array.new_data("parsed.name: "), used: 13 }); + String::push_str(__local_10, String { repr: array.new_data("parsed.name: "), used: 13 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_6, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -737,25 +737,25 @@ condition: parsed.name == \"Dave\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_3_roundtrip_with_none"), used: 28 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_3_roundtrip_with_none"), used: 28 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_option_array_fields.wado"), used: 64 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_32 = __local_13; i32::fmt_decimal(85, __local_32); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: parsed.scores.len() == 0 "), used: 37 }); - String::append(__local_12, String { repr: array.new_data("parsed.scores.len(): "), used: 21 }); + String::push_str(__local_12, String { repr: array.new_data("parsed.scores.len(): "), used: 21 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_37 = __local_13; i32::fmt_decimal(__v0_8, __local_37); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -1418,7 +1418,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b120: block { l121: loop { @@ -1428,32 +1428,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b120; @@ -1461,7 +1461,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l121; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } fn char::from_u32(value) { @@ -1503,10 +1503,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1549,7 +1549,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1637,7 +1637,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1791,7 +1791,7 @@ fn Array^Deserialize::deserialize(d) { if ref.test Option::Some(first_opt) { first_elem = ref.cast Option::Some(first_opt).payload_0; items = Array { repr: builtin::array_new(2), used: 0 }; - Array::append(items, first_elem); + Array::push(items, first_elem); block { l167: loop { let __sroa_next_discriminant: i32; @@ -1802,7 +1802,7 @@ fn Array^Deserialize::deserialize(d) { next_opt = __sroa_next_case0_payload_0; if ref.test Option::Some(next_opt) { item = ref.cast Option::Some(next_opt).payload_0; - Array::append(items, item); + Array::push(items, item); } else { end_result_12 = "core:json/JsonDeserializer::expect_char"(seq.de, 93); if ref.is_null(end_result_12) == 0 { @@ -1846,7 +1846,7 @@ fn Array^Deserialize::deserialize(d) { unreachable; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1976,13 +1976,13 @@ fn Option^Deserialize::deserialize(d) { fn User^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("name"), used: 4 }, self.name)); drop(JsonStructSerializer^SerializeStruct::field>(__fused_payload_9, String { repr: array.new_data("email"), used: 5 }, self.email)); drop(JsonStructSerializer^SerializeStruct::field>(__fused_payload_9, String { repr: array.new_data("scores"), used: 6 }, self.scores)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -1993,10 +1993,10 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = Array^Serialize::serialize(value, ser.buf); self.buf = ser.buf; @@ -2015,7 +2015,7 @@ fn Array^Serialize::serialize(self, s) { let __local_16: ref Array; seq_2 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { __local_14 = self.used; - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(seq_2) { @@ -2042,7 +2042,7 @@ fn Array^Serialize::serialize(self, s) { }; }; return __inline_JsonSeqSerializer_SerializeSeq__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(seq_3.buf, 93); + String::push(seq_3.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_3: ref.null none; }; }; @@ -2057,7 +2057,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i32"(ser.buf, value); @@ -2082,10 +2082,10 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value let __local_8: ref null String; let __sroa_ser_buf: ref String; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); __sroa_ser_buf = self.buf; r = __inline_Option_String__Serialize__serialize_JsonSerializer__0: block -> ref null "core:serde/SerializeError" { __local_8 = value_copy Option(value); @@ -2098,10 +2098,10 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value break __inline_Option_String__Serialize__serialize_JsonSerializer__0; }; __inline_JsonSerializer_Serializer__serialize_null_2: block -> ref null "core:serde/SerializeError" { - String::append_char(__sroa_ser_buf, 110); - String::append_char(__sroa_ser_buf, 117); - String::append_char(__sroa_ser_buf, 108); - String::append_char(__sroa_ser_buf, 108); + String::push(__sroa_ser_buf, 110); + String::push(__sroa_ser_buf, 117); + String::push(__sroa_ser_buf, 108); + String::push(__sroa_ser_buf, 108); break __inline_JsonSerializer_Serializer__serialize_null_2: ref.null none; }; break __inline_Option_String__Serialize__serialize_JsonSerializer__0; @@ -2115,10 +2115,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_JsonSerializer_Serializer__serialize_string_1: block -> ref null "core:serde/SerializeError" { "core:json/write_escaped_string"(ser.buf, value); @@ -2136,7 +2136,7 @@ fn __Closure_0::__call(self, __input, __start, __end) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -2220,13 +2220,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -2292,9 +2292,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -2554,21 +2554,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -2578,7 +2578,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -2590,10 +2590,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return Result::Err { discriminant: 1, payload_0: ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -2618,7 +2618,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }) }; }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2633,7 +2633,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2655,7 +2655,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2683,7 +2683,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -3553,10 +3553,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -3796,7 +3796,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l392; }; @@ -3816,7 +3816,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3824,17 +3824,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3864,20 +3864,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3887,10 +3887,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3900,10 +3900,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3911,10 +3911,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3926,7 +3926,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3943,22 +3943,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b415; @@ -3966,7 +3966,7 @@ fn String^Inspect::inspect(self, f) { continue l416; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/serde_json_option_array_fields.wado/__closure_wrapper_0"(__env, __p0, __p1, __p2) { diff --git a/wado-compiler/tests/fixtures.golden/serde_json_primitives.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_primitives.wir.wado index 741cef826..01c30cd55 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_primitives.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_primitives.wir.wado @@ -204,7 +204,7 @@ type "functype/core:json/utf8_sequence_length" = fn(i32) -> i32; type "functype/core:json/write_escaped_string" = fn(ref String, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -214,13 +214,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/core:json/JsonDeserializer::skip_whitespace" = fn(ref "core:json/JsonDeserializer"); @@ -377,26 +377,26 @@ fn __test_0_i32_zero_roundtrip() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_0_i32_zero_roundtrip"), used: 27 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_0_i32_zero_roundtrip"), used: 27 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_18 = __local_10; i32::fmt_decimal(12, __local_18); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: s == \"0\" "), used: 21 }); - String::append_char(__local_9, 115); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 115); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -415,28 +415,28 @@ condition: s == \"0\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_0_i32_zero_roundtrip"), used: 27 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_0_i32_zero_roundtrip"), used: 27 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_25 = __local_12; i32::fmt_decimal(18, __local_25); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: v2 == 0 "), used: 20 }); - String::append_char(__local_11, 118); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 118); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_30 = __local_12; i32::fmt_decimal(v2, __local_30); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -478,26 +478,26 @@ fn __test_1_i32_max() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_1_i32_max"), used: 16 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_1_i32_max"), used: 16 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_18 = __local_10; i32::fmt_decimal(28, __local_18); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: s == \"2147483647\" "), used: 30 }); - String::append_char(__local_9, 115); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 115); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -516,28 +516,28 @@ condition: s == \"2147483647\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_1_i32_max"), used: 16 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_1_i32_max"), used: 16 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_25 = __local_12; i32::fmt_decimal(34, __local_25); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: v2 == 2147483647 "), used: 29 }); - String::append_char(__local_11, 118); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 118); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_30 = __local_12; i32::fmt_decimal(v2, __local_30); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -579,26 +579,26 @@ fn __test_2_i32_min() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_2_i32_min"), used: 16 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_2_i32_min"), used: 16 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_18 = __local_10; i32::fmt_decimal(44, __local_18); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: s == \"-2147483648\" "), used: 31 }); - String::append_char(__local_9, 115); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 115); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -617,28 +617,28 @@ condition: s == \"-2147483648\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_2_i32_min"), used: 16 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_2_i32_min"), used: 16 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_25 = __local_12; i32::fmt_decimal(50, __local_25); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: v2 == -2147483648 "), used: 30 }); - String::append_char(__local_11, 118); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 118); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_30 = __local_12; i32::fmt_decimal(v2, __local_30); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -680,26 +680,26 @@ fn __test_3_u32_zero_and_max() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_3_u32_zero_and_max"), used: 25 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_3_u32_zero_and_max"), used: 25 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_19 = __local_11; i32::fmt_decimal(62, __local_19); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: s == \"0\" "), used: 21 }); - String::append_char(__local_10, 115); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 115); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_3, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -719,27 +719,27 @@ condition: s == \"0\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_3_u32_zero_and_max"), used: 25 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_3_u32_zero_and_max"), used: 25 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_26 = __local_13; i32::fmt_decimal(69, __local_26); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: s2 == \"4294967295\" "), used: 31 }); - String::append_char(__local_12, 115); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 115); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_8, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -781,26 +781,26 @@ fn __test_4_f64_positive_and_negative() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_4_f64_positive_and_negative"), used: 34 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_4_f64_positive_and_negative"), used: 34 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_19 = __local_11; i32::fmt_decimal(81, __local_19); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: s == \"3.14159\" "), used: 27 }); - String::append_char(__local_10, 115); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 115); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_3, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -820,27 +820,27 @@ condition: s == \"3.14159\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_4_f64_positive_and_negative"), used: 34 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_4_f64_positive_and_negative"), used: 34 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_26 = __local_13; i32::fmt_decimal(88, __local_26); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: s2 == \"-0.001\" "), used: 27 }); - String::append_char(__local_12, 115); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 115); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_8, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -876,26 +876,26 @@ fn __test_5_f64_integer_value() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_5_f64_integer_value"), used: 26 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_5_f64_integer_value"), used: 26 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(98, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"42\" "), used: 22 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -936,27 +936,27 @@ fn __test_6_f64_deserialize_with_exponent() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_6_f64_deserialize_with_exponent"), used: 38 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_6_f64_deserialize_with_exponent"), used: 38 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_17 = __local_9; i32::fmt_decimal(107, __local_17); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: v == 150.0 "), used: 23 }); - String::append_char(__local_8, 118); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 118); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_22 = __local_9; f64::inspect_into(v, __local_22); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -975,28 +975,28 @@ condition: v == 150.0 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_6_f64_deserialize_with_exponent"), used: 38 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_6_f64_deserialize_with_exponent"), used: 38 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_26 = __local_11; i32::fmt_decimal(113, __local_26); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: v2 == 0.15 "), used: 23 }); - String::append_char(__local_10, 118); - String::append_char(__local_10, 50); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 118); + String::push(__local_10, 50); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_31 = __local_11; f64::inspect_into(v2, __local_31); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -1038,26 +1038,26 @@ fn __test_7_f32_roundtrip() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_7_f32_roundtrip"), used: 22 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_7_f32_roundtrip"), used: 22 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_18 = __local_10; i32::fmt_decimal(125, __local_18); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: s == \"1.5\" "), used: 23 }); - String::append_char(__local_9, 115); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 115); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1076,28 +1076,28 @@ condition: s == \"1.5\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_7_f32_roundtrip"), used: 22 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_7_f32_roundtrip"), used: 22 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_25 = __local_12; i32::fmt_decimal(131, __local_25); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: v2 == 1.5 as f32 "), used: 29 }); - String::append_char(__local_11, 118); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 118); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_30 = __local_12; f32::inspect_into(v2, __local_30); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1139,26 +1139,26 @@ fn __test_8_f32_zero_and_negative() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_8_f32_zero_and_negative"), used: 30 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_8_f32_zero_and_negative"), used: 30 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_19 = __local_11; i32::fmt_decimal(141, __local_19); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: s == \"0\" "), used: 21 }); - String::append_char(__local_10, 115); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 115); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_3, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -1178,27 +1178,27 @@ condition: s == \"0\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_8_f32_zero_and_negative"), used: 30 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_8_f32_zero_and_negative"), used: 30 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_26 = __local_13; i32::fmt_decimal(148, __local_26); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: s2 == \"-2.5\" "), used: 25 }); - String::append_char(__local_12, 115); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 115); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_8, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -1240,26 +1240,26 @@ fn __test_9_bool_true_roundtrip() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_9_bool_true_roundtrip"), used: 28 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_9_bool_true_roundtrip"), used: 28 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_18 = __local_10; i32::fmt_decimal(160, __local_18); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: s == \"true\" "), used: 24 }); - String::append_char(__local_9, 115); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 115); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1278,24 +1278,24 @@ condition: s == \"true\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_9_bool_true_roundtrip"), used: 28 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_9_bool_true_roundtrip"), used: 28 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_25 = __local_12; i32::fmt_decimal(166, __local_25); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: v2 == true "), used: 23 }); - String::append_char(__local_11, 118); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 118); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_30 = __local_12; Formatter::pad(__local_30, if v2 -> ref String { @@ -1303,7 +1303,7 @@ condition: v2 == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1345,26 +1345,26 @@ fn __test_10_bool_false_roundtrip() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_10_bool_false_roundtrip"), used: 30 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_10_bool_false_roundtrip"), used: 30 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_18 = __local_10; i32::fmt_decimal(176, __local_18); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: s == \"false\" "), used: 25 }); - String::append_char(__local_9, 115); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 115); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1383,24 +1383,24 @@ condition: s == \"false\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_10_bool_false_roundtrip"), used: 30 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_10_bool_false_roundtrip"), used: 30 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_25 = __local_12; i32::fmt_decimal(182, __local_25); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: v2 == false "), used: 24 }); - String::append_char(__local_11, 118); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 118); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_30 = __local_12; Formatter::pad(__local_30, if v2 -> ref String { @@ -1408,7 +1408,7 @@ condition: v2 == false } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1456,26 +1456,26 @@ fn __test_11_char_ascii_and_special() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_11_char_ascii_and_special"), used: 32 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_11_char_ascii_and_special"), used: 32 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_27 = __local_16; i32::fmt_decimal(194, __local_27); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: s == `\"A\"` "), used: 23 }); - String::append_char(__local_15, 115); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 115); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; String^Inspect::inspect(__v0_3, __local_16); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -1495,27 +1495,27 @@ condition: s == `\"A\"` if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_11_char_ascii_and_special"), used: 32 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_11_char_ascii_and_special"), used: 32 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_34 = __local_18; i32::fmt_decimal(201, __local_34); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: s2 == `\"\\\\n\"` "), used: 26 }); - String::append_char(__local_17, 115); - String::append_char(__local_17, 50); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 115); + String::push(__local_17, 50); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; String^Inspect::inspect(__v0_8, __local_18); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -1535,27 +1535,27 @@ condition: s2 == `\"\\\\n\"` if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_11_char_ascii_and_special"), used: 32 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_11_char_ascii_and_special"), used: 32 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_41 = __local_20; i32::fmt_decimal(208, __local_41); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: s3 == `\"\\\\\"\"` "), used: 26 }); - String::append_char(__local_19, 115); - String::append_char(__local_19, 51); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 115); + String::push(__local_19, 51); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; String^Inspect::inspect(__v0_13, __local_20); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -1599,26 +1599,26 @@ fn __test_12_string_empty_roundtrip() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_12_string_empty_roundtrip"), used: 32 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_12_string_empty_roundtrip"), used: 32 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_18 = __local_10; i32::fmt_decimal(220, __local_18); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: s == `\"\"` "), used: 22 }); - String::append_char(__local_9, 115); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 115); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0_3, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1638,27 +1638,27 @@ condition: s == `\"\"` if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_12_string_empty_roundtrip"), used: 32 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_12_string_empty_roundtrip"), used: 32 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_25 = __local_12; i32::fmt_decimal(226, __local_25); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: v2 == \"\" "), used: 21 }); - String::append_char(__local_11, 118); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 118); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; String^Inspect::inspect(__v0_7, __local_12); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1706,33 +1706,33 @@ new return"), used: 19 }; if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_13_string_with_escapes_roundtrip"), used: 39 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_13_string_with_escapes_roundtrip"), used: 39 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_15 = __local_9; i32::fmt_decimal(238, __local_15); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: v2 == v "), used: 20 }); - String::append_char(__local_8, 118); - String::append_char(__local_8, 50); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 118); + String::push(__local_8, 50); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0, __local_9); - String::append_char(__local_8, 10); - String::append_char(__local_8, 118); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 10); + String::push(__local_8, 118); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v1, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1778,26 +1778,26 @@ fn __test_14_option_some_and_none() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_14_option_some_and_none"), used: 30 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_14_option_some_and_none"), used: 30 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_19 = __local_11; i32::fmt_decimal(253, __local_19); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: s == \"99\" "), used: 22 }); - String::append_char(__local_10, 115); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 115); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_3, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -1817,27 +1817,27 @@ condition: s == \"99\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_14_option_some_and_none"), used: 30 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_14_option_some_and_none"), used: 30 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_primitives.wado"), used: 55 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_26 = __local_13; i32::fmt_decimal(260, __local_26); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: s2 == \"null\" "), used: 25 }); - String::append_char(__local_12, 115); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 115); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_8, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -1941,10 +1941,10 @@ fn "core/json/to_string>"(value) { break __inline_Option_String__Serialize__serialize_JsonSerializer__0; }; __inline_JsonSerializer_Serializer__serialize_null_2: block -> ref null "core:serde/SerializeError" { - String::append_char(__sroa_ser_buf, 110); - String::append_char(__sroa_ser_buf, 117); - String::append_char(__sroa_ser_buf, 108); - String::append_char(__sroa_ser_buf, 108); + String::push(__sroa_ser_buf, 110); + String::push(__sroa_ser_buf, 117); + String::push(__sroa_ser_buf, 108); + String::push(__sroa_ser_buf, 108); break __inline_JsonSerializer_Serializer__serialize_null_2: ref.null none; }; break __inline_Option_String__Serialize__serialize_JsonSerializer__0; @@ -1972,10 +1972,10 @@ fn "core/json/to_string>"(value) { break __inline_Option_i32__Serialize__serialize_JsonSerializer__0: "core:json/JsonSerializer^Serializer::serialize_i32"(__local_6.buf, __local_12); }; __inline_JsonSerializer_Serializer__serialize_null_2: block -> ref null "core:serde/SerializeError" { - String::append_char(__local_6.buf, 110); - String::append_char(__local_6.buf, 117); - String::append_char(__local_6.buf, 108); - String::append_char(__local_6.buf, 108); + String::push(__local_6.buf, 110); + String::push(__local_6.buf, 117); + String::push(__local_6.buf, 108); + String::push(__local_6.buf, 108); break __inline_JsonSerializer_Serializer__serialize_null_2: ref.null none; }; break __inline_Option_i32__Serialize__serialize_JsonSerializer__0; @@ -3095,8 +3095,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -3151,13 +3151,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -3165,25 +3165,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -3191,7 +3191,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -3233,8 +3233,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -3266,7 +3266,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -3445,22 +3445,22 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } @@ -3491,7 +3491,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b237: block { l238: loop { @@ -3501,32 +3501,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b237; @@ -3534,10 +3534,10 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l238; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3696,9 +3696,9 @@ fn f32::inspect_into(self, f) { break __inline_String__len_6: __local_23.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -3708,8 +3708,8 @@ fn f32::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -3775,9 +3775,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -3844,9 +3844,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -3856,8 +3856,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -3912,13 +3912,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -3953,9 +3953,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -3966,10 +3966,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -4021,7 +4021,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -4109,7 +4109,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -4139,7 +4139,7 @@ fn String::append_char(self, c) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -4151,7 +4151,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core fn "core:json/JsonSerializer^Serializer::serialize_u32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; u32::fmt_decimal(v, __local_3); @@ -4177,7 +4177,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f32"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(builtin::f64_promote_f32(v), __local_3); @@ -4203,7 +4203,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(v, __local_3); @@ -4214,16 +4214,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core fn "core:json/JsonSerializer^Serializer::serialize_bool"(self, v) { // from core:json if v { - String::append_char(self, 116); - String::append_char(self, 114); - String::append_char(self, 117); - String::append_char(self, 101); + String::push(self, 116); + String::push(self, 114); + String::push(self, 117); + String::push(self, 101); } else { - String::append_char(self, 102); - String::append_char(self, 97); - String::append_char(self, 108); - String::append_char(self, 115); - String::append_char(self, 101); + String::push(self, 102); + String::push(self, 97); + String::push(self, 108); + String::push(self, 115); + String::push(self, 101); }; return ref.null none; } @@ -4343,9 +4343,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -4605,21 +4605,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -4629,7 +4629,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -4641,10 +4641,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -4669,7 +4669,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -4684,7 +4684,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -4706,7 +4706,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -4734,7 +4734,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -5443,7 +5443,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l458; }; @@ -5463,7 +5463,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -5471,17 +5471,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -5635,20 +5635,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -5658,10 +5658,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -5671,10 +5671,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -5682,10 +5682,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -5697,7 +5697,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -5714,22 +5714,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b497; @@ -5737,7 +5737,7 @@ fn String^Inspect::inspect(self, f) { continue l498; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_i32_zero_roundtrip as "__test_0_i32_zero_roundtrip" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_rename.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_rename.wir.wado index a3749c3ae..0c7d93cab 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_rename.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_rename.wir.wado @@ -198,13 +198,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/JsonStructSerializer^SerializeStruct::field" = fn(ref "core:json/JsonStructSerializer", ref String, ref String) -> ref null "core:serde/SerializeError"; @@ -303,26 +303,26 @@ fn __test_0_serialize_with_rename() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(146), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_serialize_with_rename"), used: 30 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename.wado"), used: 51 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_serialize_with_rename"), used: 30 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename.wado"), used: 51 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(23, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"status_code\":200,\"data\":\"ok\"\\}` "), used: 53 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -357,25 +357,25 @@ fn __test_1_deserialize_with_rename() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_1_deserialize_with_rename"), used: 32 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename.wado"), used: 51 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_1_deserialize_with_rename"), used: 32 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename.wado"), used: 51 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_15 = __local_7; i32::fmt_decimal(32, __local_15); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: resp.status_code == 200 "), used: 36 }); - String::append(__local_6, String { repr: array.new_data("resp.status_code: "), used: 18 }); + String::push_str(__local_6, String { repr: array.new_data("resp.status_code: "), used: 18 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_20 = __local_7; i32::fmt_decimal(__v0_2, __local_20); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -385,24 +385,24 @@ condition: resp.status_code == 200 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_1_deserialize_with_rename"), used: 32 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename.wado"), used: 51 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_1_deserialize_with_rename"), used: 32 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename.wado"), used: 51 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_26 = __local_9; i32::fmt_decimal(33, __local_26); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: resp.response_data == \"ok\" "), used: 39 }); - String::append(__local_8, String { repr: array.new_data("resp.response_data: "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("resp.response_data: "), used: 20 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0_4, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -446,25 +446,25 @@ fn __test_2_roundtrip_with_rename() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_2_roundtrip_with_rename"), used: 30 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename.wado"), used: 51 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_2_roundtrip_with_rename"), used: 30 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename.wado"), used: 51 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_19 = __local_10; i32::fmt_decimal(45, __local_19); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: parsed.status_code == 404 "), used: 38 }); - String::append(__local_9, String { repr: array.new_data("parsed.status_code: "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("parsed.status_code: "), used: 20 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_24 = __local_10; i32::fmt_decimal(__v0_5, __local_24); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -474,24 +474,24 @@ condition: parsed.status_code == 404 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(160), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_2_roundtrip_with_rename"), used: 30 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename.wado"), used: 51 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_2_roundtrip_with_rename"), used: 30 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename.wado"), used: 51 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_30 = __local_12; i32::fmt_decimal(46, __local_30); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: parsed.response_data == \"not found\" "), used: 48 }); - String::append(__local_11, String { repr: array.new_data("parsed.response_data: "), used: 22 }); + String::push_str(__local_11, String { repr: array.new_data("parsed.response_data: "), used: 22 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; String^Inspect::inspect(__v0_7, __local_12); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1146,7 +1146,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b111: block { l112: loop { @@ -1156,32 +1156,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b111; @@ -1189,7 +1189,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l112; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } fn char::from_u32(value) { @@ -1231,10 +1231,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1277,7 +1277,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1365,7 +1365,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1477,12 +1477,12 @@ fn ApiResponse^Deserialize::deserialize(d) { fn ApiResponse^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("status_code"), used: 11 }, self.status_code)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("data"), used: 4 }, self.response_data)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -1493,10 +1493,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_JsonSerializer_Serializer__serialize_string_1: block -> ref null "core:serde/SerializeError" { "core:json/write_escaped_string"(ser.buf, value); @@ -1511,10 +1511,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i32"(ser.buf, value); self.buf = ser.buf; @@ -1529,7 +1529,7 @@ fn __Closure_0::__call(self, __input, __start, __end) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -1613,13 +1613,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -1685,9 +1685,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -1947,21 +1947,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -1971,7 +1971,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -1983,10 +1983,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return Result::Err { discriminant: 1, payload_0: ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -2011,7 +2011,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }) }; }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2026,7 +2026,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2048,7 +2048,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2076,7 +2076,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -2946,10 +2946,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -3127,7 +3127,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l338; }; @@ -3147,7 +3147,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3155,17 +3155,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3195,20 +3195,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3218,10 +3218,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3231,10 +3231,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3242,10 +3242,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3257,7 +3257,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3274,22 +3274,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b361; @@ -3297,7 +3297,7 @@ fn String^Inspect::inspect(self, f) { continue l362; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/serde_json_rename.wado/__closure_wrapper_0"(__env, __p0, __p1, __p2) { diff --git a/wado-compiler/tests/fixtures.golden/serde_json_rename_all.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_rename_all.wir.wado index 167734dfe..0798560cd 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_rename_all.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_rename_all.wir.wado @@ -210,13 +210,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/__Closure_0::__call" = fn(ref __Closure_0, ref String, i32, i32) -> ref Option; @@ -335,26 +335,26 @@ fn __test_0_serialize_with_rename_all_snake_case() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(168), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_serialize_with_rename_all_snake_case"), used: 45 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename_all.wado"), used: 55 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_serialize_with_rename_all_snake_case"), used: 45 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename_all.wado"), used: 55 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(21, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"max_retries\":3,\"timeout_ms\":5000,\"is_verbose\":true\\}` "), used: 75 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -396,25 +396,25 @@ fn __test_1_deserialize_with_rename_all_snake_case() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_1_deserialize_with_rename_all_snake_case"), used: 47 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename_all.wado"), used: 55 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_1_deserialize_with_rename_all_snake_case"), used: 47 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename_all.wado"), used: 55 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_19 = __local_9; i32::fmt_decimal(30, __local_19); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: c.max_retries == 3 "), used: 31 }); - String::append(__local_8, String { repr: array.new_data("c.max_retries: "), used: 15 }); + String::push_str(__local_8, String { repr: array.new_data("c.max_retries: "), used: 15 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_24 = __local_9; i32::fmt_decimal(__v0_2, __local_24); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -424,25 +424,25 @@ condition: c.max_retries == 3 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_1_deserialize_with_rename_all_snake_case"), used: 47 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename_all.wado"), used: 55 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_1_deserialize_with_rename_all_snake_case"), used: 47 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename_all.wado"), used: 55 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_30 = __local_11; i32::fmt_decimal(31, __local_30); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: c.timeout_ms == 5000 as i64 "), used: 40 }); - String::append(__local_10, String { repr: array.new_data("c.timeout_ms: "), used: 14 }); + String::push_str(__local_10, String { repr: array.new_data("c.timeout_ms: "), used: 14 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_35 = __local_11; i64::fmt_decimal(__v0_4, __local_35); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -452,21 +452,21 @@ condition: c.timeout_ms == 5000 as i64 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_1_deserialize_with_rename_all_snake_case"), used: 47 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename_all.wado"), used: 55 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_1_deserialize_with_rename_all_snake_case"), used: 47 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_rename_all.wado"), used: 55 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_41 = __local_13; i32::fmt_decimal(32, __local_41); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: c.is_verbose == true "), used: 33 }); - String::append(__local_12, String { repr: array.new_data("c.is_verbose: "), used: 14 }); + String::push_str(__local_12, String { repr: array.new_data("c.is_verbose: "), used: 14 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_46 = __local_13; Formatter::pad(__local_46, if __v0_6 -> ref String { @@ -474,7 +474,7 @@ condition: c.is_verbose == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -1575,7 +1575,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b190: block { l191: loop { @@ -1585,32 +1585,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b190; @@ -1618,7 +1618,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l191; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } fn char::from_u32(value) { @@ -1699,10 +1699,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1745,7 +1745,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1833,7 +1833,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1964,13 +1964,13 @@ fn Config^Deserialize::deserialize(d) { fn Config^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("max_retries"), used: 11 }, self.max_retries)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("timeout_ms"), used: 10 }, self.timeout_ms)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("is_verbose"), used: 10 }, self.is_verbose)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -1981,10 +1981,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_bool"(ser.buf, value); self.buf = ser.buf; @@ -1996,10 +1996,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i64"(ser.buf, value); self.buf = ser.buf; @@ -2011,10 +2011,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i32"(ser.buf, value); self.buf = ser.buf; @@ -2029,7 +2029,7 @@ fn __Closure_0::__call(self, __input, __start, __end) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -2048,16 +2048,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_i64"(self, v) { // from core } else { v < -9007199254740991_i64; } { - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); + String::push(__local_2, 34); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i64::fmt_decimal(v, __local_3); - String::append_char(__local_2, 34); + String::push(__local_2, 34); break __tmpl: __local_2; }); } else { - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(16), used: 0 }; __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i64::fmt_decimal(v, __local_5); @@ -2069,16 +2069,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_i64"(self, v) { // from core fn "core:json/JsonSerializer^Serializer::serialize_bool"(self, v) { // from core:json if v { - String::append_char(self, 116); - String::append_char(self, 114); - String::append_char(self, 117); - String::append_char(self, 101); + String::push(self, 116); + String::push(self, 114); + String::push(self, 117); + String::push(self, 101); } else { - String::append_char(self, 102); - String::append_char(self, 97); - String::append_char(self, 108); - String::append_char(self, 115); - String::append_char(self, 101); + String::push(self, 102); + String::push(self, 97); + String::push(self, 108); + String::push(self, 115); + String::push(self, 101); }; return ref.null none; } @@ -2158,13 +2158,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -2230,9 +2230,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -2492,21 +2492,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -2516,7 +2516,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -2528,10 +2528,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -2556,7 +2556,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2571,7 +2571,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2593,7 +2593,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2621,7 +2621,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -3849,10 +3849,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -4121,7 +4121,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l485; }; @@ -4141,7 +4141,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -4149,17 +4149,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -4189,20 +4189,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -4212,10 +4212,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -4225,10 +4225,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -4236,10 +4236,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -4251,7 +4251,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -4268,22 +4268,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b508; @@ -4291,7 +4291,7 @@ fn String^Inspect::inspect(self, f) { continue l509; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/serde_json_rename_all.wado/__closure_wrapper_0"(__env, __p0, __p1, __p2) { diff --git a/wado-compiler/tests/fixtures.golden/serde_json_result.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_result.wir.wado index 63f7e86f3..f5798baa7 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_result.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_result.wir.wado @@ -158,13 +158,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/JsonVariantSerializer^SerializeVariant::payload" = fn(ref "core:json/JsonVariantSerializer", ref String) -> ref null "core:serde/SerializeError"; @@ -251,26 +251,26 @@ fn __test_0_result_serialize_ok() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_result_serialize_ok"), used: 28 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_result.wado"), used: 51 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_result_serialize_ok"), used: 28 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_result.wado"), used: 51 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(10, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"Ok\":42\\}` "), used: 31 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -299,26 +299,26 @@ fn __test_1_result_serialize_err() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_1_result_serialize_err"), used: 29 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_result.wado"), used: 51 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_1_result_serialize_err"), used: 29 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_result.wado"), used: 51 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(20, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"Err\":\"not found\"\\}` "), used: 41 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -356,27 +356,27 @@ fn __test_2_result_roundtrip_ok() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_2_result_roundtrip_ok"), used: 28 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_result.wado"), used: 51 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_2_result_roundtrip_ok"), used: 28 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_result.wado"), used: 51 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_17 = __local_9; i32::fmt_decimal(33, __local_17); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: v == 100 "), used: 21 }); - String::append_char(__local_8, 118); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 118); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_22 = __local_9; i32::fmt_decimal(v, __local_22); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -423,26 +423,26 @@ fn __test_3_result_roundtrip_err() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_3_result_roundtrip_err"), used: 29 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_result.wado"), used: 51 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_3_result_roundtrip_err"), used: 29 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_result.wado"), used: 51 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_17 = __local_9; i32::fmt_decimal(52, __local_17); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: e == \"fail\" "), used: 24 }); - String::append_char(__local_8, 101); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 101); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1034,7 +1034,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b97: block { l98: loop { @@ -1044,32 +1044,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b97; @@ -1077,7 +1077,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l98; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } fn char::from_u32(value) { @@ -1119,10 +1119,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1161,7 +1161,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1249,7 +1249,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1354,8 +1354,8 @@ fn Result^Deserialize::deserialize(d) { }; return 1; ref.null none; "core:serde/DeserializeError" { kind: 2, message: ref.as_non_null(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(40), used: 0 }; - String::append(__local_17, String { repr: array.new_data("unknown Result variant: "), used: 24 }); - String::append(__local_17, name); + String::push_str(__local_17, String { repr: array.new_data("unknown Result variant: "), used: 24 }); + String::push_str(__local_17, name); break __tmpl: __local_17; }), offset: -1_i64 }; }; @@ -1398,7 +1398,7 @@ fn Result^Serialize::serialize(self, s) { return e_6; }; return __inline_JsonVariantSerializer_SerializeVariant__end_0: block -> ref null "core:serde/SerializeError" { - String::append_char(vs_4.buf, 125); + String::push(vs_4.buf, 125); break __inline_JsonVariantSerializer_SerializeVariant__end_0: ref.null none; }; }; @@ -1422,7 +1422,7 @@ fn Result^Serialize::serialize(self, s) { return e_12; }; return __inline_JsonVariantSerializer_SerializeVariant__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(vs_10.buf, 125); + String::push(vs_10.buf, 125); break __inline_JsonVariantSerializer_SerializeVariant__end_1: ref.null none; }; }; @@ -1459,7 +1459,7 @@ fn JsonVariantSerializer^SerializeVariant::payload(self, value) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -1469,9 +1469,9 @@ fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core } fn "core:json/JsonSerializer^Serializer::begin_variant"(self, type_name, variant_name, disc) { // from core:json - String::append_char(self, 123); + String::push(self, 123); "core:json/write_escaped_string"(self, variant_name); - String::append_char(self, 58); + String::push(self, 58); return 0; "core:json/JsonVariantSerializer" { buf: self }; ref.null none; } @@ -1550,13 +1550,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -1807,21 +1807,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -1831,7 +1831,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -1843,10 +1843,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -1871,7 +1871,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -1886,7 +1886,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -1908,7 +1908,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -1936,7 +1936,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -2373,7 +2373,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l254; }; @@ -2393,7 +2393,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2401,17 +2401,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2441,20 +2441,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2464,10 +2464,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2477,10 +2477,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2488,10 +2488,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -2503,7 +2503,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -2520,22 +2520,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b277; @@ -2543,7 +2543,7 @@ fn String^Inspect::inspect(self, f) { continue l278; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_result_serialize_ok as "__test_0_result_serialize_ok" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_roundtrip_complex.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_roundtrip_complex.wir.wado index 3798b657d..ad3a523a5 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_roundtrip_complex.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_roundtrip_complex.wir.wado @@ -152,10 +152,10 @@ struct FullStruct { array array (mut u64); -array array> (mut ref "core:allocator/TreeMapEntry"); - array array (mut ref String); +array array> (mut ref "core:allocator/TreeMapEntry"); + array array> (mut ref Option); array array (mut i32); @@ -697,7 +697,7 @@ type "functype/core:json/utf8_sequence_length" = fn(i32) -> i32; type "functype/core:json/write_escaped_string" = fn(ref String, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -709,7 +709,7 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -717,11 +717,11 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayIter>^Iterator::next" = fn(ref "core:serde/ArrayIter>") -> ref null "core:allocator/TreeMapEntry"; -type "functype/Array>::append" = fn(ref Array>, ref Option); +type "functype/Array>::push" = fn(ref Array>, ref Option); type "functype/Array>::grow" = fn(ref Array>); @@ -729,7 +729,7 @@ type "functype/Option^Deserialize::deserialize" = fn(ref type "functype/ArrayIter>^Iterator::next" = fn(ref "core:serde/ArrayIter>") -> ref null Option; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -743,7 +743,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -757,7 +757,7 @@ type "functype/ArrayIter>^Iterator::next" = fn(ref "core:serde type "functype/TreeMap::entries" = fn(ref "core:allocator/TreeMap") -> ref Array>; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, i32]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, i32]"); type "functype/Array>::grow" = fn(ref Array>); @@ -767,7 +767,7 @@ type "functype/JsonVariantSerializer^SerializeVariant::payload" = fn(ref type "functype/JsonStructSerializer^SerializeStruct::field" = fn(ref "core:json/JsonStructSerializer", ref String, ref String) -> ref null "core:serde/SerializeError"; -type "functype/Array::append" = fn(ref Array, enum:Direction); +type "functype/Array::push" = fn(ref Array, enum:Direction); type "functype/Array::grow" = fn(ref Array); @@ -785,7 +785,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -795,7 +795,7 @@ type "functype/ArrayIter>^Iterator::next" = fn(ref "core:se type "functype/TreeMap::entries" = fn(ref "core:allocator/TreeMap") -> ref Array>; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -803,7 +803,7 @@ type "functype/ArrayIter>^Iterator::next" = fn(ref " type "functype/JsonVariantSerializer^SerializeVariant::payload" = fn(ref "core:json/JsonVariantSerializer", ref String) -> ref null "core:serde/SerializeError"; -type "functype/Array::append" = fn(ref Array, ref Inner); +type "functype/Array::push" = fn(ref Array, ref Inner); type "functype/Array::grow" = fn(ref Array); @@ -817,7 +817,7 @@ type "functype/Option^Deserialize::deserialize" = fn(r type "functype/Array^Deserialize::deserialize" = fn(ref "core:json/JsonDeserializer") -> ref Result,DeserializeError>; -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -1154,31 +1154,31 @@ fn __test_0_full_struct_roundtrip_with_all_fields() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_26, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_26, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_58 = __local_27; i32::fmt_decimal(35, __local_58); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: p.name == \"Alice\" "), used: 30 }); - String::append_char(__local_26, 112); - String::append_char(__local_26, 46); - String::append_char(__local_26, 110); - String::append_char(__local_26, 97); - String::append_char(__local_26, 109); - String::append_char(__local_26, 101); - String::append_char(__local_26, 58); - String::append_char(__local_26, 32); + String::push(__local_26, 112); + String::push(__local_26, 46); + String::push(__local_26, 110); + String::push(__local_26, 97); + String::push(__local_26, 109); + String::push(__local_26, 101); + String::push(__local_26, 58); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; String^Inspect::inspect(__v0_6, __local_27); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -1188,31 +1188,31 @@ condition: p.name == \"Alice\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_65 = __local_29; i32::fmt_decimal(36, __local_65); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: p.age == 30 "), used: 24 }); - String::append_char(__local_28, 112); - String::append_char(__local_28, 46); - String::append_char(__local_28, 97); - String::append_char(__local_28, 103); - String::append_char(__local_28, 101); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 112); + String::push(__local_28, 46); + String::push(__local_28, 97); + String::push(__local_28, 103); + String::push(__local_28, 101); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_70 = __local_29; i32::fmt_decimal(__v0_8, __local_70); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -1222,25 +1222,25 @@ condition: p.age == 30 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_30, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_30, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_76 = __local_31; i32::fmt_decimal(37, __local_76); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: p.score == 95.5 "), used: 28 }); - String::append(__local_30, String { repr: array.new_data("p.score: "), used: 9 }); + String::push_str(__local_30, String { repr: array.new_data("p.score: "), used: 9 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_81 = __local_31; f64::inspect_into(__v0_10, __local_81); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -1250,21 +1250,21 @@ condition: p.score == 95.5 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_32, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_32, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_85 = __local_33; i32::fmt_decimal(38, __local_85); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: p.active == true "), used: 29 }); - String::append(__local_32, String { repr: array.new_data("p.active: "), used: 10 }); + String::push_str(__local_32, String { repr: array.new_data("p.active: "), used: 10 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_90 = __local_33; Formatter::pad(__local_90, if __v0_12 -> ref String { @@ -1272,7 +1272,7 @@ condition: p.active == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -1285,25 +1285,25 @@ condition: p.active == true if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_34, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_34, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_97 = __local_35; i32::fmt_decimal(39, __local_97); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: p.tags.len() == 2 "), used: 30 }); - String::append(__local_34, String { repr: array.new_data("p.tags.len(): "), used: 14 }); + String::push_str(__local_34, String { repr: array.new_data("p.tags.len(): "), used: 14 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_102 = __local_35; i32::fmt_decimal(__v0_14, __local_102); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -1320,24 +1320,24 @@ condition: p.tags.len() == 2 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_36, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_36, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_110 = __local_37; i32::fmt_decimal(40, __local_110); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: p.tags[0] == \"dev\" "), used: 31 }); - String::append(__local_36, String { repr: array.new_data("p.tags[0]: "), used: 11 }); + String::push_str(__local_36, String { repr: array.new_data("p.tags[0]: "), used: 11 }); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; String^Inspect::inspect(__v0_16, __local_37); - String::append_char(__local_36, 10); + String::push(__local_36, 10); break __tmpl: __local_36; }); unreachable; @@ -1354,24 +1354,24 @@ condition: p.tags[0] == \"dev\" if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_38, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_38, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_119 = __local_39; i32::fmt_decimal(41, __local_119); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: p.tags[1] == \"lead\" "), used: 32 }); - String::append(__local_38, String { repr: array.new_data("p.tags[1]: "), used: 11 }); + String::push_str(__local_38, String { repr: array.new_data("p.tags[1]: "), used: 11 }); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; String^Inspect::inspect(__v0_18, __local_39); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; @@ -1384,29 +1384,29 @@ condition: p.tags[1] == \"lead\" if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_40, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); - String::append_char(__local_40, 32); - String::append_char(__local_40, 97); - String::append_char(__local_40, 116); - String::append_char(__local_40, 32); - String::append(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_40, 58); + String::push_str(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_40, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); + String::push(__local_40, 32); + String::push(__local_40, 97); + String::push(__local_40, 116); + String::push(__local_40, 32); + String::push_str(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_40, 58); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_126 = __local_41; i32::fmt_decimal(43, __local_126); - String::append(__local_40, String { repr: array.new_data(" + String::push_str(__local_40, String { repr: array.new_data(" condition: addr == \"123 Main St\" "), used: 34 }); - String::append_char(__local_40, 97); - String::append_char(__local_40, 100); - String::append_char(__local_40, 100); - String::append_char(__local_40, 114); - String::append_char(__local_40, 58); - String::append_char(__local_40, 32); + String::push(__local_40, 97); + String::push(__local_40, 100); + String::push(__local_40, 100); + String::push(__local_40, 114); + String::push(__local_40, 58); + String::push(__local_40, 32); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; String^Inspect::inspect(__v0_21, __local_41); - String::append_char(__local_40, 10); + String::push(__local_40, 10); break __tmpl: __local_40; }); unreachable; @@ -1422,27 +1422,27 @@ condition: addr == \"123 Main St\" if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_42, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); - String::append_char(__local_42, 32); - String::append_char(__local_42, 97); - String::append_char(__local_42, 116); - String::append_char(__local_42, 32); - String::append(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_42, 58); + String::push_str(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_42, String { repr: array.new_data("__test_0_full_struct_roundtrip_with_all_fields"), used: 46 }); + String::push(__local_42, 32); + String::push(__local_42, 97); + String::push(__local_42, 116); + String::push(__local_42, 32); + String::push_str(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_42, 58); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_133 = __local_43; i32::fmt_decimal(48, __local_133); - String::append(__local_42, String { repr: array.new_data(" + String::push_str(__local_42, String { repr: array.new_data(" condition: r == 5 "), used: 19 }); - String::append_char(__local_42, 114); - String::append_char(__local_42, 58); - String::append_char(__local_42, 32); + String::push(__local_42, 114); + String::push(__local_42, 58); + String::push(__local_42, 32); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_138 = __local_43; i32::fmt_decimal(r, __local_138); - String::append_char(__local_42, 10); + String::push(__local_42, 10); break __tmpl: __local_42; }); unreachable; @@ -1526,31 +1526,31 @@ fn __test_1_full_struct_roundtrip_with_none_fields() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_1_full_struct_roundtrip_with_none_fields"), used: 47 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_1_full_struct_roundtrip_with_none_fields"), used: 47 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_36 = __local_17; i32::fmt_decimal(74, __local_36); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: p.name == \"Bob\" "), used: 28 }); - String::append_char(__local_16, 112); - String::append_char(__local_16, 46); - String::append_char(__local_16, 110); - String::append_char(__local_16, 97); - String::append_char(__local_16, 109); - String::append_char(__local_16, 101); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 112); + String::push(__local_16, 46); + String::push(__local_16, 110); + String::push(__local_16, 97); + String::push(__local_16, 109); + String::push(__local_16, 101); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_6, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -1560,31 +1560,31 @@ condition: p.name == \"Bob\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_1_full_struct_roundtrip_with_none_fields"), used: 47 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_1_full_struct_roundtrip_with_none_fields"), used: 47 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_43 = __local_19; i32::fmt_decimal(75, __local_43); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: p.age == 25 "), used: 24 }); - String::append_char(__local_18, 112); - String::append_char(__local_18, 46); - String::append_char(__local_18, 97); - String::append_char(__local_18, 103); - String::append_char(__local_18, 101); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 112); + String::push(__local_18, 46); + String::push(__local_18, 97); + String::push(__local_18, 103); + String::push(__local_18, 101); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_48 = __local_19; i32::fmt_decimal(__v0_8, __local_48); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -1594,25 +1594,25 @@ condition: p.age == 25 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_1_full_struct_roundtrip_with_none_fields"), used: 47 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_1_full_struct_roundtrip_with_none_fields"), used: 47 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_54 = __local_21; i32::fmt_decimal(76, __local_54); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: p.score == 0.0 "), used: 27 }); - String::append(__local_20, String { repr: array.new_data("p.score: "), used: 9 }); + String::push_str(__local_20, String { repr: array.new_data("p.score: "), used: 9 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_59 = __local_21; f64::inspect_into(__v0_10, __local_59); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -1622,21 +1622,21 @@ condition: p.score == 0.0 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_1_full_struct_roundtrip_with_none_fields"), used: 47 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_1_full_struct_roundtrip_with_none_fields"), used: 47 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_63 = __local_23; i32::fmt_decimal(77, __local_63); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: p.active == false "), used: 30 }); - String::append(__local_22, String { repr: array.new_data("p.active: "), used: 10 }); + String::push_str(__local_22, String { repr: array.new_data("p.active: "), used: 10 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_68 = __local_23; Formatter::pad(__local_68, if __v0_12 -> ref String { @@ -1644,7 +1644,7 @@ condition: p.active == false } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -1657,25 +1657,25 @@ condition: p.active == false if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("__test_1_full_struct_roundtrip_with_none_fields"), used: 47 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("__test_1_full_struct_roundtrip_with_none_fields"), used: 47 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_75 = __local_25; i32::fmt_decimal(78, __local_75); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: p.tags.len() == 0 "), used: 30 }); - String::append(__local_24, String { repr: array.new_data("p.tags.len(): "), used: 14 }); + String::push_str(__local_24, String { repr: array.new_data("p.tags.len(): "), used: 14 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_80 = __local_25; i32::fmt_decimal(__v0_14, __local_80); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -1748,25 +1748,25 @@ fn __test_2_nested_struct_roundtrip() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_2_nested_struct_roundtrip"), used: 32 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_2_nested_struct_roundtrip"), used: 32 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_22 = __local_12; i32::fmt_decimal(123, __local_22); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: p.inner.value == 42 "), used: 32 }); - String::append(__local_11, String { repr: array.new_data("p.inner.value: "), used: 15 }); + String::push_str(__local_11, String { repr: array.new_data("p.inner.value: "), used: 15 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_27 = __local_12; i32::fmt_decimal(__v0_5, __local_27); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1776,24 +1776,24 @@ condition: p.inner.value == 42 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_2_nested_struct_roundtrip"), used: 32 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_2_nested_struct_roundtrip"), used: 32 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_33 = __local_14; i32::fmt_decimal(124, __local_33); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: p.inner.label == \"test\" "), used: 36 }); - String::append(__local_13, String { repr: array.new_data("p.inner.label: "), used: 15 }); + String::push_str(__local_13, String { repr: array.new_data("p.inner.label: "), used: 15 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; String^Inspect::inspect(__v0_7, __local_14); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -1803,25 +1803,25 @@ condition: p.inner.label == \"test\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_2_nested_struct_roundtrip"), used: 32 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_2_nested_struct_roundtrip"), used: 32 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_40 = __local_16; i32::fmt_decimal(125, __local_40); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: p.count == 3 "), used: 25 }); - String::append(__local_15, String { repr: array.new_data("p.count: "), used: 9 }); + String::push_str(__local_15, String { repr: array.new_data("p.count: "), used: 9 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_45 = __local_16; i32::fmt_decimal(__v0_9, __local_45); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -1898,25 +1898,25 @@ fn __test_3_array_of_structs_roundtrip() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_3_array_of_structs_roundtrip"), used: 35 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_3_array_of_structs_roundtrip"), used: 35 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_41 = __local_17; i32::fmt_decimal(146, __local_41); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: arr.len() == 3 "), used: 27 }); - String::append(__local_16, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_16, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_46 = __local_17; i32::fmt_decimal(__v0_6, __local_46); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -1932,25 +1932,25 @@ condition: arr.len() == 3 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_3_array_of_structs_roundtrip"), used: 35 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_3_array_of_structs_roundtrip"), used: 35 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_54 = __local_19; i32::fmt_decimal(147, __local_54); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: arr[0].value == 1 "), used: 30 }); - String::append(__local_18, String { repr: array.new_data("arr[0].value: "), used: 14 }); + String::push_str(__local_18, String { repr: array.new_data("arr[0].value: "), used: 14 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_59 = __local_19; i32::fmt_decimal(__v0_8, __local_59); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -1966,24 +1966,24 @@ condition: arr[0].value == 1 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_3_array_of_structs_roundtrip"), used: 35 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_3_array_of_structs_roundtrip"), used: 35 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_67 = __local_21; i32::fmt_decimal(148, __local_67); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: arr[0].label == \"a\" "), used: 32 }); - String::append(__local_20, String { repr: array.new_data("arr[0].label: "), used: 14 }); + String::push_str(__local_20, String { repr: array.new_data("arr[0].label: "), used: 14 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; String^Inspect::inspect(__v0_10, __local_21); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -1999,25 +1999,25 @@ condition: arr[0].label == \"a\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_3_array_of_structs_roundtrip"), used: 35 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_3_array_of_structs_roundtrip"), used: 35 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_76 = __local_23; i32::fmt_decimal(149, __local_76); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: arr[1].value == 2 "), used: 30 }); - String::append(__local_22, String { repr: array.new_data("arr[1].value: "), used: 14 }); + String::push_str(__local_22, String { repr: array.new_data("arr[1].value: "), used: 14 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_81 = __local_23; i32::fmt_decimal(__v0_12, __local_81); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -2033,25 +2033,25 @@ condition: arr[1].value == 2 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("__test_3_array_of_structs_roundtrip"), used: 35 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("__test_3_array_of_structs_roundtrip"), used: 35 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_89 = __local_25; i32::fmt_decimal(150, __local_89); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: arr[2].value == 3 "), used: 30 }); - String::append(__local_24, String { repr: array.new_data("arr[2].value: "), used: 14 }); + String::push_str(__local_24, String { repr: array.new_data("arr[2].value: "), used: 14 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_94 = __local_25; i32::fmt_decimal(__v0_14, __local_94); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -2104,29 +2104,29 @@ fn __test_4_empty_array_roundtrip() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_4_empty_array_roundtrip"), used: 30 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_4_empty_array_roundtrip"), used: 30 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_22 = __local_11; i32::fmt_decimal(163, __local_22); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: json == \"[]\" "), used: 25 }); - String::append_char(__local_10, 106); - String::append_char(__local_10, 115); - String::append_char(__local_10, 111); - String::append_char(__local_10, 110); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 106); + String::push(__local_10, 115); + String::push(__local_10, 111); + String::push(__local_10, 110); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_4, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -2142,25 +2142,25 @@ condition: json == \"[]\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_4_empty_array_roundtrip"), used: 30 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_4_empty_array_roundtrip"), used: 30 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_30 = __local_13; i32::fmt_decimal(166, __local_30); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: arr.len() == 0 "), used: 27 }); - String::append(__local_12, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_12, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_35 = __local_13; i32::fmt_decimal(__v0_8, __local_35); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -2207,29 +2207,29 @@ fn __test_5_result_ok_roundtrip() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_5_result_ok_roundtrip"), used: 28 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_5_result_ok_roundtrip"), used: 28 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_20 = __local_11; i32::fmt_decimal(181, __local_20); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: json == `\\{\"Ok\":42\\}` "), used: 34 }); - String::append_char(__local_10, 106); - String::append_char(__local_10, 115); - String::append_char(__local_10, 111); - String::append_char(__local_10, 110); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 106); + String::push(__local_10, 115); + String::push(__local_10, 111); + String::push(__local_10, 110); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -2246,27 +2246,27 @@ condition: json == `\\{\"Ok\":42\\}` if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_5_result_ok_roundtrip"), used: 28 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_5_result_ok_roundtrip"), used: 28 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_27 = __local_13; i32::fmt_decimal(185, __local_27); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: n == 42 "), used: 20 }); - String::append_char(__local_12, 110); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 110); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_32 = __local_13; i32::fmt_decimal(n, __local_32); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -2317,29 +2317,29 @@ fn __test_6_result_err_roundtrip() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_6_result_err_roundtrip"), used: 29 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_6_result_err_roundtrip"), used: 29 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_20 = __local_11; i32::fmt_decimal(201, __local_20); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: json == `\\{\"Err\":\"not found\"\\}` "), used: 44 }); - String::append_char(__local_10, 106); - String::append_char(__local_10, 115); - String::append_char(__local_10, 111); - String::append_char(__local_10, 110); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 106); + String::push(__local_10, 115); + String::push(__local_10, 111); + String::push(__local_10, 110); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_3, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -2357,28 +2357,28 @@ condition: json == `\\{\"Err\":\"not found\"\\}` if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_6_result_err_roundtrip"), used: 29 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_6_result_err_roundtrip"), used: 29 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_27 = __local_13; i32::fmt_decimal(205, __local_27); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: msg == \"not found\" "), used: 31 }); - String::append_char(__local_12, 109); - String::append_char(__local_12, 115); - String::append_char(__local_12, 103); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 109); + String::push(__local_12, 115); + String::push(__local_12, 103); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_8, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -2450,24 +2450,24 @@ fn __test_7_treemap_string_values_roundtrip() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_7_treemap_string_values_roundtrip"), used: 40 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_7_treemap_string_values_roundtrip"), used: 40 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_28 = __local_10; i32::fmt_decimal(227, __local_28); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: m[\"name\"] == \"Alice\" "), used: 33 }); - String::append(__local_9, String { repr: array.new_data("m[\"name\"]: "), used: 11 }); + String::push_str(__local_9, String { repr: array.new_data("m[\"name\"]: "), used: 11 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0_5, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -2477,24 +2477,24 @@ condition: m[\"name\"] == \"Alice\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_7_treemap_string_values_roundtrip"), used: 40 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_7_treemap_string_values_roundtrip"), used: 40 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_35 = __local_12; i32::fmt_decimal(228, __local_35); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: m[\"city\"] == \"Tokyo\" "), used: 33 }); - String::append(__local_11, String { repr: array.new_data("m[\"city\"]: "), used: 11 }); + String::push_str(__local_11, String { repr: array.new_data("m[\"city\"]: "), used: 11 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; String^Inspect::inspect(__v0_7, __local_12); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -2560,32 +2560,32 @@ fn __test_8_treemap_i32_values_roundtrip() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_8_treemap_i32_values_roundtrip"), used: 37 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_8_treemap_i32_values_roundtrip"), used: 37 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_28 = __local_10; i32::fmt_decimal(245, __local_28); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: m[\"x\"] == 10 "), used: 25 }); - String::append_char(__local_9, 109); - String::append_char(__local_9, 91); - String::append_char(__local_9, 34); - String::append_char(__local_9, 120); - String::append_char(__local_9, 34); - String::append_char(__local_9, 93); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 109); + String::push(__local_9, 91); + String::push(__local_9, 34); + String::push(__local_9, 120); + String::push(__local_9, 34); + String::push(__local_9, 93); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_33 = __local_10; i32::fmt_decimal(__v0_5, __local_33); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -2595,32 +2595,32 @@ condition: m[\"x\"] == 10 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_8_treemap_i32_values_roundtrip"), used: 37 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_8_treemap_i32_values_roundtrip"), used: 37 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_39 = __local_12; i32::fmt_decimal(246, __local_39); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: m[\"y\"] == 20 "), used: 25 }); - String::append_char(__local_11, 109); - String::append_char(__local_11, 91); - String::append_char(__local_11, 34); - String::append_char(__local_11, 121); - String::append_char(__local_11, 34); - String::append_char(__local_11, 93); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 109); + String::push(__local_11, 91); + String::push(__local_11, 34); + String::push(__local_11, 121); + String::push(__local_11, 34); + String::push(__local_11, 93); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_44 = __local_12; i32::fmt_decimal(__v0_7, __local_44); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -2673,29 +2673,29 @@ fn __test_9_empty_treemap_roundtrip() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_9_empty_treemap_roundtrip"), used: 32 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_9_empty_treemap_roundtrip"), used: 32 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_22 = __local_10; i32::fmt_decimal(259, __local_22); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: json == \"{}\" "), used: 25 }); - String::append_char(__local_9, 106); - String::append_char(__local_9, 115); - String::append_char(__local_9, 111); - String::append_char(__local_9, 110); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 106); + String::push(__local_9, 115); + String::push(__local_9, 111); + String::push(__local_9, 110); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0_3, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -2711,25 +2711,25 @@ condition: json == \"{}\" if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_9_empty_treemap_roundtrip"), used: 32 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_9_empty_treemap_roundtrip"), used: 32 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_30 = __local_12; i32::fmt_decimal(262, __local_30); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: m.len() == 0 "), used: 25 }); - String::append(__local_11, String { repr: array.new_data("m.len(): "), used: 9 }); + String::push_str(__local_11, String { repr: array.new_data("m.len(): "), used: 9 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_35 = __local_12; i32::fmt_decimal(__v0_7, __local_35); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -2772,29 +2772,29 @@ fn __test_10_enum_roundtrip() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_10_enum_roundtrip"), used: 24 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_10_enum_roundtrip"), used: 24 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_15 = __local_8; i32::fmt_decimal(287, __local_15); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: json == `\"North\"` "), used: 30 }); - String::append_char(__local_7, 106); - String::append_char(__local_7, 115); - String::append_char(__local_7, 111); - String::append_char(__local_7, 110); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 106); + String::push(__local_7, 115); + String::push(__local_7, 111); + String::push(__local_7, 110); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -2881,8 +2881,8 @@ fn __test_11_all_enum_variants_roundtrip() { __v0 = json; __cond = String^Eq::eq(__v0, __tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_9, 34); - String::append(__local_9, __inline_Array_String__IndexValue__index_value_17: block -> ref String { + String::push(__local_9, 34); + String::push_str(__local_9, __inline_Array_String__IndexValue__index_value_17: block -> ref String { __local_39 = i; if __local_39 >= _licm_used_49 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -2890,35 +2890,35 @@ fn __test_11_all_enum_variants_roundtrip() { }; break __inline_Array_String__IndexValue__index_value_17: builtin::array_get(_licm_repr_50, __local_39); }); - String::append_char(__local_9, 34); + String::push(__local_9, 34); break __tmpl: __local_9; }); if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_11_all_enum_variants_roundtrip"), used: 37 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_11_all_enum_variants_roundtrip"), used: 37 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_43 = __local_11; i32::fmt_decimal(314, __local_43); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: json == `\"{names[i]}\"` "), used: 35 }); - String::append_char(__local_10, 106); - String::append_char(__local_10, 115); - String::append_char(__local_10, 111); - String::append_char(__local_10, 110); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 106); + String::push(__local_10, 115); + String::push(__local_10, 111); + String::push(__local_10, 110); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -2960,29 +2960,29 @@ fn __test_12_variant_unit_case_roundtrip() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_12_variant_unit_case_roundtrip"), used: 37 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_12_variant_unit_case_roundtrip"), used: 37 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_15 = __local_8; i32::fmt_decimal(336, __local_15); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: json == `\"Point\"` "), used: 30 }); - String::append_char(__local_7, 106); - String::append_char(__local_7, 115); - String::append_char(__local_7, 111); - String::append_char(__local_7, 110); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 106); + String::push(__local_7, 115); + String::push(__local_7, 111); + String::push(__local_7, 110); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -3040,29 +3040,29 @@ fn __test_13_variant_payload_f64_roundtrip() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_13_variant_payload_f64_roundtrip"), used: 39 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_13_variant_payload_f64_roundtrip"), used: 39 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_20 = __local_11; i32::fmt_decimal(356, __local_20); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: json == `\\{\"Circle\":2.5\\}` "), used: 39 }); - String::append_char(__local_10, 106); - String::append_char(__local_10, 115); - String::append_char(__local_10, 111); - String::append_char(__local_10, 110); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 106); + String::push(__local_10, 115); + String::push(__local_10, 111); + String::push(__local_10, 110); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -3079,27 +3079,27 @@ condition: json == `\\{\"Circle\":2.5\\}` if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_13_variant_payload_f64_roundtrip"), used: 39 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_13_variant_payload_f64_roundtrip"), used: 39 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_27 = __local_13; i32::fmt_decimal(360, __local_27); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: r == 2.5 "), used: 21 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 114); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_32 = __local_13; f64::inspect_into(r, __local_32); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -3159,25 +3159,25 @@ fn __test_14_variant_payload_struct_roundtrip() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_14_variant_payload_struct_roundtrip"), used: 42 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_14_variant_payload_struct_roundtrip"), used: 42 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_20 = __local_11; i32::fmt_decimal(379, __local_20); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: inner.value == 10 "), used: 30 }); - String::append(__local_10, String { repr: array.new_data("inner.value: "), used: 13 }); + String::push_str(__local_10, String { repr: array.new_data("inner.value: "), used: 13 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_25 = __local_11; i32::fmt_decimal(__v0_6, __local_25); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -3187,24 +3187,24 @@ condition: inner.value == 10 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_14_variant_payload_struct_roundtrip"), used: 42 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_14_variant_payload_struct_roundtrip"), used: 42 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_31 = __local_13; i32::fmt_decimal(380, __local_31); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: inner.label == \"rect\" "), used: 34 }); - String::append(__local_12, String { repr: array.new_data("inner.label: "), used: 13 }); + String::push_str(__local_12, String { repr: array.new_data("inner.label: "), used: 13 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_8, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -3274,25 +3274,25 @@ fn __test_15_struct_with_treemap_field_roundtrip() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_15_struct_with_treemap_field_roundtrip"), used: 45 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_15_struct_with_treemap_field_roundtrip"), used: 45 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_29 = __local_11; i32::fmt_decimal(410, __local_29); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: p.settings[\"port\"] == 8080 "), used: 39 }); - String::append(__local_10, String { repr: array.new_data("p.settings[\"port\"]: "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("p.settings[\"port\"]: "), used: 20 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_34 = __local_11; i32::fmt_decimal(__v0_6, __local_34); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -3302,25 +3302,25 @@ condition: p.settings[\"port\"] == 8080 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(153), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_15_struct_with_treemap_field_roundtrip"), used: 45 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_15_struct_with_treemap_field_roundtrip"), used: 45 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_40 = __local_13; i32::fmt_decimal(411, __local_40); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: p.settings[\"timeout\"] == 30 "), used: 40 }); - String::append(__local_12, String { repr: array.new_data("p.settings[\"timeout\"]: "), used: 23 }); + String::push_str(__local_12, String { repr: array.new_data("p.settings[\"timeout\"]: "), used: 23 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_45 = __local_13; i32::fmt_decimal(__v0_8, __local_45); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -3371,32 +3371,32 @@ fn __test_16_string_with_special_chars_roundtrip() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_16_string_with_special_chars_roundtrip"), used: 45 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_16_string_with_special_chars_roundtrip"), used: 45 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_15 = __local_9; i32::fmt_decimal(428, __local_15); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p == v "), used: 19 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0, __local_9); - String::append_char(__local_8, 10); - String::append_char(__local_8, 118); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 10); + String::push(__local_8, 118); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v1, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -3447,32 +3447,32 @@ fn __test_17_string_with_backslash_roundtrip() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_17_string_with_backslash_roundtrip"), used: 41 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_17_string_with_backslash_roundtrip"), used: 41 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_15 = __local_9; i32::fmt_decimal(443, __local_15); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p == v "), used: 19 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0, __local_9); - String::append_char(__local_8, 10); - String::append_char(__local_8, 118); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 10); + String::push(__local_8, 118); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v1, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -3524,32 +3524,32 @@ line2 line3 tab"), used: 21 }; if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_18_string_with_newlines_roundtrip"), used: 40 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_18_string_with_newlines_roundtrip"), used: 40 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_15 = __local_9; i32::fmt_decimal(458, __local_15); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p == v "), used: 19 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0, __local_9); - String::append_char(__local_8, 10); - String::append_char(__local_8, 118); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 10); + String::push(__local_8, 118); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v1, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -3607,29 +3607,29 @@ fn __test_19_option_some_array_roundtrip() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_19_option_some_array_roundtrip"), used: 37 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_19_option_some_array_roundtrip"), used: 37 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_34 = __local_14; i32::fmt_decimal(473, __local_34); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: json == \"[1,2,3]\" "), used: 30 }); - String::append_char(__local_13, 106); - String::append_char(__local_13, 115); - String::append_char(__local_13, 111); - String::append_char(__local_13, 110); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 106); + String::push(__local_13, 115); + String::push(__local_13, 111); + String::push(__local_13, 110); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; String^Inspect::inspect(__v0_4, __local_14); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -3647,25 +3647,25 @@ condition: json == \"[1,2,3]\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_19_option_some_array_roundtrip"), used: 37 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_19_option_some_array_roundtrip"), used: 37 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_42 = __local_16; i32::fmt_decimal(477, __local_42); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: arr.len() == 3 "), used: 27 }); - String::append(__local_15, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_15, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_47 = __local_16; i32::fmt_decimal(__v0_9, __local_47); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -3681,32 +3681,32 @@ condition: arr.len() == 3 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_19_option_some_array_roundtrip"), used: 37 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_19_option_some_array_roundtrip"), used: 37 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_55 = __local_18; i32::fmt_decimal(478, __local_55); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: arr[0] == 1 "), used: 24 }); - String::append_char(__local_17, 97); - String::append_char(__local_17, 114); - String::append_char(__local_17, 114); - String::append_char(__local_17, 91); - String::append_char(__local_17, 48); - String::append_char(__local_17, 93); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 114); + String::push(__local_17, 114); + String::push(__local_17, 91); + String::push(__local_17, 48); + String::push(__local_17, 93); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_60 = __local_18; i32::fmt_decimal(__v0_11, __local_60); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -3751,29 +3751,29 @@ fn __test_20_option_none_array_roundtrip() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_20_option_none_array_roundtrip"), used: 37 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_20_option_none_array_roundtrip"), used: 37 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_15 = __local_8; i32::fmt_decimal(494, __local_15); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: json == \"null\" "), used: 27 }); - String::append_char(__local_7, 106); - String::append_char(__local_7, 115); - String::append_char(__local_7, 111); - String::append_char(__local_7, 110); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 106); + String::push(__local_7, 115); + String::push(__local_7, 111); + String::push(__local_7, 110); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -3852,29 +3852,29 @@ fn __test_21_array_of_options_roundtrip() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_21_array_of_options_roundtrip"), used: 36 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_21_array_of_options_roundtrip"), used: 36 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_41 = __local_17; i32::fmt_decimal(520, __local_41); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: json == \"[1,null,3]\" "), used: 33 }); - String::append_char(__local_16, 106); - String::append_char(__local_16, 115); - String::append_char(__local_16, 111); - String::append_char(__local_16, 110); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 106); + String::push(__local_16, 115); + String::push(__local_16, 111); + String::push(__local_16, 110); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_4, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -3890,25 +3890,25 @@ condition: json == \"[1,null,3]\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_21_array_of_options_roundtrip"), used: 36 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_21_array_of_options_roundtrip"), used: 36 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_49 = __local_19; i32::fmt_decimal(523, __local_49); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: arr.len() == 3 "), used: 27 }); - String::append(__local_18, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_18, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_54 = __local_19; i32::fmt_decimal(__v0_8, __local_54); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -3926,27 +3926,27 @@ condition: arr.len() == 3 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_21_array_of_options_roundtrip"), used: 36 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_21_array_of_options_roundtrip"), used: 36 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_62 = __local_21; i32::fmt_decimal(525, __local_62); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: n == 1 "), used: 19 }); - String::append_char(__local_20, 110); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 110); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_67 = __local_21; i32::fmt_decimal(n_10, __local_67); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -3980,27 +3980,27 @@ condition: n == 1 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("__test_21_array_of_options_roundtrip"), used: 36 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("__test_21_array_of_options_roundtrip"), used: 36 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado"), used: 62 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_77 = __local_23; i32::fmt_decimal(535, __local_77); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: n == 3 "), used: 19 }); - String::append_char(__local_22, 110); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); + String::push(__local_22, 110); + String::push(__local_22, 58); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; __local_82 = __local_23; i32::fmt_decimal(n_13, __local_82); - String::append_char(__local_22, 10); + String::push(__local_22, 10); break __tmpl: __local_22; }); unreachable; @@ -4536,10 +4536,10 @@ fn "core/json/to_string>>"(value) { break __inline_Option_Array_i32___Serialize__serialize_JsonSerializer__0: Array^Serialize::serialize(__local_7, __local_6.buf); }; __inline_JsonSerializer_Serializer__serialize_null_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__local_6.buf, 110); - String::append_char(__local_6.buf, 117); - String::append_char(__local_6.buf, 108); - String::append_char(__local_6.buf, 108); + String::push(__local_6.buf, 110); + String::push(__local_6.buf, 117); + String::push(__local_6.buf, 108); + String::push(__local_6.buf, 108); break __inline_JsonSerializer_Serializer__serialize_null_1: ref.null none; }; break __inline_Option_Array_i32___Serialize__serialize_JsonSerializer__0; @@ -5730,8 +5730,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -5786,13 +5786,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -5800,25 +5800,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -5826,7 +5826,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -5868,8 +5868,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -5901,7 +5901,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -6080,22 +6080,22 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } @@ -6126,7 +6126,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b403: block { l404: loop { @@ -6136,32 +6136,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b403; @@ -6169,10 +6169,10 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l404; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -6307,9 +6307,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -6376,9 +6376,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -6388,8 +6388,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -6444,13 +6444,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -6485,9 +6485,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -6498,10 +6498,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -6557,7 +6557,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -6688,7 +6688,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -6755,7 +6755,7 @@ fn Array>^Deserialize::deserialize(d) { if ref.is_null(first_opt) == 0 { first_elem = value_copy Option(ref.as_non_null(first_opt)); items = Array> { repr: builtin::array_new>(2), used: 0 }; - Array>::append(items, first_elem); + Array>::push(items, first_elem); block { l479: loop { let __sroa_next_discriminant: i32; @@ -6766,7 +6766,7 @@ fn Array>^Deserialize::deserialize(d) { next_opt = __sroa_next_case0_payload_0; if ref.is_null(next_opt) == 0 { item = value_copy Option(ref.as_non_null(next_opt)); - Array>::append(items, item); + Array>::push(items, item); } else { end_result_12 = "core:json/JsonDeserializer::expect_char"(seq.de, 93); if ref.is_null(end_result_12) == 0 { @@ -6810,7 +6810,7 @@ fn Array>^Deserialize::deserialize(d) { unreachable; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -6945,7 +6945,7 @@ fn Array>^Serialize::serialize(self, s) { let __local_16: ref Array>; seq_2 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { __local_14 = self.used; - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(seq_2) { @@ -6970,7 +6970,7 @@ fn Array>^Serialize::serialize(self, s) { }; }; return __inline_JsonSeqSerializer_SerializeSeq__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(seq_3.buf, 93); + String::push(seq_3.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_3: ref.null none; }; }; @@ -6988,7 +6988,7 @@ fn JsonSeqSerializer^SerializeSeq::element>(self, value) { let __local_7: ref Option; let __local_11: i32; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_Option_i32__Serialize__serialize_JsonSerializer__0: block -> ref null "core:serde/SerializeError" { @@ -6999,10 +6999,10 @@ fn JsonSeqSerializer^SerializeSeq::element>(self, value) { break __inline_Option_i32__Serialize__serialize_JsonSerializer__0: "core:json/JsonSerializer^Serializer::serialize_i32"(__local_5.buf, __local_11); }; __inline_JsonSerializer_Serializer__serialize_null_2: block -> ref null "core:serde/SerializeError" { - String::append_char(__local_5.buf, 110); - String::append_char(__local_5.buf, 117); - String::append_char(__local_5.buf, 108); - String::append_char(__local_5.buf, 108); + String::push(__local_5.buf, 110); + String::push(__local_5.buf, 117); + String::push(__local_5.buf, 108); + String::push(__local_5.buf, 108); break __inline_JsonSerializer_Serializer__serialize_null_2: ref.null none; }; break __inline_Option_i32__Serialize__serialize_JsonSerializer__0; @@ -7087,7 +7087,7 @@ fn Array^Deserialize::deserialize(d) { if ref.test Option::Some(first_opt) { first_elem = ref.cast Option::Some(first_opt).payload_0; items = Array { repr: builtin::array_new(2), used: 0 }; - Array::append(items, first_elem); + Array::push(items, first_elem); block { l520: loop { let __sroa_next_discriminant: i32; @@ -7098,7 +7098,7 @@ fn Array^Deserialize::deserialize(d) { next_opt = __sroa_next_case0_payload_0; if ref.test Option::Some(next_opt) { item = ref.cast Option::Some(next_opt).payload_0; - Array::append(items, item); + Array::push(items, item); } else { end_result_12 = "core:json/JsonDeserializer::expect_char"(seq.de, 93); if ref.is_null(end_result_12) == 0 { @@ -7142,7 +7142,7 @@ fn Array^Deserialize::deserialize(d) { unreachable; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -7247,7 +7247,7 @@ fn Array^Serialize::serialize(self, s) { let __local_16: ref Array; seq_2 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { __local_14 = self.used; - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(seq_2) { @@ -7274,7 +7274,7 @@ fn Array^Serialize::serialize(self, s) { }; }; return __inline_JsonSeqSerializer_SerializeSeq__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(seq_3.buf, 93); + String::push(seq_3.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_3: ref.null none; }; }; @@ -7289,7 +7289,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i32"(ser.buf, value); @@ -7465,7 +7465,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_i32____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -7539,7 +7539,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -7630,11 +7630,11 @@ fn TreeMap::find_index(self, key) { fn Config^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field>(__fused_payload_9, String { repr: array.new_data("settings"), used: 8 }, self)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -7645,10 +7645,10 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = TreeMap^Serialize::serialize(value, ser.buf); self.buf = ser.buf; @@ -7673,7 +7673,7 @@ fn TreeMap^Serialize::serialize(self, s) { entries = TreeMap::entries(self); map_r = __inline_JsonSerializer_Serializer__begin_map_0: block -> ref Result { __local_20 = entries.used; - String::append_char(s, 123); + String::push(s, 123); break __inline_JsonSerializer_Serializer__begin_map_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonMapSerializer" { buf: s, count: 0, need_value: 0 } }; }; if ref.test Result::Ok(map_r) { @@ -7702,7 +7702,7 @@ fn TreeMap^Serialize::serialize(self, s) { }; }; return __inline_JsonMapSerializer_SerializeMap__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(m.buf, 125); + String::push(m.buf, 125); break __inline_JsonMapSerializer_SerializeMap__end_3: ref.null none; }; }; @@ -7729,7 +7729,7 @@ fn JsonMapSerializer^SerializeMap::key(self, key) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_JsonSerializer_Serializer__serialize_string_1: block -> ref null "core:serde/SerializeError" { @@ -7737,7 +7737,7 @@ fn JsonMapSerializer^SerializeMap::key(self, key) { break __inline_JsonSerializer_Serializer__serialize_string_1: ref.null none; }; self.buf = ser.buf; - String::append_char(self.buf, 58); + String::push(self.buf, 58); self.need_value = 1; return r; } @@ -7773,7 +7773,7 @@ fn TreeMap::entries(self) { if ref.is_null(__pattern_temp_0) == 0 { entry = value_copy "core:allocator/TreeMapEntry"(ref.as_non_null(__pattern_temp_0)); if entry.deleted == 0 { - Array>::append(result, "tuple/[String, i32]" { 0: entry.key, 1: entry.value }); + Array>::push(result, "tuple/[String, i32]" { 0: entry.key, 1: entry.value }); }; } else { break b597; @@ -7784,7 +7784,7 @@ fn TreeMap::entries(self) { return result; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -8063,7 +8063,7 @@ fn Shape^Serialize::serialize(self, s) { __local_4 = __sroa___local_3_case0_payload_0; drop(JsonVariantSerializer^SerializeVariant::payload(__local_4, __local_2)); return __inline_JsonVariantSerializer_SerializeVariant__end_0: block -> ref null "core:serde/SerializeError" { - String::append_char(__local_4.buf, 125); + String::push(__local_4.buf, 125); break __inline_JsonVariantSerializer_SerializeVariant__end_0: ref.null none; }; } else { @@ -8081,7 +8081,7 @@ fn Shape^Serialize::serialize(self, s) { __local_7 = __sroa___local_6_case0_payload_0; drop(JsonVariantSerializer^SerializeVariant::payload(__local_7, __local_5)); return __inline_JsonVariantSerializer_SerializeVariant__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__local_7.buf, 125); + String::push(__local_7.buf, 125); break __inline_JsonVariantSerializer_SerializeVariant__end_1: ref.null none; }; } else { @@ -8111,12 +8111,12 @@ fn JsonVariantSerializer^SerializeVariant::payload(self, value) { fn Inner^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("value"), used: 5 }, self.value)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("label"), used: 5 }, self.label)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -8127,10 +8127,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_JsonSerializer_Serializer__serialize_string_1: block -> ref null "core:serde/SerializeError" { "core:json/write_escaped_string"(ser.buf, value); @@ -8145,10 +8145,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i32"(ser.buf, value); self.buf = ser.buf; @@ -8165,7 +8165,7 @@ fn JsonVariantSerializer^SerializeVariant::payload(self, value) { return r; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -8362,7 +8362,7 @@ fn TreeMap^IndexValue::index_value(self, key) { if index < 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -8388,7 +8388,7 @@ fn TreeMap^IndexValue::index_value(self, key) { if index < 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -8545,7 +8545,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_String____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -8619,7 +8619,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -8679,7 +8679,7 @@ fn TreeMap^Serialize::serialize(self, s) { entries = TreeMap::entries(self); map_r = __inline_JsonSerializer_Serializer__begin_map_0: block -> ref Result { __local_20 = entries.used; - String::append_char(s, 123); + String::push(s, 123); break __inline_JsonSerializer_Serializer__begin_map_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonMapSerializer" { buf: s, count: 0, need_value: 0 } }; }; if ref.test Result::Ok(map_r) { @@ -8709,7 +8709,7 @@ fn TreeMap^Serialize::serialize(self, s) { }; }; return __inline_JsonMapSerializer_SerializeMap__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(m.buf, 125); + String::push(m.buf, 125); break __inline_JsonMapSerializer_SerializeMap__end_3: ref.null none; }; }; @@ -8766,7 +8766,7 @@ fn TreeMap::entries(self) { if ref.is_null(__pattern_temp_0) == 0 { entry = value_copy "core:allocator/TreeMapEntry"(ref.as_non_null(__pattern_temp_0)); if entry.deleted == 0 { - Array>::append(result, "tuple/[String, String]" { 0: entry.key, 1: entry.value }); + Array>::push(result, "tuple/[String, String]" { 0: entry.key, 1: entry.value }); }; } else { break b713; @@ -8777,7 +8777,7 @@ fn TreeMap::entries(self) { return result; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -8905,8 +8905,8 @@ fn Result^Deserialize::deserialize(d) { }; return 1; ref.null none; "core:serde/DeserializeError" { kind: 2, message: ref.as_non_null(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(40), used: 0 }; - String::append(__local_17, String { repr: array.new_data("unknown Result variant: "), used: 24 }); - String::append(__local_17, name); + String::push_str(__local_17, String { repr: array.new_data("unknown Result variant: "), used: 24 }); + String::push_str(__local_17, name); break __tmpl: __local_17; }), offset: -1_i64 }; }; @@ -8949,7 +8949,7 @@ fn Result^Serialize::serialize(self, s) { return e_6; }; return __inline_JsonVariantSerializer_SerializeVariant__end_0: block -> ref null "core:serde/SerializeError" { - String::append_char(vs_4.buf, 125); + String::push(vs_4.buf, 125); break __inline_JsonVariantSerializer_SerializeVariant__end_0: ref.null none; }; }; @@ -8973,7 +8973,7 @@ fn Result^Serialize::serialize(self, s) { return e_12; }; return __inline_JsonVariantSerializer_SerializeVariant__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(vs_10.buf, 125); + String::push(vs_10.buf, 125); break __inline_JsonVariantSerializer_SerializeVariant__end_1: ref.null none; }; }; @@ -9037,7 +9037,7 @@ fn Array^Deserialize::deserialize(d) { if ref.is_null(first_opt) == 0 { first_elem = value_copy Inner(ref.as_non_null(first_opt)); items = Array { repr: builtin::array_new(2), used: 0 }; - Array::append(items, first_elem); + Array::push(items, first_elem); block { l748: loop { let __sroa_next_discriminant: i32; @@ -9048,7 +9048,7 @@ fn Array^Deserialize::deserialize(d) { next_opt = __sroa_next_case0_payload_0; if ref.is_null(next_opt) == 0 { item = value_copy Inner(ref.as_non_null(next_opt)); - Array::append(items, item); + Array::push(items, item); } else { end_result_12 = "core:json/JsonDeserializer::expect_char"(seq.de, 93); if ref.is_null(end_result_12) == 0 { @@ -9092,7 +9092,7 @@ fn Array^Deserialize::deserialize(d) { unreachable; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -9195,7 +9195,7 @@ fn Array^Serialize::serialize(self, s) { let __local_16: ref Array; seq_2 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { __local_14 = self.used; - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(seq_2) { @@ -9221,7 +9221,7 @@ fn Array^Serialize::serialize(self, s) { }; }; return __inline_JsonSeqSerializer_SerializeSeq__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(seq_3.buf, 93); + String::push(seq_3.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_3: ref.null none; }; }; @@ -9236,7 +9236,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = Inner^Serialize::serialize(value, ser.buf); @@ -9336,12 +9336,12 @@ fn Outer^Deserialize::deserialize(d) { fn Outer^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("inner"), used: 5 }, self.inner)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("count"), used: 5 }, self.count)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -9352,10 +9352,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = Inner^Serialize::serialize(value, ser.buf); self.buf = ser.buf; @@ -9595,7 +9595,7 @@ fn Array^Deserialize::deserialize(d) { if ref.is_null(first_opt) == 0 { first_elem = value_copy String(ref.as_non_null(first_opt)); items = Array { repr: builtin::array_new(2), used: 0 }; - Array::append(items, first_elem); + Array::push(items, first_elem); block { l814: loop { let __sroa_next_discriminant: i32; @@ -9606,7 +9606,7 @@ fn Array^Deserialize::deserialize(d) { next_opt = __sroa_next_case0_payload_0; if ref.is_null(next_opt) == 0 { item = value_copy String(ref.as_non_null(next_opt)); - Array::append(items, item); + Array::push(items, item); } else { end_result_12 = "core:json/JsonDeserializer::expect_char"(seq.de, 93); if ref.is_null(end_result_12) == 0 { @@ -9650,7 +9650,7 @@ fn Array^Deserialize::deserialize(d) { unreachable; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -9747,7 +9747,7 @@ fn JsonSeqAccess^DeserializeSeq::next_element(self) { fn FullStruct^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("name"), used: 4 }, self.name)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("age"), used: 3 }, self.age)); @@ -9757,7 +9757,7 @@ fn FullStruct^Serialize::serialize(self, s) { drop(JsonStructSerializer^SerializeStruct::field>(__fused_payload_9, String { repr: array.new_data("address"), used: 7 }, self.address)); drop(JsonStructSerializer^SerializeStruct::field>(__fused_payload_9, String { repr: array.new_data("rating"), used: 6 }, self.rating)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -9771,10 +9771,10 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value) { let __local_8: ref Option; let __local_12: i32; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_Option_i32__Serialize__serialize_JsonSerializer__0: block -> ref null "core:serde/SerializeError" { __local_6 = ser; @@ -9784,10 +9784,10 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value) { break __inline_Option_i32__Serialize__serialize_JsonSerializer__0: "core:json/JsonSerializer^Serializer::serialize_i32"(__local_6.buf, __local_12); }; __inline_JsonSerializer_Serializer__serialize_null_2: block -> ref null "core:serde/SerializeError" { - String::append_char(__local_6.buf, 110); - String::append_char(__local_6.buf, 117); - String::append_char(__local_6.buf, 108); - String::append_char(__local_6.buf, 108); + String::push(__local_6.buf, 110); + String::push(__local_6.buf, 117); + String::push(__local_6.buf, 108); + String::push(__local_6.buf, 108); break __inline_JsonSerializer_Serializer__serialize_null_2: ref.null none; }; break __inline_Option_i32__Serialize__serialize_JsonSerializer__0; @@ -9803,10 +9803,10 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value let __local_8: ref null String; let __sroa_ser_buf: ref String; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); __sroa_ser_buf = self.buf; r = __inline_Option_String__Serialize__serialize_JsonSerializer__0: block -> ref null "core:serde/SerializeError" { __local_8 = value_copy Option(value); @@ -9819,10 +9819,10 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value break __inline_Option_String__Serialize__serialize_JsonSerializer__0; }; __inline_JsonSerializer_Serializer__serialize_null_2: block -> ref null "core:serde/SerializeError" { - String::append_char(__sroa_ser_buf, 110); - String::append_char(__sroa_ser_buf, 117); - String::append_char(__sroa_ser_buf, 108); - String::append_char(__sroa_ser_buf, 108); + String::push(__sroa_ser_buf, 110); + String::push(__sroa_ser_buf, 117); + String::push(__sroa_ser_buf, 108); + String::push(__sroa_ser_buf, 108); break __inline_JsonSerializer_Serializer__serialize_null_2: ref.null none; }; break __inline_Option_String__Serialize__serialize_JsonSerializer__0; @@ -9836,10 +9836,10 @@ fn JsonStructSerializer^SerializeStruct::field>(self, name, value) let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = Array^Serialize::serialize(value, ser.buf); self.buf = ser.buf; @@ -9860,7 +9860,7 @@ fn Array^Serialize::serialize(self, s) { let __local_16: ref Array; seq_2 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { __local_14 = self.used; - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(seq_2) { @@ -9886,7 +9886,7 @@ fn Array^Serialize::serialize(self, s) { }; }; return __inline_JsonSeqSerializer_SerializeSeq__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(seq_3.buf, 93); + String::push(seq_3.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_3: ref.null none; }; }; @@ -9901,7 +9901,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_JsonSerializer_Serializer__serialize_string_1: block -> ref null "core:serde/SerializeError" { @@ -9927,10 +9927,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_bool"(ser.buf, value); self.buf = ser.buf; @@ -9942,10 +9942,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_f64"(ser.buf, value); self.buf = ser.buf; @@ -9972,7 +9972,7 @@ fn __Closure_3::__call(self, __input, __start, __end) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -9998,7 +9998,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(v, __local_3); @@ -10009,24 +10009,24 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core fn "core:json/JsonSerializer^Serializer::serialize_bool"(self, v) { // from core:json if v { - String::append_char(self, 116); - String::append_char(self, 114); - String::append_char(self, 117); - String::append_char(self, 101); + String::push(self, 116); + String::push(self, 114); + String::push(self, 117); + String::push(self, 101); } else { - String::append_char(self, 102); - String::append_char(self, 97); - String::append_char(self, 108); - String::append_char(self, 115); - String::append_char(self, 101); + String::push(self, 102); + String::push(self, 97); + String::push(self, 108); + String::push(self, 115); + String::push(self, 101); }; return ref.null none; } fn "core:json/JsonSerializer^Serializer::begin_variant"(self, type_name, variant_name, disc) { // from core:json - String::append_char(self, 123); + String::push(self, 123); "core:json/write_escaped_string"(self, variant_name); - String::append_char(self, 58); + String::push(self, 58); return 0; "core:json/JsonVariantSerializer" { buf: self }; ref.null none; } @@ -10105,13 +10105,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -10177,9 +10177,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -10439,21 +10439,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -10463,7 +10463,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -10475,10 +10475,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return Result::Err { discriminant: 1, payload_0: ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -10503,7 +10503,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }) }; }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -10518,7 +10518,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -10540,7 +10540,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -10568,7 +10568,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -11711,10 +11711,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -12136,7 +12136,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l1097; }; @@ -12156,7 +12156,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -12164,17 +12164,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -12328,20 +12328,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -12351,10 +12351,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -12364,10 +12364,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -12375,10 +12375,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -12390,7 +12390,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -12407,22 +12407,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b1136; @@ -12430,7 +12430,7 @@ fn String^Inspect::inspect(self, f) { continue l1137; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/serde_json_roundtrip_complex.wado/__closure_wrapper_0"(__env, __p0, __p1, __p2) { diff --git a/wado-compiler/tests/fixtures.golden/serde_json_scientific_notation.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_scientific_notation.wir.wado index 1fd0305cf..b7c2b0bef 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_scientific_notation.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_scientific_notation.wir.wado @@ -228,7 +228,7 @@ type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, re type "functype/core:json/utf8_sequence_length" = fn(i32) -> i32; -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -238,9 +238,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/core:json/JsonDeserializer::skip_whitespace" = fn(ref "core:json/JsonDeserializer"); @@ -374,27 +374,27 @@ fn __test_0_i32_from_1e2() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_0_i32_from_1e2"), used: 21 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_0_i32_from_1e2"), used: 21 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(12, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 100 "), used: 21 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -429,27 +429,27 @@ fn __test_1_i32_from_1e2() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_1_i32_from_1e2"), used: 21 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_1_i32_from_1e2"), used: 21 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(21, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 100 "), used: 21 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -484,27 +484,27 @@ fn __test_2_i32_from_5e0() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_2_i32_from_5e0"), used: 21 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_2_i32_from_5e0"), used: 21 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(30, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 5 "), used: 19 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -539,27 +539,27 @@ fn __test_3_i32_from_15e1() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_3_i32_from_15e1"), used: 22 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_3_i32_from_15e1"), used: 22 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(39, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 150 "), used: 21 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -594,27 +594,27 @@ fn __test_4_i32_from_1_5e1() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_4_i32_from_1_5e1"), used: 23 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_4_i32_from_1_5e1"), used: 23 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(48, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 15 "), used: 20 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -649,27 +649,27 @@ fn __test_5_i32_from_1_0e3() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_5_i32_from_1_0e3"), used: 23 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_5_i32_from_1_0e3"), used: 23 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(57, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 1000 "), used: 22 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -704,27 +704,27 @@ fn __test_6_i32_from_negative_scientific() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_6_i32_from_negative_scientific"), used: 37 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_6_i32_from_negative_scientific"), used: 37 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(66, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == -500 "), used: 22 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -759,27 +759,27 @@ fn __test_7_i32_from_explicit_positive_exponent() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_7_i32_from_explicit_positive_exponent"), used: 44 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_7_i32_from_explicit_positive_exponent"), used: 44 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(75, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 2000 "), used: 22 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -852,27 +852,27 @@ fn __test_10_i64_from_1e10() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_10_i64_from_1e10"), used: 23 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_10_i64_from_1e10"), used: 23 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(106, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 10000000000 as i64 "), used: 36 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i64::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -907,27 +907,27 @@ fn __test_11_i64_from_1e15() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_11_i64_from_1e15"), used: 23 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_11_i64_from_1e15"), used: 23 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(115, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 1000000000000000 as i64 "), used: 41 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i64::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -962,27 +962,27 @@ fn __test_12_i64_from_9_007199254740991e15() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_12_i64_from_9_007199254740991e15"), used: 39 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_12_i64_from_9_007199254740991e15"), used: 39 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(125, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 9007199254740991 as i64 "), used: 41 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i64::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1017,27 +1017,27 @@ fn __test_13_i64_from__1e10() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_13_i64_from__1e10"), used: 24 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_13_i64_from__1e10"), used: 24 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(134, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == -10000000000 as i64 "), used: 37 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i64::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1072,27 +1072,27 @@ fn __test_14_u32_from_1e3() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_14_u32_from_1e3"), used: 22 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_14_u32_from_1e3"), used: 22 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(145, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 1000 as u32 "), used: 29 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; u32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1127,27 +1127,27 @@ fn __test_15_u32_from_4_294967295e9() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_15_u32_from_4_294967295e9"), used: 32 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_15_u32_from_4_294967295e9"), used: 32 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(155, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 4294967295 as u32 "), used: 35 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; u32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1182,27 +1182,27 @@ fn __test_16_u64_from_1e10() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_16_u64_from_1e10"), used: 23 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_16_u64_from_1e10"), used: 23 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(166, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 10000000000 as u64 "), used: 36 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; u64::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1256,27 +1256,27 @@ fn __test_18_f64_from_1e10() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_18_f64_from_1e10"), used: 23 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_18_f64_from_1e10"), used: 23 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(186, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 10000000000.0 "), used: 31 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; f64::inspect_into(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1311,27 +1311,27 @@ fn __test_19_f64_from_2_5e_3() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_19_f64_from_2_5e_3"), used: 25 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_19_f64_from_2_5e_3"), used: 25 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(195, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 0.0025 "), used: 24 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; f64::inspect_into(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1366,27 +1366,27 @@ fn __test_20_f64_from__1_23e4() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_20_f64_from__1_23e4"), used: 26 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_20_f64_from__1_23e4"), used: 26 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(204, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == -12300.0 "), used: 26 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; f64::inspect_into(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1421,27 +1421,27 @@ fn __test_21_f32_from_1e2() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_21_f32_from_1e2"), used: 22 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_21_f32_from_1e2"), used: 22 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(215, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 100.0 as f32 "), used: 30 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; f32::inspect_into(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1476,27 +1476,27 @@ fn __test_22_i32_plain_integer_still_works() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_22_i32_plain_integer_still_works"), used: 39 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_22_i32_plain_integer_still_works"), used: 39 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(226, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 42 "), used: 20 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -1531,27 +1531,27 @@ fn __test_23_i64_plain_integer_still_works() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_23_i64_plain_integer_still_works"), used: 39 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_23_i64_plain_integer_still_works"), used: 39 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_scientific_notation.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(235, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: v == 1000000 as i64 "), used: 32 }); - String::append_char(__local_4, 118); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 118); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i64::fmt_decimal(v, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -2770,8 +2770,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2826,13 +2826,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -2840,25 +2840,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -2866,7 +2866,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -2908,8 +2908,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2941,7 +2941,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -3508,22 +3508,22 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } @@ -3541,7 +3541,7 @@ fn "core:json/utf8_sequence_length"(leading_byte) { // from core:json return 4; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3828,9 +3828,9 @@ fn f32::inspect_into(self, f) { break __inline_String__len_6: __local_23.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -3840,8 +3840,8 @@ fn f32::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -3909,9 +3909,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -3921,8 +3921,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -3977,13 +3977,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -4018,9 +4018,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -4031,10 +4031,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -4086,7 +4086,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -4101,7 +4101,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -4414,21 +4414,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -4438,7 +4438,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -4450,10 +4450,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -4478,7 +4478,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -4493,7 +4493,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -4515,7 +4515,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -4543,7 +4543,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -5983,7 +5983,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l593; }; @@ -6003,7 +6003,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -6011,17 +6011,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -6175,20 +6175,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -6198,10 +6198,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -6211,10 +6211,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -6222,10 +6222,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_json_ser_error.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_ser_error.wir.wado index bcd8f6e3b..b68e3f1be 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_ser_error.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_ser_error.wir.wado @@ -140,7 +140,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -150,13 +150,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -255,21 +255,21 @@ fn __test_0_f64_nan() { if __v0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_f64_nan"), used: 16 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_f64_nan"), used: 16 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(13, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: is_unsupported(e.kind) "), used: 35 }); - String::append(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); + String::push_str(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_17 = __local_6; Formatter::pad(__local_17, if __v0 -> ref String { @@ -277,7 +277,7 @@ condition: is_unsupported(e.kind) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -323,21 +323,21 @@ fn __test_1_f64_infinity() { if __v0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_1_f64_infinity"), used: 21 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_1_f64_infinity"), used: 21 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(23, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: is_unsupported(e.kind) "), used: 35 }); - String::append(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); + String::push_str(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_17 = __local_6; Formatter::pad(__local_17, if __v0 -> ref String { @@ -345,7 +345,7 @@ condition: is_unsupported(e.kind) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -391,21 +391,21 @@ fn __test_2_f64_negative_infinity() { if __v0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_2_f64_negative_infinity"), used: 30 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_2_f64_negative_infinity"), used: 30 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(33, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: is_unsupported(e.kind) "), used: 35 }); - String::append(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); + String::push_str(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_17 = __local_6; Formatter::pad(__local_17, if __v0 -> ref String { @@ -413,7 +413,7 @@ condition: is_unsupported(e.kind) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -459,21 +459,21 @@ fn __test_3_f32_nan() { if __v0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_3_f32_nan"), used: 16 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_3_f32_nan"), used: 16 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(43, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: is_unsupported(e.kind) "), used: 35 }); - String::append(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); + String::push_str(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_17 = __local_6; Formatter::pad(__local_17, if __v0 -> ref String { @@ -481,7 +481,7 @@ condition: is_unsupported(e.kind) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -527,21 +527,21 @@ fn __test_4_f32_infinity() { if __v0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_4_f32_infinity"), used: 21 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_4_f32_infinity"), used: 21 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(53, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: is_unsupported(e.kind) "), used: 35 }); - String::append(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); + String::push_str(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_17 = __local_6; Formatter::pad(__local_17, if __v0 -> ref String { @@ -549,7 +549,7 @@ condition: is_unsupported(e.kind) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -595,21 +595,21 @@ fn __test_5_f32_negative_infinity() { if __v0 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_5_f32_negative_infinity"), used: 30 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_5_f32_negative_infinity"), used: 30 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(63, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: is_unsupported(e.kind) "), used: 35 }); - String::append(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); + String::push_str(__local_5, String { repr: array.new_data("is_unsupported(e.kind): "), used: 24 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_17 = __local_6; Formatter::pad(__local_17, if __v0 -> ref String { @@ -617,7 +617,7 @@ condition: is_unsupported(e.kind) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -653,26 +653,26 @@ fn __test_6_normal_f64_succeeds() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_6_normal_f64_succeeds"), used: 28 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_6_normal_f64_succeeds"), used: 28 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(72, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: s == \"3.14\" "), used: 24 }); - String::append_char(__local_4, 115); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 115); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -708,26 +708,26 @@ fn __test_7_normal_f32_succeeds() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_7_normal_f32_succeeds"), used: 28 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_7_normal_f32_succeeds"), used: 28 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_ser_error.wado"), used: 54 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(82, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"2.5\" "), used: 23 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1524,8 +1524,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1580,8 +1580,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1613,7 +1613,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1742,27 +1742,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1883,9 +1883,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1939,13 +1939,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1980,9 +1980,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2035,7 +2035,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2123,7 +2123,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2167,7 +2167,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f32"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(builtin::f64_promote_f32(v), __local_3); @@ -2193,7 +2193,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(v, __local_3); @@ -2213,7 +2213,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l202; }; @@ -2233,7 +2233,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2241,17 +2241,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2405,20 +2405,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2428,10 +2428,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2441,10 +2441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2452,10 +2452,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -2467,7 +2467,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -2484,22 +2484,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b241; @@ -2507,7 +2507,7 @@ fn String^Inspect::inspect(self, f) { continue l242; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_f64_nan as "__test_0_f64_nan" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_string_escape.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_string_escape.wir.wado index 0797a07f8..0c42b6a51 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_string_escape.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_string_escape.wir.wado @@ -126,13 +126,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/core:json/JsonDeserializer::skip_whitespace" = fn(ref "core:json/JsonDeserializer"); @@ -199,29 +199,29 @@ fn __test_0_serialize_string_with_quotes() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_serialize_string_with_quotes"), used: 37 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_serialize_string_with_quotes"), used: 37 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(8, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: json == `\"say \\\\\"hello\\\\\"\"` "), used: 40 }); - String::append_char(__local_5, 106); - String::append_char(__local_5, 115); - String::append_char(__local_5, 111); - String::append_char(__local_5, 110); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 106); + String::push(__local_5, 115); + String::push(__local_5, 111); + String::push(__local_5, 110); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -252,29 +252,29 @@ fn __test_1_serialize_string_with_backslash() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_1_serialize_string_with_backslash"), used: 40 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_1_serialize_string_with_backslash"), used: 40 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(18, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: json == `\"path\\\\\\\\to\\\\\\\\file\"` "), used: 43 }); - String::append_char(__local_5, 106); - String::append_char(__local_5, 115); - String::append_char(__local_5, 111); - String::append_char(__local_5, 110); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 106); + String::push(__local_5, 115); + String::push(__local_5, 111); + String::push(__local_5, 110); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -306,29 +306,29 @@ line2"), used: 11 }; if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_2_serialize_string_with_newline"), used: 38 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_2_serialize_string_with_newline"), used: 38 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(28, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: json == `\"line1\\\\nline2\"` "), used: 38 }); - String::append_char(__local_5, 106); - String::append_char(__local_5, 115); - String::append_char(__local_5, 111); - String::append_char(__local_5, 110); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 106); + String::push(__local_5, 115); + String::push(__local_5, 111); + String::push(__local_5, 110); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -359,29 +359,29 @@ fn __test_3_serialize_string_with_tab() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_3_serialize_string_with_tab"), used: 34 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_3_serialize_string_with_tab"), used: 34 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(38, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: json == `\"col1\\\\tcol2\"` "), used: 36 }); - String::append_char(__local_5, 106); - String::append_char(__local_5, 115); - String::append_char(__local_5, 111); - String::append_char(__local_5, 110); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 106); + String::push(__local_5, 115); + String::push(__local_5, 111); + String::push(__local_5, 110); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -410,26 +410,26 @@ fn __test_4_deserialize_string_with_unicode_escape() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_4_deserialize_string_with_unicode_escape"), used: 47 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_4_deserialize_string_with_unicode_escape"), used: 47 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_11 = __local_5; i32::fmt_decimal(48, __local_11); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: s == \"A\" "), used: 21 }); - String::append_char(__local_4, 115); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 115); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -470,40 +470,40 @@ newline"), used: 17 }; if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_5_roundtrip_string_with_special_chars"), used: 44 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_5_roundtrip_string_with_special_chars"), used: 44 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_16 = __local_9; i32::fmt_decimal(60, __local_16); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: parsed == orig "), used: 27 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 97); - String::append_char(__local_8, 114); - String::append_char(__local_8, 115); - String::append_char(__local_8, 101); - String::append_char(__local_8, 100); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 97); + String::push(__local_8, 114); + String::push(__local_8, 115); + String::push(__local_8, 101); + String::push(__local_8, 100); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0, __local_9); - String::append_char(__local_8, 10); - String::append_char(__local_8, 111); - String::append_char(__local_8, 114); - String::append_char(__local_8, 105); - String::append_char(__local_8, 103); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 10); + String::push(__local_8, 111); + String::push(__local_8, 114); + String::push(__local_8, 105); + String::push(__local_8, 103); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v1, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -547,40 +547,40 @@ fn __test_6_roundtrip_multibyte_utf8_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_6_roundtrip_multibyte_utf8_string"), used: 40 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_6_roundtrip_multibyte_utf8_string"), used: 40 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_16 = __local_9; i32::fmt_decimal(76, __local_16); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: parsed == orig "), used: 27 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 97); - String::append_char(__local_8, 114); - String::append_char(__local_8, 115); - String::append_char(__local_8, 101); - String::append_char(__local_8, 100); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 97); + String::push(__local_8, 114); + String::push(__local_8, 115); + String::push(__local_8, 101); + String::push(__local_8, 100); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0, __local_9); - String::append_char(__local_8, 10); - String::append_char(__local_8, 111); - String::append_char(__local_8, 114); - String::append_char(__local_8, 105); - String::append_char(__local_8, 103); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 10); + String::push(__local_8, 111); + String::push(__local_8, 114); + String::push(__local_8, 105); + String::push(__local_8, 103); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v1, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -621,29 +621,29 @@ fn __test_7_roundtrip_empty_string() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_7_roundtrip_empty_string"), used: 31 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_7_roundtrip_empty_string"), used: 31 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_19 = __local_10; i32::fmt_decimal(89, __local_19); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: json == `\"\"` "), used: 25 }); - String::append_char(__local_9, 106); - String::append_char(__local_9, 115); - String::append_char(__local_9, 111); - String::append_char(__local_9, 110); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 106); + String::push(__local_9, 115); + String::push(__local_9, 111); + String::push(__local_9, 110); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0_3, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -659,31 +659,31 @@ condition: json == `\"\"` if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_7_roundtrip_empty_string"), used: 31 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_7_roundtrip_empty_string"), used: 31 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_string_escape.wado"), used: 58 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_26 = __local_12; i32::fmt_decimal(92, __local_26); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: parsed == \"\" "), used: 25 }); - String::append_char(__local_11, 112); - String::append_char(__local_11, 97); - String::append_char(__local_11, 114); - String::append_char(__local_11, 115); - String::append_char(__local_11, 101); - String::append_char(__local_11, 100); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 112); + String::push(__local_11, 97); + String::push(__local_11, 114); + String::push(__local_11, 115); + String::push(__local_11, 101); + String::push(__local_11, 100); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; String^Inspect::inspect(__v0_7, __local_12); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -954,7 +954,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b41: block { l42: loop { @@ -964,32 +964,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b41; @@ -997,7 +997,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l42; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } fn char::from_u32(value) { @@ -1039,10 +1039,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1081,7 +1081,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1169,7 +1169,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1482,21 +1482,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -1506,7 +1506,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -1518,10 +1518,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -1546,7 +1546,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -1561,7 +1561,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -1583,7 +1583,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -1611,7 +1611,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -1725,7 +1725,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l130; }; @@ -1745,7 +1745,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1753,17 +1753,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1793,20 +1793,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1816,10 +1816,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1829,10 +1829,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1840,10 +1840,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1855,7 +1855,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1872,22 +1872,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b153; @@ -1895,7 +1895,7 @@ fn String^Inspect::inspect(self, f) { continue l154; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_serialize_string_with_quotes as "__test_0_serialize_string_with_quotes" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_synth_enum.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_synth_enum.wir.wado index 1a73736ee..bd65ec34a 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_synth_enum.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_synth_enum.wir.wado @@ -159,13 +159,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Color^Inspect::inspect" = fn(enum:Color, ref Formatter); @@ -242,26 +242,26 @@ fn __test_0_enum_serialize_red() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_enum_serialize_red"), used: 27 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_enum.wado"), used: 55 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_enum_serialize_red"), used: 27 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_enum.wado"), used: 55 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_12 = __local_6; i32::fmt_decimal(17, __local_12); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\"Red\"` "), used: 25 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -299,29 +299,29 @@ fn __test_1_enum_roundtrip_green() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_1_enum_roundtrip_green"), used: 29 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_enum.wado"), used: 55 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_1_enum_roundtrip_green"), used: 29 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_enum.wado"), used: 55 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_20 = __local_11; i32::fmt_decimal(27, __local_20); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: json == `\"Green\"` "), used: 30 }); - String::append_char(__local_10, 106); - String::append_char(__local_10, 115); - String::append_char(__local_10, 111); - String::append_char(__local_10, 110); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 106); + String::push(__local_10, 115); + String::push(__local_10, 111); + String::push(__local_10, 110); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_3, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -338,35 +338,35 @@ condition: json == `\"Green\"` if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(164), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_1_enum_roundtrip_green"), used: 29 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_enum.wado"), used: 55 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_1_enum_roundtrip_green"), used: 29 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_enum.wado"), used: 55 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_27 = __local_13; i32::fmt_decimal(30, __local_27); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: parsed == Color::Green "), used: 35 }); - String::append_char(__local_12, 112); - String::append_char(__local_12, 97); - String::append_char(__local_12, 114); - String::append_char(__local_12, 115); - String::append_char(__local_12, 101); - String::append_char(__local_12, 100); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 112); + String::push(__local_12, 97); + String::push(__local_12, 114); + String::push(__local_12, 115); + String::push(__local_12, 101); + String::push(__local_12, 100); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; Color^Inspect::inspect(__v0_7, __local_13); - String::append_char(__local_12, 10); - String::append(__local_12, String { repr: array.new_data("Color::Green: "), used: 14 }); + String::push(__local_12, 10); + String::push_str(__local_12, String { repr: array.new_data("Color::Green: "), used: 14 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; Color^Inspect::inspect(__v1, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -411,25 +411,25 @@ fn __test_2_enum_deserialize_unknown_variant() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(302), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_2_enum_deserialize_unknown_variant"), used: 41 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_enum.wado"), used: 55 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_2_enum_deserialize_unknown_variant"), used: 41 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_enum.wado"), used: 55 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_14 = __local_8; i32::fmt_decimal(42, __local_14); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: e.message == \"unknown variant\" || e.message == \"UnknownVariant\" "), used: 76 }); - String::append(__local_7, String { repr: array.new_data("e.message: "), used: 11 }); + String::push_str(__local_7, String { repr: array.new_data("e.message: "), used: 11 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0, __local_8); - String::append_char(__local_7, 10); - String::append(__local_7, String { repr: array.new_data("e.message == \"unknown variant\": "), used: 32 }); + String::push(__local_7, 10); + String::push_str(__local_7, String { repr: array.new_data("e.message == \"unknown variant\": "), used: 32 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_20 = __local_8; Formatter::pad(__local_20, if __v1 -> ref String { @@ -437,12 +437,12 @@ condition: e.message == \"unknown variant\" || e.message == \"UnknownVariant\" } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_7, 10); - String::append(__local_7, String { repr: array.new_data("e.message: "), used: 11 }); + String::push(__local_7, 10); + String::push_str(__local_7, String { repr: array.new_data("e.message: "), used: 11 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v2, __local_8); - String::append_char(__local_7, 10); - String::append(__local_7, String { repr: array.new_data("e.message == \"UnknownVariant\": "), used: 31 }); + String::push(__local_7, 10); + String::push_str(__local_7, String { repr: array.new_data("e.message == \"UnknownVariant\": "), used: 31 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_26 = __local_8; Formatter::pad(__local_26, if __v3 -> ref String { @@ -450,7 +450,7 @@ condition: e.message == \"unknown variant\" || e.message == \"UnknownVariant\" } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -689,7 +689,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b32: block { l33: loop { @@ -699,32 +699,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b32; @@ -732,7 +732,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l33; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } fn char::from_u32(value) { @@ -774,10 +774,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -816,7 +816,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -904,7 +904,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -937,13 +937,13 @@ fn Color^Inspect::inspect(self, f) { let __local_7: ref String; if self == 0 { __local_3 = String { repr: array.new_data("Color::Red"), used: 10 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); } else if self == 1 { __local_5 = String { repr: array.new_data("Color::Green"), used: 12 }; - String::append(f.buf, __local_5); + String::push_str(f.buf, __local_5); } else if self == 2 { __local_7 = String { repr: array.new_data("Color::Blue"), used: 11 }; - String::append(f.buf, __local_7); + String::push_str(f.buf, __local_7); }; } @@ -1141,13 +1141,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -1398,21 +1398,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -1422,7 +1422,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -1434,10 +1434,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -1462,7 +1462,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -1477,7 +1477,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -1499,7 +1499,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -1527,7 +1527,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -1711,7 +1711,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l152; }; @@ -1731,7 +1731,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1739,17 +1739,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1779,20 +1779,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1802,10 +1802,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1815,10 +1815,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1826,10 +1826,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1841,7 +1841,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1858,22 +1858,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b175; @@ -1881,7 +1881,7 @@ fn String^Inspect::inspect(self, f) { continue l176; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_enum_serialize_red as "__test_0_enum_serialize_red" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_synth_variant.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_synth_variant.wir.wado index 198fa1ab3..bd1a775fe 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_synth_variant.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_synth_variant.wir.wado @@ -221,7 +221,7 @@ type "functype/core:json/utf8_sequence_length" = fn(i32) -> i32; type "functype/core:json/write_escaped_string" = fn(ref String, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -231,13 +231,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/core:json/JsonDeserializer::skip_whitespace" = fn(ref "core:json/JsonDeserializer"); @@ -350,29 +350,29 @@ fn __test_0_variant_serialize_unit_case() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_variant_serialize_unit_case"), used: 36 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_variant.wado"), used: 58 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_variant_serialize_unit_case"), used: 36 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_variant.wado"), used: 58 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(16, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: json == `\"Point\"` "), used: 30 }); - String::append_char(__local_5, 106); - String::append_char(__local_5, 115); - String::append_char(__local_5, 111); - String::append_char(__local_5, 110); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 106); + String::push(__local_5, 115); + String::push(__local_5, 111); + String::push(__local_5, 110); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -408,29 +408,29 @@ fn __test_1_variant_serialize_payload_case() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_1_variant_serialize_payload_case"), used: 39 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_variant.wado"), used: 58 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_1_variant_serialize_payload_case"), used: 39 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_variant.wado"), used: 58 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(26, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: json == `\\{\"Circle\":5\\}` "), used: 37 }); - String::append_char(__local_5, 106); - String::append_char(__local_5, 115); - String::append_char(__local_5, 111); - String::append_char(__local_5, 110); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 106); + String::push(__local_5, 115); + String::push(__local_5, 111); + String::push(__local_5, 110); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -512,27 +512,27 @@ fn __test_3_variant_roundtrip_payload_case() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_3_variant_roundtrip_payload_case"), used: 39 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_variant.wado"), used: 58 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_3_variant_roundtrip_payload_case"), used: 39 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_synth_variant.wado"), used: 58 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_16 = __local_9; i32::fmt_decimal(58, __local_16); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: r == 3.14 "), used: 22 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 114); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_21 = __local_9; f64::inspect_into(r, __local_21); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1337,8 +1337,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1393,13 +1393,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1407,25 +1407,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1433,7 +1433,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1475,8 +1475,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1508,7 +1508,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1687,22 +1687,22 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } @@ -1733,7 +1733,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b147: block { l148: loop { @@ -1743,32 +1743,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b147; @@ -1776,10 +1776,10 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l148; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1914,9 +1914,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1983,9 +1983,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1995,8 +1995,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2051,13 +2051,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2092,9 +2092,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2105,10 +2105,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -2160,7 +2160,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2248,7 +2248,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2390,7 +2390,7 @@ fn Shape^Serialize::serialize(self, s) { __local_4 = __sroa___local_3_case0_payload_0; drop(JsonVariantSerializer^SerializeVariant::payload(__local_4, __local_2)); return __inline_JsonVariantSerializer_SerializeVariant__end_0: block -> ref null "core:serde/SerializeError" { - String::append_char(__local_4.buf, 125); + String::push(__local_4.buf, 125); break __inline_JsonVariantSerializer_SerializeVariant__end_0: ref.null none; }; } else { @@ -2434,7 +2434,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(v, __local_3); @@ -2444,9 +2444,9 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core } fn "core:json/JsonSerializer^Serializer::begin_variant"(self, type_name, variant_name, disc) { // from core:json - String::append_char(self, 123); + String::push(self, 123); "core:json/write_escaped_string"(self, variant_name); - String::append_char(self, 58); + String::push(self, 58); return 0; "core:json/JsonVariantSerializer" { buf: self }; ref.null none; } @@ -2525,13 +2525,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -2782,21 +2782,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -2806,7 +2806,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -2818,10 +2818,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -2846,7 +2846,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2861,7 +2861,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2883,7 +2883,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2911,7 +2911,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -3368,7 +3368,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l333; }; @@ -3388,7 +3388,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3396,17 +3396,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3560,20 +3560,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3583,10 +3583,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3596,10 +3596,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3607,10 +3607,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3622,7 +3622,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3639,22 +3639,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b372; @@ -3662,7 +3662,7 @@ fn String^Inspect::inspect(self, f) { continue l373; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_variant_serialize_unit_case as "__test_0_variant_serialize_unit_case" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_treemap.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_treemap.wir.wado index c73696ffd..9c286c7f6 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_treemap.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_treemap.wir.wado @@ -458,7 +458,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -466,7 +466,7 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/JsonMapSerializer^SerializeMap::key" = fn(ref "core:json/JsonMapSerializer", ref String) -> ref null "core:serde/SerializeError"; @@ -474,7 +474,7 @@ type "functype/ArrayIter>>^Iterator::next" = fn(ref "wa type "functype/TreeMap>::entries" = fn(ref "core:allocator/TreeMap>") -> ref Array>>; -type "functype/Array>>::append" = fn(ref Array>>, ref "tuple/[String, Option]"); +type "functype/Array>>::push" = fn(ref Array>>, ref "tuple/[String, Option]"); type "functype/Array>>::grow" = fn(ref Array>>); @@ -488,7 +488,7 @@ type "functype/TreeMap>::split" = fn(ref "core:allocator/Tree type "functype/TreeMap>::skew" = fn(ref "core:allocator/TreeMap>", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>>::append" = fn(ref Array>>, ref "core:allocator/TreeMapEntry>"); +type "functype/Array>>::push" = fn(ref Array>>, ref "core:allocator/TreeMapEntry>"); type "functype/Array>>::grow" = fn(ref Array>>); @@ -500,13 +500,13 @@ type "functype/ArrayIter>>^Iterator::next" = fn(ref "was type "functype/TreeMap>::entries" = fn(ref "core:allocator/TreeMap>") -> ref Array>>; -type "functype/Array>>::append" = fn(ref Array>>, ref "tuple/[String, Array]"); +type "functype/Array>>::push" = fn(ref Array>>, ref "tuple/[String, Array]"); type "functype/Array>>::grow" = fn(ref Array>>); type "functype/ArrayIter>>^Iterator::next" = fn(ref "wasi:cli/types.wado/ArrayIter>>") -> ref null "core:allocator/TreeMapEntry>"; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -518,7 +518,7 @@ type "functype/TreeMap>::split" = fn(ref "core:allocator/TreeM type "functype/TreeMap>::skew" = fn(ref "core:allocator/TreeMap>", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>>::append" = fn(ref Array>>, ref "core:allocator/TreeMapEntry>"); +type "functype/Array>>::push" = fn(ref Array>>, ref "core:allocator/TreeMapEntry>"); type "functype/Array>>::grow" = fn(ref Array>>); @@ -528,7 +528,7 @@ type "functype/ArrayIter>^Iterator::next" = fn(ref "wasi:cli/ type "functype/TreeMap::entries" = fn(ref "core:allocator/TreeMap") -> ref Array>; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, bool]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, bool]"); type "functype/Array>::grow" = fn(ref Array>); @@ -542,7 +542,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -554,7 +554,7 @@ type "functype/ArrayIter>^Iterator::next" = fn(ref "wasi:cl type "functype/TreeMap::entries" = fn(ref "core:allocator/TreeMap") -> ref Array>; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -568,7 +568,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -586,7 +586,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -594,7 +594,7 @@ type "functype/ArrayIter>^Iterator::next" = fn(ref "wasi:cli/t type "functype/TreeMap::entries" = fn(ref "core:allocator/TreeMap") -> ref Array>; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, i32]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, i32]"); type "functype/Array>::grow" = fn(ref Array>); @@ -723,26 +723,26 @@ fn __test_0_treemap_serialize_string_keys() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_treemap_serialize_string_keys"), used: 38 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_treemap_serialize_string_keys"), used: 38 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_22 = __local_6; i32::fmt_decimal(15, __local_22); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"alice\":30,\"bob\":25\\}` "), used: 43 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -797,25 +797,25 @@ fn __test_1_treemap_roundtrip() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_1_treemap_roundtrip"), used: 26 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_1_treemap_roundtrip"), used: 26 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_29 = __local_10; i32::fmt_decimal(29, __local_29); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: parsed[\"x\"] == 1 "), used: 29 }); - String::append(__local_9, String { repr: array.new_data("parsed[\"x\"]: "), used: 13 }); + String::push_str(__local_9, String { repr: array.new_data("parsed[\"x\"]: "), used: 13 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_34 = __local_10; i32::fmt_decimal(__v0_5, __local_34); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -825,25 +825,25 @@ condition: parsed[\"x\"] == 1 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_1_treemap_roundtrip"), used: 26 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_1_treemap_roundtrip"), used: 26 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_40 = __local_12; i32::fmt_decimal(30, __local_40); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: parsed[\"y\"] == 2 "), used: 29 }); - String::append(__local_11, String { repr: array.new_data("parsed[\"y\"]: "), used: 13 }); + String::push_str(__local_11, String { repr: array.new_data("parsed[\"y\"]: "), used: 13 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_45 = __local_12; i32::fmt_decimal(__v0_7, __local_45); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -882,26 +882,26 @@ fn __test_2_treemap_empty() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_2_treemap_empty"), used: 22 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_2_treemap_empty"), used: 22 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_16 = __local_6; i32::fmt_decimal(43, __local_16); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\\}` "), used: 24 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -943,29 +943,29 @@ fn __test_3_treemap_empty_roundtrip() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_3_treemap_empty_roundtrip"), used: 32 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_3_treemap_empty_roundtrip"), used: 32 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_23 = __local_10; i32::fmt_decimal(53, __local_23); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: json == `\\{\\}` "), used: 27 }); - String::append_char(__local_9, 106); - String::append_char(__local_9, 115); - String::append_char(__local_9, 111); - String::append_char(__local_9, 110); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 106); + String::push(__local_9, 115); + String::push(__local_9, 111); + String::push(__local_9, 110); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0_3, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -981,25 +981,25 @@ condition: json == `\\{\\}` if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_3_treemap_empty_roundtrip"), used: 32 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_3_treemap_empty_roundtrip"), used: 32 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_31 = __local_12; i32::fmt_decimal(56, __local_31); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: parsed.len() == 0 "), used: 30 }); - String::append(__local_11, String { repr: array.new_data("parsed.len(): "), used: 14 }); + String::push_str(__local_11, String { repr: array.new_data("parsed.len(): "), used: 14 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_36 = __local_12; i32::fmt_decimal(__v0_7, __local_36); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1041,26 +1041,26 @@ fn __test_4_treemap_single_entry() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_4_treemap_single_entry"), used: 29 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_4_treemap_single_entry"), used: 29 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_19 = __local_6; i32::fmt_decimal(70, __local_19); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"only\":42\\}` "), used: 33 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1105,26 +1105,26 @@ fn __test_5_treemap_with_string_values() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_5_treemap_with_string_values"), used: 35 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_5_treemap_with_string_values"), used: 35 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_22 = __local_6; i32::fmt_decimal(82, __local_22); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"greeting\":\"hello\",\"farewell\":\"goodbye\"\\}` "), used: 63 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1165,26 +1165,26 @@ fn __test_6_treemap_with_bool_values() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_6_treemap_with_bool_values"), used: 33 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_6_treemap_with_bool_values"), used: 33 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_22 = __local_6; i32::fmt_decimal(94, __local_22); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"enabled\":true,\"debug\":false\\}` "), used: 52 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1237,26 +1237,26 @@ fn __test_7_treemap_with_nested_array_values() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_7_treemap_with_nested_array_values"), used: 41 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_7_treemap_with_nested_array_values"), used: 41 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_40 = __local_8; i32::fmt_decimal(106, __local_40); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: s == `\\{\"scores\":[10,20,30],\"ids\":[1,2]\\}` "), used: 55 }); - String::append_char(__local_7, 115); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -1301,26 +1301,26 @@ fn __test_8_treemap_with_option_values() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_8_treemap_with_option_values"), used: 35 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_8_treemap_with_option_values"), used: 35 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_22 = __local_6; i32::fmt_decimal(118, __local_22); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"present\":42,\"absent\":null\\}` "), used: 50 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1375,25 +1375,25 @@ fn __test_9_treemap_keys_with_special_chars() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(160), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_9_treemap_keys_with_special_chars"), used: 40 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_9_treemap_keys_with_special_chars"), used: 40 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_29 = __local_10; i32::fmt_decimal(133, __local_29); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: parsed[\"key with spaces\"] == 1 "), used: 43 }); - String::append(__local_9, String { repr: array.new_data("parsed[\"key with spaces\"]: "), used: 27 }); + String::push_str(__local_9, String { repr: array.new_data("parsed[\"key with spaces\"]: "), used: 27 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_34 = __local_10; i32::fmt_decimal(__v0_5, __local_34); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1403,25 +1403,25 @@ condition: parsed[\"key with spaces\"] == 1 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(164), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_9_treemap_keys_with_special_chars"), used: 40 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_9_treemap_keys_with_special_chars"), used: 40 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_40 = __local_12; i32::fmt_decimal(134, __local_40); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: parsed[\"key\\\"with\\\"quotes\"] == 2 "), used: 45 }); - String::append(__local_11, String { repr: array.new_data("parsed[\"key\\\"with\\\"quotes\"]: "), used: 29 }); + String::push_str(__local_11, String { repr: array.new_data("parsed[\"key\\\"with\\\"quotes\"]: "), used: 29 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_45 = __local_12; i32::fmt_decimal(__v0_7, __local_45); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1469,26 +1469,26 @@ fn __test_10_treemap_preserves_insertion_order() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_10_treemap_preserves_insertion_order"), used: 43 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_10_treemap_preserves_insertion_order"), used: 43 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_25 = __local_6; i32::fmt_decimal(151, __local_25); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"c\":3,\"a\":1,\"b\":2\\}` "), used: 41 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1540,9 +1540,9 @@ fn __test_11_treemap_many_entries_roundtrip() { }; key = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_12, 107); - String::append_char(__local_12, 101); - String::append_char(__local_12, 121); + String::push(__local_12, 107); + String::push(__local_12, 101); + String::push(__local_12, 121); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(i, __local_13); break __tmpl: __local_12; @@ -1571,25 +1571,25 @@ fn __test_11_treemap_many_entries_roundtrip() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_11_treemap_many_entries_roundtrip"), used: 40 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_11_treemap_many_entries_roundtrip"), used: 40 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_40 = __local_15; i32::fmt_decimal(166, __local_40); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: parsed.len() == 10 "), used: 31 }); - String::append(__local_14, String { repr: array.new_data("parsed.len(): "), used: 14 }); + String::push_str(__local_14, String { repr: array.new_data("parsed.len(): "), used: 14 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_45 = __local_15; i32::fmt_decimal(__v0_6, __local_45); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -1599,25 +1599,25 @@ condition: parsed.len() == 10 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_11_treemap_many_entries_roundtrip"), used: 40 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_11_treemap_many_entries_roundtrip"), used: 40 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_51 = __local_17; i32::fmt_decimal(167, __local_51); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: parsed[\"key0\"] == 0 "), used: 32 }); - String::append(__local_16, String { repr: array.new_data("parsed[\"key0\"]: "), used: 16 }); + String::push_str(__local_16, String { repr: array.new_data("parsed[\"key0\"]: "), used: 16 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_56 = __local_17; i32::fmt_decimal(__v0_8, __local_56); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -1627,25 +1627,25 @@ condition: parsed[\"key0\"] == 0 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_11_treemap_many_entries_roundtrip"), used: 40 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_11_treemap_many_entries_roundtrip"), used: 40 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_62 = __local_19; i32::fmt_decimal(168, __local_62); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: parsed[\"key9\"] == 9 "), used: 32 }); - String::append(__local_18, String { repr: array.new_data("parsed[\"key9\"]: "), used: 16 }); + String::push_str(__local_18, String { repr: array.new_data("parsed[\"key9\"]: "), used: 16 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_67 = __local_19; i32::fmt_decimal(__v0_10, __local_67); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -1697,25 +1697,25 @@ fn __test_12_treemap_deserialize_from_any_key_order() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_12_treemap_deserialize_from_any_key_order"), used: 48 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_12_treemap_deserialize_from_any_key_order"), used: 48 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_23 = __local_11; i32::fmt_decimal(182, __local_23); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: map[\"a\"] == 1 "), used: 26 }); - String::append(__local_10, String { repr: array.new_data("map[\"a\"]: "), used: 10 }); + String::push_str(__local_10, String { repr: array.new_data("map[\"a\"]: "), used: 10 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_28 = __local_11; i32::fmt_decimal(__v0_2, __local_28); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -1725,25 +1725,25 @@ condition: map[\"a\"] == 1 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_12_treemap_deserialize_from_any_key_order"), used: 48 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_12_treemap_deserialize_from_any_key_order"), used: 48 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_34 = __local_13; i32::fmt_decimal(183, __local_34); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: map[\"b\"] == 2 "), used: 26 }); - String::append(__local_12, String { repr: array.new_data("map[\"b\"]: "), used: 10 }); + String::push_str(__local_12, String { repr: array.new_data("map[\"b\"]: "), used: 10 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_39 = __local_13; i32::fmt_decimal(__v0_4, __local_39); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -1753,25 +1753,25 @@ condition: map[\"b\"] == 2 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_12_treemap_deserialize_from_any_key_order"), used: 48 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_12_treemap_deserialize_from_any_key_order"), used: 48 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_45 = __local_15; i32::fmt_decimal(184, __local_45); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: map[\"c\"] == 3 "), used: 26 }); - String::append(__local_14, String { repr: array.new_data("map[\"c\"]: "), used: 10 }); + String::push_str(__local_14, String { repr: array.new_data("map[\"c\"]: "), used: 10 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_50 = __local_15; i32::fmt_decimal(__v0_6, __local_50); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -1781,25 +1781,25 @@ condition: map[\"c\"] == 3 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_12_treemap_deserialize_from_any_key_order"), used: 48 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_12_treemap_deserialize_from_any_key_order"), used: 48 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_treemap.wado"), used: 52 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_57 = __local_17; i32::fmt_decimal(185, __local_57); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: map.len() == 3 "), used: 27 }); - String::append(__local_16, String { repr: array.new_data("map.len(): "), used: 11 }); + String::push_str(__local_16, String { repr: array.new_data("map.len(): "), used: 11 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_62 = __local_17; i32::fmt_decimal(__v0_8, __local_62); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -2480,7 +2480,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b130: block { l131: loop { @@ -2490,32 +2490,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b130; @@ -2523,7 +2523,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l131; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } fn char::from_u32(value) { @@ -2565,10 +2565,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -2607,7 +2607,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2738,7 +2738,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2782,7 +2782,7 @@ fn TreeMap>^Serialize::serialize(self, s) { entries = TreeMap>::entries(self); map_r = __inline_JsonSerializer_Serializer__begin_map_0: block -> ref Result { __local_20 = entries.used; - String::append_char(s, 123); + String::push(s, 123); break __inline_JsonSerializer_Serializer__begin_map_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonMapSerializer" { buf: s, count: 0, need_value: 0 } }; }; if ref.test Result::Ok(map_r) { @@ -2811,7 +2811,7 @@ fn TreeMap>^Serialize::serialize(self, s) { }; }; return __inline_JsonMapSerializer_SerializeMap__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(m.buf, 125); + String::push(m.buf, 125); break __inline_JsonMapSerializer_SerializeMap__end_3: ref.null none; }; }; @@ -2838,10 +2838,10 @@ fn JsonMapSerializer^SerializeMap::value>(self, value) { break __inline_Option_i32__Serialize__serialize_JsonSerializer__0: "core:json/JsonSerializer^Serializer::serialize_i32"(__local_5.buf, __local_11); }; __inline_JsonSerializer_Serializer__serialize_null_2: block -> ref null "core:serde/SerializeError" { - String::append_char(__local_5.buf, 110); - String::append_char(__local_5.buf, 117); - String::append_char(__local_5.buf, 108); - String::append_char(__local_5.buf, 108); + String::push(__local_5.buf, 110); + String::push(__local_5.buf, 117); + String::push(__local_5.buf, 108); + String::push(__local_5.buf, 108); break __inline_JsonSerializer_Serializer__serialize_null_2: ref.null none; }; break __inline_Option_i32__Serialize__serialize_JsonSerializer__0; @@ -2856,7 +2856,7 @@ fn JsonMapSerializer^SerializeMap::key(self, key) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_JsonSerializer_Serializer__serialize_string_1: block -> ref null "core:serde/SerializeError" { @@ -2864,7 +2864,7 @@ fn JsonMapSerializer^SerializeMap::key(self, key) { break __inline_JsonSerializer_Serializer__serialize_string_1: ref.null none; }; self.buf = ser.buf; - String::append_char(self.buf, 58); + String::push(self.buf, 58); self.need_value = 1; return r; } @@ -2900,7 +2900,7 @@ fn TreeMap>::entries(self) { if ref.is_null(__pattern_temp_0) == 0 { entry = value_copy "core:allocator/TreeMapEntry>"(ref.as_non_null(__pattern_temp_0)); if entry.deleted == 0 { - Array>>::append(result, "tuple/[String, Option]" { 0: entry.key, 1: entry.value }); + Array>>::push(result, "tuple/[String, Option]" { 0: entry.key, 1: entry.value }); }; } else { break b178; @@ -2911,7 +2911,7 @@ fn TreeMap>::entries(self) { return result; } -fn Array>>::append(self, value) { +fn Array>>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2986,7 +2986,7 @@ fn TreeMap>::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_Option_i32_____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry>" { key: key, value: value, deleted: 0 }; - Array>>::append(self.entries, entry); + Array>>::push(self.entries, entry); self.root = TreeMap>::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -3060,7 +3060,7 @@ fn TreeMap>::skew(self, node) { return ref.null none; } -fn Array>>::append(self, value) { +fn Array>>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3166,7 +3166,7 @@ fn TreeMap>^Serialize::serialize(self, s) { entries = TreeMap>::entries(self); map_r = __inline_JsonSerializer_Serializer__begin_map_0: block -> ref Result { __local_20 = entries.used; - String::append_char(s, 123); + String::push(s, 123); break __inline_JsonSerializer_Serializer__begin_map_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonMapSerializer" { buf: s, count: 0, need_value: 0 } }; }; if ref.test Result::Ok(map_r) { @@ -3196,7 +3196,7 @@ fn TreeMap>^Serialize::serialize(self, s) { }; }; return __inline_JsonMapSerializer_SerializeMap__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(m.buf, 125); + String::push(m.buf, 125); break __inline_JsonMapSerializer_SerializeMap__end_3: ref.null none; }; }; @@ -3230,7 +3230,7 @@ fn Array^Serialize::serialize(self, s) { let __local_16: ref Array; seq_2 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { __local_14 = self.used; - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(seq_2) { @@ -3257,7 +3257,7 @@ fn Array^Serialize::serialize(self, s) { }; }; return __inline_JsonSeqSerializer_SerializeSeq__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(seq_3.buf, 93); + String::push(seq_3.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_3: ref.null none; }; }; @@ -3272,7 +3272,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i32"(ser.buf, value); @@ -3322,7 +3322,7 @@ fn TreeMap>::entries(self) { if ref.is_null(__pattern_temp_0) == 0 { entry = value_copy "core:allocator/TreeMapEntry>"(ref.as_non_null(__pattern_temp_0)); if entry.deleted == 0 { - Array>>::append(result, "tuple/[String, Array]" { 0: entry.key, 1: entry.value }); + Array>>::push(result, "tuple/[String, Array]" { 0: entry.key, 1: entry.value }); }; } else { break b226; @@ -3333,7 +3333,7 @@ fn TreeMap>::entries(self) { return result; } -fn Array>>::append(self, value) { +fn Array>>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3385,7 +3385,7 @@ fn ArrayIter>>^Iterator::next(self) { return item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3450,7 +3450,7 @@ fn TreeMap>::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_Array_i32_____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry>" { key: key, value: value, deleted: 0 }; - Array>>::append(self.entries, entry); + Array>>::push(self.entries, entry); self.root = TreeMap>::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -3524,7 +3524,7 @@ fn TreeMap>::skew(self, node) { return ref.null none; } -fn Array>>::append(self, value) { +fn Array>>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3629,7 +3629,7 @@ fn TreeMap^Serialize::serialize(self, s) { entries = TreeMap::entries(self); map_r = __inline_JsonSerializer_Serializer__begin_map_0: block -> ref Result { __local_20 = entries.used; - String::append_char(s, 123); + String::push(s, 123); break __inline_JsonSerializer_Serializer__begin_map_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonMapSerializer" { buf: s, count: 0, need_value: 0 } }; }; if ref.test Result::Ok(map_r) { @@ -3658,7 +3658,7 @@ fn TreeMap^Serialize::serialize(self, s) { }; }; return __inline_JsonMapSerializer_SerializeMap__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(m.buf, 125); + String::push(m.buf, 125); break __inline_JsonMapSerializer_SerializeMap__end_3: ref.null none; }; }; @@ -3712,7 +3712,7 @@ fn TreeMap::entries(self) { if ref.is_null(__pattern_temp_0) == 0 { entry = value_copy "core:allocator/TreeMapEntry"(ref.as_non_null(__pattern_temp_0)); if entry.deleted == 0 { - Array>::append(result, "tuple/[String, bool]" { 0: entry.key, 1: entry.value }); + Array>::push(result, "tuple/[String, bool]" { 0: entry.key, 1: entry.value }); }; } else { break b270; @@ -3723,7 +3723,7 @@ fn TreeMap::entries(self) { return result; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3798,7 +3798,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_bool____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -3872,7 +3872,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -3978,7 +3978,7 @@ fn TreeMap^Serialize::serialize(self, s) { entries = TreeMap::entries(self); map_r = __inline_JsonSerializer_Serializer__begin_map_0: block -> ref Result { __local_20 = entries.used; - String::append_char(s, 123); + String::push(s, 123); break __inline_JsonSerializer_Serializer__begin_map_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonMapSerializer" { buf: s, count: 0, need_value: 0 } }; }; if ref.test Result::Ok(map_r) { @@ -4008,7 +4008,7 @@ fn TreeMap^Serialize::serialize(self, s) { }; }; return __inline_JsonMapSerializer_SerializeMap__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(m.buf, 125); + String::push(m.buf, 125); break __inline_JsonMapSerializer_SerializeMap__end_3: ref.null none; }; }; @@ -4065,7 +4065,7 @@ fn TreeMap::entries(self) { if ref.is_null(__pattern_temp_0) == 0 { entry = value_copy "core:allocator/TreeMapEntry"(ref.as_non_null(__pattern_temp_0)); if entry.deleted == 0 { - Array>::append(result, "tuple/[String, String]" { 0: entry.key, 1: entry.value }); + Array>::push(result, "tuple/[String, String]" { 0: entry.key, 1: entry.value }); }; } else { break b310; @@ -4076,7 +4076,7 @@ fn TreeMap::entries(self) { return result; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -4151,7 +4151,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_String____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -4225,7 +4225,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -4322,7 +4322,7 @@ fn TreeMap^IndexValue::index_value(self, key) { if index < 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -4479,7 +4479,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_i32____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -4553,7 +4553,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -4612,7 +4612,7 @@ fn TreeMap^Serialize::serialize(self, s) { entries = TreeMap::entries(self); map_r = __inline_JsonSerializer_Serializer__begin_map_0: block -> ref Result { __local_20 = entries.used; - String::append_char(s, 123); + String::push(s, 123); break __inline_JsonSerializer_Serializer__begin_map_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonMapSerializer" { buf: s, count: 0, need_value: 0 } }; }; if ref.test Result::Ok(map_r) { @@ -4641,7 +4641,7 @@ fn TreeMap^Serialize::serialize(self, s) { }; }; return __inline_JsonMapSerializer_SerializeMap__end_3: block -> ref null "core:serde/SerializeError" { - String::append_char(m.buf, 125); + String::push(m.buf, 125); break __inline_JsonMapSerializer_SerializeMap__end_3: ref.null none; }; }; @@ -4695,7 +4695,7 @@ fn TreeMap::entries(self) { if ref.is_null(__pattern_temp_0) == 0 { entry = value_copy "core:allocator/TreeMapEntry"(ref.as_non_null(__pattern_temp_0)); if entry.deleted == 0 { - Array>::append(result, "tuple/[String, i32]" { 0: entry.key, 1: entry.value }); + Array>::push(result, "tuple/[String, i32]" { 0: entry.key, 1: entry.value }); }; } else { break b385; @@ -4706,7 +4706,7 @@ fn TreeMap::entries(self) { return result; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -4761,7 +4761,7 @@ fn ArrayIter>^Iterator::next(self) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -4772,16 +4772,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core fn "core:json/JsonSerializer^Serializer::serialize_bool"(self, v) { // from core:json if v { - String::append_char(self, 116); - String::append_char(self, 114); - String::append_char(self, 117); - String::append_char(self, 101); + String::push(self, 116); + String::push(self, 114); + String::push(self, 117); + String::push(self, 101); } else { - String::append_char(self, 102); - String::append_char(self, 97); - String::append_char(self, 108); - String::append_char(self, 115); - String::append_char(self, 101); + String::push(self, 102); + String::push(self, 97); + String::push(self, 108); + String::push(self, 115); + String::push(self, 101); }; return ref.null none; } @@ -4861,13 +4861,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -5118,21 +5118,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -5142,7 +5142,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -5154,10 +5154,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -5182,7 +5182,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -5197,7 +5197,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -5219,7 +5219,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -5247,7 +5247,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -5682,7 +5682,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l499; }; @@ -5702,7 +5702,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -5710,17 +5710,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -5750,20 +5750,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -5773,10 +5773,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -5786,10 +5786,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -5797,10 +5797,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -5812,7 +5812,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -5829,22 +5829,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b522; @@ -5852,7 +5852,7 @@ fn String^Inspect::inspect(self, f) { continue l523; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_treemap_serialize_string_keys as "__test_0_treemap_serialize_string_keys" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_tuple.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_tuple.wir.wado index 53b813e59..b74b8fe7e 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_tuple.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_tuple.wir.wado @@ -88,6 +88,11 @@ struct Option::Some { payload_0: i32, } +variant Option { + Some(ref String), + None, +} + variant Result { Ok(i32), Err(ref "core:serde/DeserializeError"), @@ -118,11 +123,6 @@ struct Result::Err { payload_0: ref "core:serde/DeserializeError", } -variant Option { - Some(ref String), - None, -} - variant Result { Ok(ref "core:json/JsonSeqSerializer"), Err(ref "core:serde/SerializeError"), @@ -266,7 +266,7 @@ type "functype/core:json/utf8_sequence_length" = fn(i32) -> i32; type "functype/core:json/write_escaped_string" = fn(ref String, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -276,13 +276,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/String^Deserialize::deserialize_next_element_from_seq" = fn(ref "core:json/JsonSeqAccess") -> ref Result; @@ -419,26 +419,26 @@ fn __test_0_tuple_serialize__i32__string__bool_() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_tuple_serialize__i32__string__bool_"), used: 44 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_tuple.wado"), used: 50 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_tuple_serialize__i32__string__bool_"), used: 44 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_tuple.wado"), used: 50 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(10, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `[42,\"hello\",true]` "), used: 37 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -489,25 +489,25 @@ fn __test_1_tuple_roundtrip__i32__string_() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_1_tuple_roundtrip__i32__string_"), used: 38 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_tuple.wado"), used: 50 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_1_tuple_roundtrip__i32__string_"), used: 38 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_tuple.wado"), used: 50 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_18 = __local_10; i32::fmt_decimal(22, __local_18); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: parsed.0 == 10 "), used: 27 }); - String::append(__local_9, String { repr: array.new_data("parsed.0: "), used: 10 }); + String::push_str(__local_9, String { repr: array.new_data("parsed.0: "), used: 10 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_23 = __local_10; i32::fmt_decimal(__v0_5, __local_23); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -517,24 +517,24 @@ condition: parsed.0 == 10 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_1_tuple_roundtrip__i32__string_"), used: 38 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_tuple.wado"), used: 50 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_1_tuple_roundtrip__i32__string_"), used: 38 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_tuple.wado"), used: 50 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_29 = __local_12; i32::fmt_decimal(23, __local_29); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: parsed.1 == \"world\" "), used: 32 }); - String::append(__local_11, String { repr: array.new_data("parsed.1: "), used: 10 }); + String::push_str(__local_11, String { repr: array.new_data("parsed.1: "), used: 10 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; String^Inspect::inspect(__v0_7, __local_12); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -576,26 +576,26 @@ fn __test_2_pair_tuple_serialize() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_2_pair_tuple_serialize"), used: 29 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_tuple.wado"), used: 50 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_2_pair_tuple_serialize"), used: 29 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_tuple.wado"), used: 50 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(36, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"[3.14,2.72]\" "), used: 31 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1413,8 +1413,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1469,8 +1469,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1502,7 +1502,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1681,22 +1681,22 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } @@ -1727,7 +1727,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b139: block { l140: loop { @@ -1737,32 +1737,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b139; @@ -1770,10 +1770,10 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l140; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1908,9 +1908,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1964,13 +1964,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2005,9 +2005,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2018,10 +2018,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -2073,7 +2073,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2161,7 +2161,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2196,7 +2196,7 @@ fn Tuple^Serialize::serialize(self, s) { let v_7: f64; let v_8: f64; seq = value_copy "core:json/JsonSeqSerializer"(let __match_scrut_0: ref Result; __match_scrut_0 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(__match_scrut_0) -> ref "core:json/JsonSeqSerializer" { let __cast_2: ref Result::Ok; @@ -2218,7 +2218,7 @@ fn Tuple^Serialize::serialize(self, s) { v_8 = __tuple_5.1; drop(JsonSeqSerializer^SerializeSeq::element(seq, v_8)); return __inline_JsonSeqSerializer_SerializeSeq__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(seq.buf, 93); + String::push(seq.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_1: ref.null none; }; } @@ -2227,7 +2227,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_f64"(ser.buf, value); @@ -2468,7 +2468,7 @@ fn Tuple^Serialize::serialize(self, s) { let v_7: i32; let v_8: ref String; seq = value_copy "core:json/JsonSeqSerializer"(let __match_scrut_0: ref Result; __match_scrut_0 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(__match_scrut_0) -> ref "core:json/JsonSeqSerializer" { let __cast_2: ref Result::Ok; @@ -2490,7 +2490,7 @@ fn Tuple^Serialize::serialize(self, s) { v_8 = __tuple_5.1; drop(JsonSeqSerializer^SerializeSeq::element(seq, v_8)); return __inline_JsonSeqSerializer_SerializeSeq__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(seq.buf, 93); + String::push(seq.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_1: ref.null none; }; } @@ -2499,7 +2499,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_JsonSerializer_Serializer__serialize_string_1: block -> ref null "core:serde/SerializeError" { @@ -2515,7 +2515,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i32"(ser.buf, value); @@ -2533,7 +2533,7 @@ fn Tuple^Serialize::serialize(self, s) { let v_8: ref String; let v_9: bool; seq = value_copy "core:json/JsonSeqSerializer"(let __match_scrut_0: ref Result; __match_scrut_0 = __inline_JsonSerializer_Serializer__begin_seq_0: block -> ref Result { - String::append_char(s, 91); + String::push(s, 91); break __inline_JsonSerializer_Serializer__begin_seq_0: Result::Ok { discriminant: 0, payload_0: "core:json/JsonSeqSerializer" { buf: s, count: 0 } }; }; if ref.test Result::Ok(__match_scrut_0) -> ref "core:json/JsonSeqSerializer" { let __cast_2: ref Result::Ok; @@ -2557,7 +2557,7 @@ fn Tuple^Serialize::serialize(self, s) { v_9 = __tuple_5.2; drop(JsonSeqSerializer^SerializeSeq::element(seq, v_9)); return __inline_JsonSeqSerializer_SerializeSeq__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(seq.buf, 93); + String::push(seq.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_1: ref.null none; }; } @@ -2566,7 +2566,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_bool"(ser.buf, value); @@ -2578,7 +2578,7 @@ fn JsonSeqSerializer^SerializeSeq::element(self, value) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -2604,7 +2604,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(v, __local_3); @@ -2615,16 +2615,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core fn "core:json/JsonSerializer^Serializer::serialize_bool"(self, v) { // from core:json if v { - String::append_char(self, 116); - String::append_char(self, 114); - String::append_char(self, 117); - String::append_char(self, 101); + String::push(self, 116); + String::push(self, 114); + String::push(self, 117); + String::push(self, 101); } else { - String::append_char(self, 102); - String::append_char(self, 97); - String::append_char(self, 108); - String::append_char(self, 115); - String::append_char(self, 101); + String::push(self, 102); + String::push(self, 97); + String::push(self, 108); + String::push(self, 115); + String::push(self, 101); }; return ref.null none; } @@ -2704,13 +2704,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -2961,21 +2961,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -2985,7 +2985,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -2997,10 +2997,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -3025,7 +3025,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -3040,7 +3040,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -3062,7 +3062,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -3090,7 +3090,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -3468,7 +3468,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l330; }; @@ -3488,7 +3488,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3496,17 +3496,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3660,20 +3660,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3683,10 +3683,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3696,10 +3696,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3707,10 +3707,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3722,7 +3722,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3739,22 +3739,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b369; @@ -3762,7 +3762,7 @@ fn String^Inspect::inspect(self, f) { continue l370; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_tuple_serialize__i32__string__bool_ as "__test_0_tuple_serialize__i32__string__bool_" diff --git a/wado-compiler/tests/fixtures.golden/serde_json_unknown_fields.wir.wado b/wado-compiler/tests/fixtures.golden/serde_json_unknown_fields.wir.wado index 3bf416810..4df3f4c6b 100644 --- a/wado-compiler/tests/fixtures.golden/serde_json_unknown_fields.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_json_unknown_fields.wir.wado @@ -176,7 +176,7 @@ type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, re type "functype/core:json/utf8_sequence_length" = fn(i32) -> i32; -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -188,9 +188,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/__Closure_0::__call" = fn(ref __Closure_0, ref String, i32, i32) -> ref Option; @@ -306,29 +306,29 @@ fn __test_0_unknown_fields_ignored() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_0_unknown_fields_ignored"), used: 31 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_0_unknown_fields_ignored"), used: 31 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_14 = __local_7; i32::fmt_decimal(16, __local_14); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: p.x == 1.0 "), used: 23 }); - String::append_char(__local_6, 112); - String::append_char(__local_6, 46); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 112); + String::push(__local_6, 46); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_19 = __local_7; f64::inspect_into(__v0_2, __local_19); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -338,29 +338,29 @@ condition: p.x == 1.0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_0_unknown_fields_ignored"), used: 31 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_0_unknown_fields_ignored"), used: 31 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_23 = __local_9; i32::fmt_decimal(17, __local_23); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p.y == 2.0 "), used: 23 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 46); - String::append_char(__local_8, 121); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 46); + String::push(__local_8, 121); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_28 = __local_9; f64::inspect_into(__v0_4, __local_28); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -403,29 +403,29 @@ fn __test_1_unknown_field_with_object_value() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_1_unknown_field_with_object_value"), used: 40 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_1_unknown_field_with_object_value"), used: 40 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_14 = __local_7; i32::fmt_decimal(26, __local_14); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: p.x == 1.0 "), used: 23 }); - String::append_char(__local_6, 112); - String::append_char(__local_6, 46); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 112); + String::push(__local_6, 46); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_19 = __local_7; f64::inspect_into(__v0_2, __local_19); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -435,29 +435,29 @@ condition: p.x == 1.0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_1_unknown_field_with_object_value"), used: 40 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_1_unknown_field_with_object_value"), used: 40 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_23 = __local_9; i32::fmt_decimal(27, __local_23); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p.y == 2.0 "), used: 23 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 46); - String::append_char(__local_8, 121); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 46); + String::push(__local_8, 121); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_28 = __local_9; f64::inspect_into(__v0_4, __local_28); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -500,29 +500,29 @@ fn __test_2_unknown_field_with_array_value() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_2_unknown_field_with_array_value"), used: 39 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_2_unknown_field_with_array_value"), used: 39 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_14 = __local_7; i32::fmt_decimal(36, __local_14); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: p.x == 1.0 "), used: 23 }); - String::append_char(__local_6, 112); - String::append_char(__local_6, 46); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 112); + String::push(__local_6, 46); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_19 = __local_7; f64::inspect_into(__v0_2, __local_19); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -532,29 +532,29 @@ condition: p.x == 1.0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_2_unknown_field_with_array_value"), used: 39 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_2_unknown_field_with_array_value"), used: 39 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_json_unknown_fields.wado"), used: 59 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_23 = __local_9; i32::fmt_decimal(37, __local_23); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p.y == 2.0 "), used: 23 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 46); - String::append_char(__local_8, 121); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 46); + String::push(__local_8, 121); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_28 = __local_9; f64::inspect_into(__v0_4, __local_28); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1353,8 +1353,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1409,13 +1409,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1423,25 +1423,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1449,7 +1449,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1491,8 +1491,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1524,7 +1524,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1703,22 +1703,22 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } @@ -1736,7 +1736,7 @@ fn "core:json/utf8_sequence_length"(leading_byte) { // from core:json return 4; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1873,9 +1873,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1885,8 +1885,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1941,13 +1941,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1982,9 +1982,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1995,10 +1995,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -2054,7 +2054,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2069,7 +2069,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2257,13 +2257,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -2329,9 +2329,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -2591,21 +2591,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -2615,7 +2615,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -2627,10 +2627,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -2655,7 +2655,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -2670,7 +2670,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -2692,7 +2692,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -2720,7 +2720,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -3610,10 +3610,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -3793,7 +3793,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l380; }; @@ -3813,7 +3813,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3821,17 +3821,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3985,20 +3985,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -4008,10 +4008,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -4021,10 +4021,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -4032,10 +4032,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_serialize_array.wir.wado b/wado-compiler/tests/fixtures.golden/serde_serialize_array.wir.wado index ac4e7c110..567e4145a 100644 --- a/wado-compiler/tests/fixtures.golden/serde_serialize_array.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_serialize_array.wir.wado @@ -103,11 +103,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -119,7 +119,7 @@ type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayI type "functype/Array^Serialize::serialize" = fn(ref Array, ref JsonSerializer) -> ref null SerializeError; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -175,8 +175,8 @@ fn run() with Stdout { drop(Array^Serialize::serialize(nums, ser)); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Array: "), used: 12 }); - String::append(__local_7, ser.buf); + String::push_str(__local_7, String { repr: array.new_data("Array: "), used: 12 }); + String::push_str(__local_7, ser.buf); break __tmpl: __local_7; }); ser.buf = String { repr: builtin::array_new(0), used: 0 }; @@ -187,8 +187,8 @@ fn run() with Stdout { drop(Array^Serialize::serialize(strs, ser)); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Array: "), used: 15 }); - String::append(__local_8, ser.buf); + String::push_str(__local_8, String { repr: array.new_data("Array: "), used: 15 }); + String::push_str(__local_8, ser.buf); break __tmpl: __local_8; }); ser.buf = String { repr: builtin::array_new(0), used: 0 }; @@ -199,14 +199,14 @@ fn run() with Stdout { drop(Array^Serialize::serialize(empty, ser)); "core:cli/println"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_9, 69); - String::append_char(__local_9, 109); - String::append_char(__local_9, 112); - String::append_char(__local_9, 116); - String::append_char(__local_9, 121); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); - String::append(__local_9, ser.buf); + String::push(__local_9, 69); + String::push(__local_9, 109); + String::push(__local_9, 112); + String::push(__local_9, 116); + String::push(__local_9, 121); + String::push(__local_9, 58); + String::push(__local_9, 32); + String::push_str(__local_9, ser.buf); break __tmpl: __local_9; }); } @@ -406,7 +406,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -421,7 +421,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -451,7 +451,7 @@ fn String::append_char(self, c) { fn JsonSerializer^Serializer::serialize_i32(self, v) { let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -462,17 +462,17 @@ fn JsonSerializer^Serializer::serialize_i32(self, v) { fn JsonSerializer^Serializer::serialize_string(self, v) { let __local_2: ref String; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); - String::append(__local_2, v); - String::append_char(__local_2, 34); + String::push(__local_2, 34); + String::push_str(__local_2, v); + String::push(__local_2, 34); break __tmpl: __local_2; }); return ref.null none; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -522,7 +522,7 @@ fn Array^Serialize::serialize(self, s) { let __local_11: ref Array; let __fused_payload_13: ref JsonSeqSerializer; __fused___inline_JsonSerializer_Serializer__begin_seq_0: block { - String::append_char(s.buf, 91); + String::push(s.buf, 91); __fused_payload_13 = JsonSeqSerializer { ser: s, count: 0 }; seq = __fused_payload_13; __iter_4 = __inline_Array_String__IntoIterator__into_iter_2: block -> ref "core:allocator/ArrayIter" { @@ -542,7 +542,7 @@ fn Array^Serialize::serialize(self, s) { }; }; return __inline_JsonSeqSerializer_SerializeSeq__end_3: block -> ref null SerializeError { - String::append_char(seq.ser.buf, 93); + String::push(seq.ser.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_3: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_seq_0; @@ -553,7 +553,7 @@ fn Array^Serialize::serialize(self, s) { fn JsonSeqSerializer^SerializeSeq::element(self, value) { let __local_3: ref JsonSerializer; if self.count > 0 { - String::append_char(self.ser.buf, 44); + String::push(self.ser.buf, 44); }; drop(__inline_String_Serialize__serialize_JsonSerializer__0: block -> ref null SerializeError { __local_3 = self.ser; @@ -579,7 +579,7 @@ fn Array^Serialize::serialize(self, s) { let __local_11: ref Array; let __fused_payload_13: ref JsonSeqSerializer; __fused___inline_JsonSerializer_Serializer__begin_seq_0: block { - String::append_char(s.buf, 91); + String::push(s.buf, 91); __fused_payload_13 = JsonSeqSerializer { ser: s, count: 0 }; seq = __fused_payload_13; __iter_4 = __inline_Array_i32__IntoIterator__into_iter_2: block -> ref "core:allocator/ArrayIter" { @@ -600,7 +600,7 @@ fn Array^Serialize::serialize(self, s) { }; }; return __inline_JsonSeqSerializer_SerializeSeq__end_3: block -> ref null SerializeError { - String::append_char(seq.ser.buf, 93); + String::push(seq.ser.buf, 93); break __inline_JsonSeqSerializer_SerializeSeq__end_3: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_seq_0; @@ -611,7 +611,7 @@ fn Array^Serialize::serialize(self, s) { fn JsonSeqSerializer^SerializeSeq::element(self, value) { let __local_3: ref JsonSerializer; if self.count > 0 { - String::append_char(self.ser.buf, 44); + String::push(self.ser.buf, 44); }; drop(__inline_i32_Serialize__serialize_JsonSerializer__0: block -> ref null SerializeError { __local_3 = self.ser; @@ -631,7 +631,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -684,7 +684,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l41; }; @@ -718,20 +718,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -741,10 +741,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -754,10 +754,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -765,10 +765,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_serialize_enum.wir.wado b/wado-compiler/tests/fixtures.golden/serde_serialize_enum.wir.wado index 1dd978c7f..ad9239e08 100644 --- a/wado-compiler/tests/fixtures.golden/serde_serialize_enum.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_serialize_enum.wir.wado @@ -55,7 +55,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/wasi/stream-drop-writable" = fn(i32); @@ -210,7 +210,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -227,11 +227,11 @@ fn String::append(self, other) { fn JsonSerializer^Serializer::serialize_unit_variant(self, type_name, variant_name, disc) { let __local_4: ref String; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(18), used: 0 }; - String::append(__local_4, String { repr: array.new_data("\""), used: 1 }); - String::append(__local_4, variant_name); - String::append(__local_4, String { repr: array.new_data("\""), used: 1 }); + String::push_str(__local_4, String { repr: array.new_data("\""), used: 1 }); + String::push_str(__local_4, variant_name); + String::push_str(__local_4, String { repr: array.new_data("\""), used: 1 }); break __tmpl: __local_4; }); return ref.null none; diff --git a/wado-compiler/tests/fixtures.golden/serde_serialize_option.wir.wado b/wado-compiler/tests/fixtures.golden/serde_serialize_option.wir.wado index 55287e667..5f76dbc93 100644 --- a/wado-compiler/tests/fixtures.golden/serde_serialize_option.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_serialize_option.wir.wado @@ -82,9 +82,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -135,23 +135,23 @@ fn run() with Stdout { break __inline_Option_i32__Serialize__serialize_JsonSerializer__2: JsonSerializer^Serializer::serialize_i32(__local_7.buf, __local_24); }; __inline_JsonSerializer_Serializer__serialize_null_4: block -> ref null SerializeError { - String::append_char(__local_7.buf, 110); - String::append_char(__local_7.buf, 117); - String::append_char(__local_7.buf, 108); - String::append_char(__local_7.buf, 108); + String::push(__local_7.buf, 110); + String::push(__local_7.buf, 117); + String::push(__local_7.buf, 108); + String::push(__local_7.buf, 108); break __inline_JsonSerializer_Serializer__serialize_null_4: ref.null none; }; break __inline_Option_i32__Serialize__serialize_JsonSerializer__2; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_3, 83); - String::append_char(__local_3, 111); - String::append_char(__local_3, 109); - String::append_char(__local_3, 101); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); - String::append(__local_3, ser.buf); + String::push(__local_3, 83); + String::push(__local_3, 111); + String::push(__local_3, 109); + String::push(__local_3, 101); + String::push(__local_3, 58); + String::push(__local_3, 32); + String::push_str(__local_3, ser.buf); break __tmpl: __local_3; }); ser.buf = String { repr: builtin::array_new(0), used: 0 }; @@ -164,23 +164,23 @@ fn run() with Stdout { break __inline_Option_i32__Serialize__serialize_JsonSerializer__6: JsonSerializer^Serializer::serialize_i32(__local_15.buf, __local_25); }; __inline_JsonSerializer_Serializer__serialize_null_8: block -> ref null SerializeError { - String::append_char(__local_15.buf, 110); - String::append_char(__local_15.buf, 117); - String::append_char(__local_15.buf, 108); - String::append_char(__local_15.buf, 108); + String::push(__local_15.buf, 110); + String::push(__local_15.buf, 117); + String::push(__local_15.buf, 108); + String::push(__local_15.buf, 108); break __inline_JsonSerializer_Serializer__serialize_null_8: ref.null none; }; break __inline_Option_i32__Serialize__serialize_JsonSerializer__6; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_4, 78); - String::append_char(__local_4, 111); - String::append_char(__local_4, 110); - String::append_char(__local_4, 101); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); - String::append(__local_4, ser.buf); + String::push(__local_4, 78); + String::push(__local_4, 111); + String::push(__local_4, 110); + String::push(__local_4, 101); + String::push(__local_4, 58); + String::push(__local_4, 32); + String::push_str(__local_4, ser.buf); break __tmpl: __local_4; }); } @@ -380,7 +380,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -395,7 +395,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -425,7 +425,7 @@ fn String::append_char(self, c) { fn JsonSerializer^Serializer::serialize_i32(self, v) { let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -445,7 +445,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -479,20 +479,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -502,10 +502,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -515,10 +515,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -526,10 +526,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_serialize_struct.wir.wado b/wado-compiler/tests/fixtures.golden/serde_serialize_struct.wir.wado index 4e31515d2..d9d6f5551 100644 --- a/wado-compiler/tests/fixtures.golden/serde_serialize_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_serialize_struct.wir.wado @@ -83,9 +83,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/User^Serialize::serialize" = fn(ref User, ref JsonSerializer) -> ref null SerializeError; @@ -330,7 +330,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -345,7 +345,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -375,7 +375,7 @@ fn String::append_char(self, c) { fn JsonSerializer^Serializer::serialize_i32(self, v) { let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -386,11 +386,11 @@ fn JsonSerializer^Serializer::serialize_i32(self, v) { fn JsonSerializer^Serializer::serialize_string(self, v) { let __local_2: ref String; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); - String::append(__local_2, v); - String::append_char(__local_2, 34); + String::push(__local_2, 34); + String::push_str(__local_2, v); + String::push(__local_2, 34); break __tmpl: __local_2; }); return ref.null none; @@ -398,16 +398,16 @@ fn JsonSerializer^Serializer::serialize_string(self, v) { fn JsonSerializer^Serializer::serialize_bool(self, v) { if v { - String::append_char(self, 116); - String::append_char(self, 114); - String::append_char(self, 117); - String::append_char(self, 101); + String::push(self, 116); + String::push(self, 114); + String::push(self, 117); + String::push(self, 101); } else { - String::append_char(self, 102); - String::append_char(self, 97); - String::append_char(self, 108); - String::append_char(self, 115); - String::append_char(self, 101); + String::push(self, 102); + String::push(self, 97); + String::push(self, 108); + String::push(self, 115); + String::push(self, 101); }; return ref.null none; } @@ -416,14 +416,14 @@ fn User^Serialize::serialize(self, s) { let st: ref JsonStructSerializer; let __fused_payload_9: ref JsonStructSerializer; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s.buf, 123); + String::push(s.buf, 123); __fused_payload_9 = JsonStructSerializer { ser: s, count: 0 }; st = __fused_payload_9; drop(JsonStructSerializer^SerializeStruct::field(st, String { repr: array.new_data("userName"), used: 8 }, self.name)); drop(JsonStructSerializer^SerializeStruct::field(st, String { repr: array.new_data("age"), used: 3 }, self.age)); drop(JsonStructSerializer^SerializeStruct::field(st, String { repr: array.new_data("active"), used: 6 }, self.active)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null SerializeError { - String::append_char(st.ser.buf, 125); + String::push(st.ser.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -435,14 +435,14 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let __local_3: ref String; let __local_6: ref JsonSerializer; if self.count > 0 { - String::append_char(self.ser.buf, 44); + String::push(self.ser.buf, 44); }; - String::append(self.ser.buf, __tmpl: block -> ref String { + String::push_str(self.ser.buf, __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_3, 34); - String::append(__local_3, name); - String::append_char(__local_3, 34); - String::append_char(__local_3, 58); + String::push(__local_3, 34); + String::push_str(__local_3, name); + String::push(__local_3, 34); + String::push(__local_3, 58); break __tmpl: __local_3; }); drop(__inline_bool_Serialize__serialize_JsonSerializer__1: block -> ref null SerializeError { @@ -457,14 +457,14 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let __local_3: ref String; let __local_6: ref JsonSerializer; if self.count > 0 { - String::append_char(self.ser.buf, 44); + String::push(self.ser.buf, 44); }; - String::append(self.ser.buf, __tmpl: block -> ref String { + String::push_str(self.ser.buf, __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_3, 34); - String::append(__local_3, name); - String::append_char(__local_3, 34); - String::append_char(__local_3, 58); + String::push(__local_3, 34); + String::push_str(__local_3, name); + String::push(__local_3, 34); + String::push(__local_3, 58); break __tmpl: __local_3; }); drop(__inline_i32_Serialize__serialize_JsonSerializer__1: block -> ref null SerializeError { @@ -479,14 +479,14 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let __local_3: ref String; let __local_6: ref JsonSerializer; if self.count > 0 { - String::append_char(self.ser.buf, 44); + String::push(self.ser.buf, 44); }; - String::append(self.ser.buf, __tmpl: block -> ref String { + String::push_str(self.ser.buf, __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_3, 34); - String::append(__local_3, name); - String::append_char(__local_3, 34); - String::append_char(__local_3, 58); + String::push(__local_3, 34); + String::push_str(__local_3, name); + String::push(__local_3, 34); + String::push(__local_3, 58); break __tmpl: __local_3; }); drop(__inline_String_Serialize__serialize_JsonSerializer__1: block -> ref null SerializeError { @@ -508,7 +508,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -542,20 +542,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -565,10 +565,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -578,10 +578,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -589,10 +589,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_serialize_trait.wir.wado b/wado-compiler/tests/fixtures.golden/serde_serialize_trait.wir.wado index 22a090946..b49201ce5 100644 --- a/wado-compiler/tests/fixtures.golden/serde_serialize_trait.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_serialize_trait.wir.wado @@ -72,9 +72,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -118,12 +118,12 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_3, 105); - String::append_char(__local_3, 51); - String::append_char(__local_3, 50); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); - String::append(__local_3, ser.buf); + String::push(__local_3, 105); + String::push(__local_3, 51); + String::push(__local_3, 50); + String::push(__local_3, 58); + String::push(__local_3, 32); + String::push_str(__local_3, ser.buf); break __tmpl: __local_3; }); ser.buf = String { repr: builtin::array_new(0), used: 0 }; @@ -131,15 +131,15 @@ fn run() with Stdout { drop(TextSerializer^Serializer::serialize_string(ser.buf, s)); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 83); - String::append_char(__local_4, 116); - String::append_char(__local_4, 114); - String::append_char(__local_4, 105); - String::append_char(__local_4, 110); - String::append_char(__local_4, 103); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); - String::append(__local_4, ser.buf); + String::push(__local_4, 83); + String::push(__local_4, 116); + String::push(__local_4, 114); + String::push(__local_4, 105); + String::push(__local_4, 110); + String::push(__local_4, 103); + String::push(__local_4, 58); + String::push(__local_4, 32); + String::push_str(__local_4, ser.buf); break __tmpl: __local_4; }); } @@ -339,7 +339,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -354,7 +354,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -384,7 +384,7 @@ fn String::append_char(self, c) { fn TextSerializer^Serializer::serialize_i32(self, v) { let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -395,11 +395,11 @@ fn TextSerializer^Serializer::serialize_i32(self, v) { fn TextSerializer^Serializer::serialize_string(self, v) { let __local_2: ref String; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); - String::append(__local_2, v); - String::append_char(__local_2, 34); + String::push(__local_2, 34); + String::push_str(__local_2, v); + String::push(__local_2, 34); break __tmpl: __local_2; }); return ref.null none; @@ -416,7 +416,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -450,20 +450,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -473,10 +473,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -486,10 +486,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -497,10 +497,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_serialize_variant.wir.wado b/wado-compiler/tests/fixtures.golden/serde_serialize_variant.wir.wado index 5cf6d7366..aaf09be6b 100644 --- a/wado-compiler/tests/fixtures.golden/serde_serialize_variant.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_serialize_variant.wir.wado @@ -128,7 +128,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -136,7 +136,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String::concat" = fn(ref String, ref String) -> ref String; @@ -973,7 +973,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1028,7 +1028,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1060,7 +1060,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1142,25 +1142,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1261,9 +1261,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1317,13 +1317,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1358,9 +1358,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1401,7 +1401,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1433,7 +1433,7 @@ fn String::concat(a, b) { fn JsonSerializer^Serializer::serialize_f64(self, v) { let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(v, __local_3); @@ -1444,18 +1444,18 @@ fn JsonSerializer^Serializer::serialize_f64(self, v) { fn JsonSerializer^Serializer::serialize_unit_variant(self, type_name, variant_name, disc) { let __local_4: ref String; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(18), used: 0 }; - String::append(__local_4, String { repr: array.new_data("\""), used: 1 }); - String::append(__local_4, variant_name); - String::append(__local_4, String { repr: array.new_data("\""), used: 1 }); + String::push_str(__local_4, String { repr: array.new_data("\""), used: 1 }); + String::push_str(__local_4, variant_name); + String::push_str(__local_4, String { repr: array.new_data("\""), used: 1 }); break __tmpl: __local_4; }); return ref.null none; } fn JsonSerializer^Serializer::begin_variant(self, type_name, variant_name, disc) { - String::append(self.buf, String::concat(String::concat(String::concat(String { repr: array.new_data("{\""), used: 2 }, variant_name), String { repr: array.new_data("\""), used: 1 }), String { repr: array.new_data(":"), used: 1 })); + String::push_str(self.buf, String::concat(String::concat(String::concat(String { repr: array.new_data("{\""), used: 2 }, variant_name), String { repr: array.new_data("\""), used: 1 }), String { repr: array.new_data(":"), used: 1 })); return Result::Ok { discriminant: 0, payload_0: JsonVariantSerializer { ser: self } }; } @@ -1474,7 +1474,7 @@ fn Shape^Serialize::serialize(self, s) { break __inline_f64_Serialize__serialize_JsonSerializer__1: JsonSerializer^Serializer::serialize_f64(__local_9.buf, __cast_1.payload_0); }); return __inline_JsonVariantSerializer_SerializeVariant__end_2: block -> ref null SerializeError { - String::append(__local_4.ser.buf, String { repr: array.new_data("}"), used: 1 }); + String::push_str(__local_4.ser.buf, String { repr: array.new_data("}"), used: 1 }); break __inline_JsonVariantSerializer_SerializeVariant__end_2: ref.null none; }; }; diff --git a/wado-compiler/tests/fixtures.golden/serde_sub_serializer.wir.wado b/wado-compiler/tests/fixtures.golden/serde_sub_serializer.wir.wado index 75b320b22..2c2337279 100644 --- a/wado-compiler/tests/fixtures.golden/serde_sub_serializer.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_sub_serializer.wir.wado @@ -82,9 +82,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/TextStructSerializer^SerializeStruct::field" = fn(ref TextStructSerializer, ref String, ref String) -> ref null SerializeError; @@ -135,54 +135,54 @@ fn run() with Stdout { ser = TextSerializer { buf: String { repr: builtin::array_new(0), used: 0 } }; __fused___inline_TextSerializer_Serializer__begin_seq_2: block { self_15 = ser; - String::append_char(self_15.buf, 91); + String::push(self_15.buf, 91); __fused_payload_24 = TextSeqSerializer { parent: self_15, count: 0 }; s_2 = __fused_payload_24; drop(TextSeqSerializer^SerializeSeq::element(s_2, 1)); drop(TextSeqSerializer^SerializeSeq::element(s_2, 2)); drop(TextSeqSerializer^SerializeSeq::element(s_2, 3)); drop(__inline_TextSeqSerializer_SerializeSeq__end_3: block -> ref null SerializeError { - String::append_char(s_2.parent.buf, 93); + String::push(s_2.parent.buf, 93); break __inline_TextSeqSerializer_SerializeSeq__end_3: ref.null none; }); break __fused___inline_TextSerializer_Serializer__begin_seq_2; }; "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_10, 115); - String::append_char(__local_10, 101); - String::append_char(__local_10, 113); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); - String::append(__local_10, ser.buf); + String::push(__local_10, 115); + String::push(__local_10, 101); + String::push(__local_10, 113); + String::push(__local_10, 58); + String::push(__local_10, 32); + String::push_str(__local_10, ser.buf); break __tmpl: __local_10; }); ser.buf = String { repr: builtin::array_new(0), used: 0 }; __fused___inline_TextSerializer_Serializer__begin_struct_5: block { self_19 = ser; - String::append_char(self_19.buf, 123); + String::push(self_19.buf, 123); __fused_payload_25 = TextStructSerializer { parent: self_19, count: 0 }; s_7 = __fused_payload_25; name_8 = String { repr: array.new_data("Alice"), used: 5 }; drop(TextStructSerializer^SerializeStruct::field(s_7, String { repr: array.new_data("name"), used: 4 }, name_8)); drop(TextStructSerializer^SerializeStruct::field(s_7, String { repr: array.new_data("age"), used: 3 }, 30)); drop(__inline_TextStructSerializer_SerializeStruct__end_6: block -> ref null SerializeError { - String::append_char(s_7.parent.buf, 125); + String::push(s_7.parent.buf, 125); break __inline_TextStructSerializer_SerializeStruct__end_6: ref.null none; }); break __fused___inline_TextSerializer_Serializer__begin_struct_5; }; "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_11, 115); - String::append_char(__local_11, 116); - String::append_char(__local_11, 114); - String::append_char(__local_11, 117); - String::append_char(__local_11, 99); - String::append_char(__local_11, 116); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); - String::append(__local_11, ser.buf); + String::push(__local_11, 115); + String::push(__local_11, 116); + String::push(__local_11, 114); + String::push(__local_11, 117); + String::push(__local_11, 99); + String::push(__local_11, 116); + String::push(__local_11, 58); + String::push(__local_11, 32); + String::push_str(__local_11, ser.buf); break __tmpl: __local_11; }); } @@ -382,7 +382,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -397,7 +397,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -427,7 +427,7 @@ fn String::append_char(self, c) { fn TextSerializer^Serializer::serialize_i32(self, v) { let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -438,11 +438,11 @@ fn TextSerializer^Serializer::serialize_i32(self, v) { fn TextSerializer^Serializer::serialize_string(self, v) { let __local_2: ref String; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 34); - String::append(__local_2, v); - String::append_char(__local_2, 34); + String::push(__local_2, 34); + String::push_str(__local_2, v); + String::push(__local_2, 34); break __tmpl: __local_2; }); return ref.null none; @@ -452,14 +452,14 @@ fn TextStructSerializer^SerializeStruct::field(self, name, value) { let __local_3: ref String; let __local_6: ref TextSerializer; if self.count > 0 { - String::append_char(self.parent.buf, 44); + String::push(self.parent.buf, 44); }; - String::append(self.parent.buf, __tmpl: block -> ref String { + String::push_str(self.parent.buf, __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_3, 34); - String::append(__local_3, name); - String::append_char(__local_3, 34); - String::append_char(__local_3, 58); + String::push(__local_3, 34); + String::push_str(__local_3, name); + String::push(__local_3, 34); + String::push(__local_3, 58); break __tmpl: __local_3; }); drop(__inline_i32_Serialize__serialize_TextSerializer__1: block -> ref null SerializeError { @@ -474,14 +474,14 @@ fn TextStructSerializer^SerializeStruct::field(self, name, value) { let __local_3: ref String; let __local_6: ref TextSerializer; if self.count > 0 { - String::append_char(self.parent.buf, 44); + String::push(self.parent.buf, 44); }; - String::append(self.parent.buf, __tmpl: block -> ref String { + String::push_str(self.parent.buf, __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_3, 34); - String::append(__local_3, name); - String::append_char(__local_3, 34); - String::append_char(__local_3, 58); + String::push(__local_3, 34); + String::push_str(__local_3, name); + String::push(__local_3, 34); + String::push(__local_3, 58); break __tmpl: __local_3; }); drop(__inline_String_Serialize__serialize_TextSerializer__1: block -> ref null SerializeError { @@ -495,7 +495,7 @@ fn TextStructSerializer^SerializeStruct::field(self, name, value) { fn TextSeqSerializer^SerializeSeq::element(self, value) { let __local_3: ref TextSerializer; if self.count > 0 { - String::append_char(self.parent.buf, 44); + String::push(self.parent.buf, 44); }; drop(__inline_i32_Serialize__serialize_TextSerializer__0: block -> ref null SerializeError { __local_3 = self.parent; @@ -516,7 +516,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -550,20 +550,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -573,10 +573,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -586,10 +586,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -597,10 +597,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/serde_synth.wir.wado b/wado-compiler/tests/fixtures.golden/serde_synth.wir.wado index 720391646..aa514460e 100644 --- a/wado-compiler/tests/fixtures.golden/serde_synth.wir.wado +++ b/wado-compiler/tests/fixtures.golden/serde_synth.wir.wado @@ -281,7 +281,7 @@ type "functype/core:json/utf8_sequence_length" = fn(i32) -> i32; type "functype/core:json/write_escaped_string" = fn(ref String, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -293,13 +293,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/JsonStructSerializer^SerializeStruct::field" = fn(ref "core:json/JsonStructSerializer", ref String, ref String) -> ref null "core:serde/SerializeError"; @@ -463,29 +463,29 @@ fn __test_0_synthesized_deserialize_point() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_0_synthesized_deserialize_point"), used: 38 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_0_synthesized_deserialize_point"), used: 38 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_14 = __local_7; i32::fmt_decimal(17, __local_14); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: p.x == 1.5 "), used: 23 }); - String::append_char(__local_6, 112); - String::append_char(__local_6, 46); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 112); + String::push(__local_6, 46); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_19 = __local_7; f64::inspect_into(__v0_2, __local_19); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -495,29 +495,29 @@ condition: p.x == 1.5 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_0_synthesized_deserialize_point"), used: 38 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_0_synthesized_deserialize_point"), used: 38 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_23 = __local_9; i32::fmt_decimal(18, __local_23); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p.y == 2.5 "), used: 23 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 46); - String::append_char(__local_8, 121); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 46); + String::push(__local_8, 121); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_28 = __local_9; f64::inspect_into(__v0_4, __local_28); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -560,29 +560,29 @@ fn __test_1_synthesized_deserialize_point_out_of_order_fields() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_1_synthesized_deserialize_point_out_of_order_fields"), used: 58 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_1_synthesized_deserialize_point_out_of_order_fields"), used: 58 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_14 = __local_7; i32::fmt_decimal(27, __local_14); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: p.x == 7.0 "), used: 23 }); - String::append_char(__local_6, 112); - String::append_char(__local_6, 46); - String::append_char(__local_6, 120); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 112); + String::push(__local_6, 46); + String::push(__local_6, 120); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_19 = __local_7; f64::inspect_into(__v0_2, __local_19); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -592,29 +592,29 @@ condition: p.x == 7.0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_1_synthesized_deserialize_point_out_of_order_fields"), used: 58 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_1_synthesized_deserialize_point_out_of_order_fields"), used: 58 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_23 = __local_9; i32::fmt_decimal(28, __local_23); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: p.y == 3.0 "), used: 23 }); - String::append_char(__local_8, 112); - String::append_char(__local_8, 46); - String::append_char(__local_8, 121); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 112); + String::push(__local_8, 46); + String::push(__local_8, 121); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_28 = __local_9; f64::inspect_into(__v0_4, __local_28); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -662,24 +662,24 @@ fn __test_2_synthesized_deserialize_user_with_camelcase_keys() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_2_synthesized_deserialize_user_with_camelcase_keys"), used: 57 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_2_synthesized_deserialize_user_with_camelcase_keys"), used: 57 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_18 = __local_9; i32::fmt_decimal(45, __local_18); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: u.user_name == \"Alice\" "), used: 35 }); - String::append(__local_8, String { repr: array.new_data("u.user_name: "), used: 13 }); + String::push_str(__local_8, String { repr: array.new_data("u.user_name: "), used: 13 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0_2, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -689,31 +689,31 @@ condition: u.user_name == \"Alice\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_2_synthesized_deserialize_user_with_camelcase_keys"), used: 57 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_2_synthesized_deserialize_user_with_camelcase_keys"), used: 57 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_25 = __local_11; i32::fmt_decimal(46, __local_25); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: u.age == 30 "), used: 24 }); - String::append_char(__local_10, 117); - String::append_char(__local_10, 46); - String::append_char(__local_10, 97); - String::append_char(__local_10, 103); - String::append_char(__local_10, 101); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 117); + String::push(__local_10, 46); + String::push(__local_10, 97); + String::push(__local_10, 103); + String::push(__local_10, 101); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_30 = __local_11; i32::fmt_decimal(__v0_4, __local_30); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -723,21 +723,21 @@ condition: u.age == 30 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_2_synthesized_deserialize_user_with_camelcase_keys"), used: 57 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_2_synthesized_deserialize_user_with_camelcase_keys"), used: 57 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_36 = __local_13; i32::fmt_decimal(47, __local_36); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: u.active == true "), used: 29 }); - String::append(__local_12, String { repr: array.new_data("u.active: "), used: 10 }); + String::push_str(__local_12, String { repr: array.new_data("u.active: "), used: 10 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_41 = __local_13; Formatter::pad(__local_41, if __v0_6 -> ref String { @@ -745,7 +745,7 @@ condition: u.active == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -801,29 +801,29 @@ fn __test_3_roundtrip_config() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(166), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_3_roundtrip_config"), used: 25 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_3_roundtrip_config"), used: 25 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_26 = __local_14; i32::fmt_decimal(69, __local_26); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: json == `\\{\"host\":\"localhost\",\"port\":8080,\"debug\":true\\}` "), used: 70 }); - String::append_char(__local_13, 106); - String::append_char(__local_13, 115); - String::append_char(__local_13, 111); - String::append_char(__local_13, 110); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 106); + String::push(__local_13, 115); + String::push(__local_13, 111); + String::push(__local_13, 110); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; String^Inspect::inspect(__v0_3, __local_14); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -839,24 +839,24 @@ condition: json == `\\{\"host\":\"localhost\",\"port\":8080,\"debug\":true\\}` if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_3_roundtrip_config"), used: 25 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_3_roundtrip_config"), used: 25 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_33 = __local_16; i32::fmt_decimal(72, __local_33); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: parsed.host == \"localhost\" "), used: 39 }); - String::append(__local_15, String { repr: array.new_data("parsed.host: "), used: 13 }); + String::push_str(__local_15, String { repr: array.new_data("parsed.host: "), used: 13 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; String^Inspect::inspect(__v0_7, __local_16); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -866,25 +866,25 @@ condition: parsed.host == \"localhost\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_3_roundtrip_config"), used: 25 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_3_roundtrip_config"), used: 25 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_40 = __local_18; i32::fmt_decimal(73, __local_40); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: parsed.port == 8080 "), used: 32 }); - String::append(__local_17, String { repr: array.new_data("parsed.port: "), used: 13 }); + String::push_str(__local_17, String { repr: array.new_data("parsed.port: "), used: 13 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_45 = __local_18; i32::fmt_decimal(__v0_9, __local_45); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -894,21 +894,21 @@ condition: parsed.port == 8080 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(137), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_3_roundtrip_config"), used: 25 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_3_roundtrip_config"), used: 25 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_51 = __local_20; i32::fmt_decimal(74, __local_51); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: parsed.debug == true "), used: 33 }); - String::append(__local_19, String { repr: array.new_data("parsed.debug: "), used: 14 }); + String::push_str(__local_19, String { repr: array.new_data("parsed.debug: "), used: 14 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_56 = __local_20; Formatter::pad(__local_56, if __v0_11 -> ref String { @@ -916,7 +916,7 @@ condition: parsed.debug == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -958,26 +958,26 @@ fn __test_4_synthesized_serialize_point() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_4_synthesized_serialize_point"), used: 36 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_4_synthesized_serialize_point"), used: 36 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(97, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"x\":1.5,\"y\":2.5\\}` "), used: 39 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1015,26 +1015,26 @@ fn __test_5_synthesized_serialize_user_with_snake_case____camelcase() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_5_synthesized_serialize_user_with_snake_case____camelcase"), used: 64 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_5_synthesized_serialize_user_with_snake_case____camelcase"), used: 64 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/serde_synth.wado"), used: 45 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(115, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == `\\{\"userName\":\"Alice\",\"age\":30,\"active\":true\\}` "), used: 65 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -2103,8 +2103,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2159,13 +2159,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -2173,25 +2173,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -2199,7 +2199,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -2241,8 +2241,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2274,7 +2274,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -2453,22 +2453,22 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } @@ -2499,7 +2499,7 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json let code: i32; let hi: i32; let lo: i32; - String::append_char(buf, 34); + String::push(buf, 34); __iter_2 = StrCharIter { repr: s.repr, used: s.used, byte_index: 0 }; b208: block { l209: loop { @@ -2509,32 +2509,32 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(buf, 92); - String::append_char(buf, 34); + String::push(buf, 92); + String::push(buf, 34); } else if c == 92 { - String::append_char(buf, 92); - String::append_char(buf, 92); + String::push(buf, 92); + String::push(buf, 92); } else if c == 10 { - String::append_char(buf, 92); - String::append_char(buf, 110); + String::push(buf, 92); + String::push(buf, 110); } else if c == 13 { - String::append_char(buf, 92); - String::append_char(buf, 114); + String::push(buf, 92); + String::push(buf, 114); } else if c == 9 { - String::append_char(buf, 92); - String::append_char(buf, 116); + String::push(buf, 92); + String::push(buf, 116); } else if c > 4) & 15; lo = code & 15; - String::append_char(buf, "core:json/hex_digit"(hi)); - String::append_char(buf, "core:json/hex_digit"(lo)); + String::push(buf, "core:json/hex_digit"(hi)); + String::push(buf, "core:json/hex_digit"(lo)); } else { - String::append_char(buf, c); + String::push(buf, c); }; } else { break b208; @@ -2542,10 +2542,10 @@ fn "core:json/write_escaped_string"(buf, s) { // from core:json continue l209; }; }; - String::append_char(buf, 34); + String::push(buf, 34); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2680,9 +2680,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -2749,9 +2749,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2761,8 +2761,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2817,13 +2817,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2858,9 +2858,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2871,10 +2871,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -2930,7 +2930,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -3018,7 +3018,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -3048,13 +3048,13 @@ fn String::append_char(self, c) { fn User^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("userName"), used: 8 }, self.user_name)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("age"), used: 3 }, self.age)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("active"), used: 6 }, self.active)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -3065,10 +3065,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_bool"(ser.buf, value); self.buf = ser.buf; @@ -3080,10 +3080,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_i32"(ser.buf, value); self.buf = ser.buf; @@ -3095,10 +3095,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = __inline_JsonSerializer_Serializer__serialize_string_1: block -> ref null "core:serde/SerializeError" { "core:json/write_escaped_string"(ser.buf, value); @@ -3112,12 +3112,12 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { fn Point^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("x"), used: 1 }, self.x)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("y"), used: 1 }, self.y)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -3128,10 +3128,10 @@ fn JsonStructSerializer^SerializeStruct::field(self, name, value) { let ser: ref "core:json/JsonSerializer"; let r: ref null "core:serde/SerializeError"; if self.count > 0 { - String::append_char(self.buf, 44); + String::push(self.buf, 44); }; "core:json/write_escaped_string"(self.buf, name); - String::append_char(self.buf, 58); + String::push(self.buf, 58); ser = "core:json/JsonSerializer" { buf: self.buf }; r = "core:json/JsonSerializer^Serializer::serialize_f64"(ser.buf, value); self.buf = ser.buf; @@ -3243,13 +3243,13 @@ fn Config^Deserialize::deserialize(d) { fn Config^Serialize::serialize(self, s) { let __fused_payload_9: ref "core:json/JsonStructSerializer"; __fused___inline_JsonSerializer_Serializer__begin_struct_0: block { - String::append_char(s, 123); + String::push(s, 123); __fused_payload_9 = "core:json/JsonStructSerializer" { buf: s, count: 0 }; drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("host"), used: 4 }, self.host)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("port"), used: 4 }, self.port)); drop(JsonStructSerializer^SerializeStruct::field(__fused_payload_9, String { repr: array.new_data("debug"), used: 5 }, self.debug)); return __inline_JsonStructSerializer_SerializeStruct__end_1: block -> ref null "core:serde/SerializeError" { - String::append_char(__fused_payload_9.buf, 125); + String::push(__fused_payload_9.buf, 125); break __inline_JsonStructSerializer_SerializeStruct__end_1: ref.null none; }; break __fused___inline_JsonSerializer_Serializer__begin_struct_0; @@ -3454,7 +3454,7 @@ fn __Closure_2::__call(self, __input, __start, __end) { fn "core:json/JsonSerializer^Serializer::serialize_i32"(self, v) { // from core:json let __local_2: ref String; let __local_3: ref Formatter; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(v, __local_3); @@ -3480,7 +3480,7 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core } == 0 { return "core:serde/SerializeError" { kind: 0, message: String { repr: array.new_data("Infinity is not allowed in JSON"), used: 31 } }; }; - String::append(self, __tmpl: block -> ref String { + String::push_str(self, __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(16), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(v, __local_3); @@ -3491,16 +3491,16 @@ fn "core:json/JsonSerializer^Serializer::serialize_f64"(self, v) { // from core fn "core:json/JsonSerializer^Serializer::serialize_bool"(self, v) { // from core:json if v { - String::append_char(self, 116); - String::append_char(self, 114); - String::append_char(self, 117); - String::append_char(self, 101); + String::push(self, 116); + String::push(self, 114); + String::push(self, 117); + String::push(self, 101); } else { - String::append_char(self, 102); - String::append_char(self, 97); - String::append_char(self, 108); - String::append_char(self, 115); - String::append_char(self, 101); + String::push(self, 102); + String::push(self, 97); + String::push(self, 108); + String::push(self, 115); + String::push(self, 101); }; return ref.null none; } @@ -3580,13 +3580,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -3652,9 +3652,9 @@ fn "core:json/JsonDeserializer::expect_literal"(self, lit) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_7: block -> ref "core:serde/DeserializeError" { __local_16 = __tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_5, String { repr: array.new_data("expected '"), used: 10 }); - String::append(__local_5, lit); - String::append_char(__local_5, 39); + String::push_str(__local_5, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_5, lit); + String::push(__local_5, 39); self.pos = _hfs_pos_27; break __tmpl: __local_5; }; @@ -3914,21 +3914,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -3938,7 +3938,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -3950,10 +3950,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return Result::Err { discriminant: 1, payload_0: ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -3978,7 +3978,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }) }; }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -3993,7 +3993,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -4015,7 +4015,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -4043,7 +4043,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -5186,10 +5186,10 @@ fn "core:json/JsonDeserializer::skip_value"(self) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_20: block -> ref "core:serde/DeserializeError" { __local_47 = __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); + String::push_str(__local_12, String { repr: array.new_data("unexpected character '"), used: 22 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; char^Display::fmt(b & 255, __local_13); - String::append_char(__local_12, 39); + String::push(__local_12, 39); break __tmpl: __local_12; }; __local_48 = builtin::i64_extend_i32_s(self.pos); @@ -5417,7 +5417,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l538; }; @@ -5437,7 +5437,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -5445,17 +5445,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -5609,20 +5609,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -5632,10 +5632,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -5645,10 +5645,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -5656,10 +5656,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -5671,7 +5671,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -5688,22 +5688,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b577; @@ -5711,7 +5711,7 @@ fn String^Inspect::inspect(self, f) { continue l578; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } fn "closure/wado-compiler/tests/fixtures/serde_synth.wado/__closure_wrapper_0"(__env, __p0, __p1, __p2) { diff --git a/wado-compiler/tests/fixtures.golden/short_circuit.wir.wado b/wado-compiler/tests/fixtures.golden/short_circuit.wir.wado index d999f0427..db41b9b6f 100644 --- a/wado-compiler/tests/fixtures.golden/short_circuit.wir.wado +++ b/wado-compiler/tests/fixtures.golden/short_circuit.wir.wado @@ -79,11 +79,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -145,8 +145,8 @@ fn run() with Stdout { __local_10 = String { repr: array.new_data("should not print (&&)"), used: 21 }; "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_12, String { repr: array.new_data("side_effect called: "), used: 20 }); - String::append(__local_12, __local_10); + String::push_str(__local_12, String { repr: array.new_data("side_effect called: "), used: 20 }); + String::push_str(__local_12, __local_10); break __tmpl: __local_12; }); break __inline_side_effect_2: 1; @@ -163,8 +163,8 @@ fn run() with Stdout { __local_13 = String { repr: array.new_data("should print (&&)"), used: 17 }; "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_15, String { repr: array.new_data("side_effect called: "), used: 20 }); - String::append(__local_15, __local_13); + String::push_str(__local_15, String { repr: array.new_data("side_effect called: "), used: 20 }); + String::push_str(__local_15, __local_13); break __tmpl: __local_15; }); break __inline_side_effect_3: 1; @@ -183,8 +183,8 @@ fn run() with Stdout { __local_16 = String { repr: array.new_data("should not print (||)"), used: 21 }; "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_18, String { repr: array.new_data("side_effect called: "), used: 20 }); - String::append(__local_18, __local_16); + String::push_str(__local_18, String { repr: array.new_data("side_effect called: "), used: 20 }); + String::push_str(__local_18, __local_16); break __tmpl: __local_18; }); break __inline_side_effect_4: 0; @@ -199,8 +199,8 @@ fn run() with Stdout { __local_19 = String { repr: array.new_data("should print (||)"), used: 17 }; "core:cli/println"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_21, String { repr: array.new_data("side_effect called: "), used: 20 }); - String::append(__local_21, __local_19); + String::push_str(__local_21, String { repr: array.new_data("side_effect called: "), used: 20 }); + String::push_str(__local_21, __local_19); break __tmpl: __local_21; }); break __inline_side_effect_5: 1; @@ -235,17 +235,17 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(40), used: 0 }; - String::append_char(__local_5, 97); - String::append_char(__local_5, 114); - String::append_char(__local_5, 114); - String::append_char(__local_5, 91); + String::push(__local_5, 97); + String::push(__local_5, 114); + String::push(__local_5, 114); + String::push(__local_5, 91); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_37 = __local_6; i32::fmt_decimal(i, __local_37); - String::append_char(__local_5, 93); - String::append_char(__local_5, 32); - String::append_char(__local_5, 61); - String::append_char(__local_5, 32); + String::push(__local_5, 93); + String::push(__local_5, 32); + String::push(__local_5, 61); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_42 = __local_6; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_20: block -> i32 { @@ -264,7 +264,7 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Loop ended at i = "), used: 18 }); + String::push_str(__local_7, String { repr: array.new_data("Loop ended at i = "), used: 18 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(i, __local_8); break __tmpl: __local_7; @@ -278,8 +278,8 @@ fn run() with Stdout { __local_53 = String { repr: array.new_data("nested: should print"), used: 20 }; "core:cli/println"(__tmpl: block -> ref String { __local_55 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_55, String { repr: array.new_data("side_effect called: "), used: 20 }); - String::append(__local_55, __local_53); + String::push_str(__local_55, String { repr: array.new_data("side_effect called: "), used: 20 }); + String::push_str(__local_55, __local_53); break __tmpl: __local_55; }); break __inline_side_effect_26: 1; @@ -295,8 +295,8 @@ fn run() with Stdout { __local_56 = String { repr: array.new_data("nested: should not print"), used: 24 }; "core:cli/println"(__tmpl: block -> ref String { __local_58 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_58, String { repr: array.new_data("side_effect called: "), used: 20 }); - String::append(__local_58, __local_56); + String::push_str(__local_58, String { repr: array.new_data("side_effect called: "), used: 20 }); + String::push_str(__local_58, __local_56); break __tmpl: __local_58; }); break __inline_side_effect_27: 1; @@ -543,7 +543,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -558,7 +558,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -585,7 +585,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -638,7 +638,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l47; }; @@ -672,20 +672,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -695,10 +695,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -708,10 +708,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -719,10 +719,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/simd_basic.wir.wado b/wado-compiler/tests/fixtures.golden/simd_basic.wir.wado index a8833b813..4e4fceda8 100644 --- a/wado-compiler/tests/fixtures.golden/simd_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/simd_basic.wir.wado @@ -97,7 +97,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -107,9 +107,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -299,27 +299,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_59 = String { repr: builtin::array_new(177), used: 0 }; - String::append(__local_59, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_59, 114); - String::append_char(__local_59, 117); - String::append_char(__local_59, 110); - String::append_char(__local_59, 32); - String::append_char(__local_59, 97); - String::append_char(__local_59, 116); - String::append_char(__local_59, 32); - String::append(__local_59, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_59, 58); + String::push_str(__local_59, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_59, 114); + String::push(__local_59, 117); + String::push(__local_59, 110); + String::push(__local_59, 32); + String::push(__local_59, 97); + String::push(__local_59, 116); + String::push(__local_59, 32); + String::push_str(__local_59, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_59, 58); __local_60 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_59 }; __local_92 = __local_60; i32::fmt_decimal(7, __local_92); - String::append(__local_59, String { repr: array.new_data(" + String::push_str(__local_59, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(0, a) == 10 "), used: 52 }); - String::append(__local_59, String { repr: array.new_data("builtin::i32x4_extract_lane(0, a): "), used: 35 }); + String::push_str(__local_59, String { repr: array.new_data("builtin::i32x4_extract_lane(0, a): "), used: 35 }); __local_60 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_59 }; __local_97 = __local_60; i32::fmt_decimal(__v0_2, __local_97); - String::append_char(__local_59, 10); + String::push(__local_59, 10); break __tmpl: __local_59; }); unreachable; @@ -329,27 +329,27 @@ condition: builtin::i32x4_extract_lane(0, a) == 10 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_61 = String { repr: builtin::array_new(177), used: 0 }; - String::append(__local_61, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_61, 114); - String::append_char(__local_61, 117); - String::append_char(__local_61, 110); - String::append_char(__local_61, 32); - String::append_char(__local_61, 97); - String::append_char(__local_61, 116); - String::append_char(__local_61, 32); - String::append(__local_61, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_61, 58); + String::push_str(__local_61, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_61, 114); + String::push(__local_61, 117); + String::push(__local_61, 110); + String::push(__local_61, 32); + String::push(__local_61, 97); + String::push(__local_61, 116); + String::push(__local_61, 32); + String::push_str(__local_61, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_61, 58); __local_62 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_61 }; __local_103 = __local_62; i32::fmt_decimal(8, __local_103); - String::append(__local_61, String { repr: array.new_data(" + String::push_str(__local_61, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(3, b) == 20 "), used: 52 }); - String::append(__local_61, String { repr: array.new_data("builtin::i32x4_extract_lane(3, b): "), used: 35 }); + String::push_str(__local_61, String { repr: array.new_data("builtin::i32x4_extract_lane(3, b): "), used: 35 }); __local_62 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_61 }; __local_108 = __local_62; i32::fmt_decimal(__v0_4, __local_108); - String::append_char(__local_61, 10); + String::push(__local_61, 10); break __tmpl: __local_61; }); unreachable; @@ -360,27 +360,27 @@ condition: builtin::i32x4_extract_lane(3, b) == 20 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_63 = String { repr: builtin::array_new(181), used: 0 }; - String::append(__local_63, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_63, 114); - String::append_char(__local_63, 117); - String::append_char(__local_63, 110); - String::append_char(__local_63, 32); - String::append_char(__local_63, 97); - String::append_char(__local_63, 116); - String::append_char(__local_63, 32); - String::append(__local_63, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_63, 58); + String::push_str(__local_63, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_63, 114); + String::push(__local_63, 117); + String::push(__local_63, 110); + String::push(__local_63, 32); + String::push(__local_63, 97); + String::push(__local_63, 116); + String::push(__local_63, 32); + String::push_str(__local_63, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_63, 58); __local_64 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_63 }; __local_114 = __local_64; i32::fmt_decimal(12, __local_114); - String::append(__local_63, String { repr: array.new_data(" + String::push_str(__local_63, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(0, sum) == 30 "), used: 54 }); - String::append(__local_63, String { repr: array.new_data("builtin::i32x4_extract_lane(0, sum): "), used: 37 }); + String::push_str(__local_63, String { repr: array.new_data("builtin::i32x4_extract_lane(0, sum): "), used: 37 }); __local_64 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_63 }; __local_119 = __local_64; i32::fmt_decimal(__v0_7, __local_119); - String::append_char(__local_63, 10); + String::push(__local_63, 10); break __tmpl: __local_63; }); unreachable; @@ -390,27 +390,27 @@ condition: builtin::i32x4_extract_lane(0, sum) == 30 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_65 = String { repr: builtin::array_new(181), used: 0 }; - String::append(__local_65, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_65, 114); - String::append_char(__local_65, 117); - String::append_char(__local_65, 110); - String::append_char(__local_65, 32); - String::append_char(__local_65, 97); - String::append_char(__local_65, 116); - String::append_char(__local_65, 32); - String::append(__local_65, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_65, 58); + String::push_str(__local_65, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_65, 114); + String::push(__local_65, 117); + String::push(__local_65, 110); + String::push(__local_65, 32); + String::push(__local_65, 97); + String::push(__local_65, 116); + String::push(__local_65, 32); + String::push_str(__local_65, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_65, 58); __local_66 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_65 }; __local_125 = __local_66; i32::fmt_decimal(13, __local_125); - String::append(__local_65, String { repr: array.new_data(" + String::push_str(__local_65, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(3, sum) == 30 "), used: 54 }); - String::append(__local_65, String { repr: array.new_data("builtin::i32x4_extract_lane(3, sum): "), used: 37 }); + String::push_str(__local_65, String { repr: array.new_data("builtin::i32x4_extract_lane(3, sum): "), used: 37 }); __local_66 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_65 }; __local_130 = __local_66; i32::fmt_decimal(__v0_9, __local_130); - String::append_char(__local_65, 10); + String::push(__local_65, 10); break __tmpl: __local_65; }); unreachable; @@ -421,27 +421,27 @@ condition: builtin::i32x4_extract_lane(3, sum) == 30 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_67 = String { repr: builtin::array_new(183), used: 0 }; - String::append(__local_67, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_67, 114); - String::append_char(__local_67, 117); - String::append_char(__local_67, 110); - String::append_char(__local_67, 32); - String::append_char(__local_67, 97); - String::append_char(__local_67, 116); - String::append_char(__local_67, 32); - String::append(__local_67, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_67, 58); + String::push_str(__local_67, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_67, 114); + String::push(__local_67, 117); + String::push(__local_67, 110); + String::push(__local_67, 32); + String::push(__local_67, 97); + String::push(__local_67, 116); + String::push(__local_67, 32); + String::push_str(__local_67, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_67, 58); __local_68 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_67 }; __local_136 = __local_68; i32::fmt_decimal(16, __local_136); - String::append(__local_67, String { repr: array.new_data(" + String::push_str(__local_67, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(0, diff) == 10 "), used: 55 }); - String::append(__local_67, String { repr: array.new_data("builtin::i32x4_extract_lane(0, diff): "), used: 38 }); + String::push_str(__local_67, String { repr: array.new_data("builtin::i32x4_extract_lane(0, diff): "), used: 38 }); __local_68 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_67 }; __local_141 = __local_68; i32::fmt_decimal(__v0_12, __local_141); - String::append_char(__local_67, 10); + String::push(__local_67, 10); break __tmpl: __local_67; }); unreachable; @@ -452,27 +452,27 @@ condition: builtin::i32x4_extract_lane(0, diff) == 10 if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_69 = String { repr: builtin::array_new(184), used: 0 }; - String::append(__local_69, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_69, 114); - String::append_char(__local_69, 117); - String::append_char(__local_69, 110); - String::append_char(__local_69, 32); - String::append_char(__local_69, 97); - String::append_char(__local_69, 116); - String::append_char(__local_69, 32); - String::append(__local_69, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_69, 58); + String::push_str(__local_69, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_69, 114); + String::push(__local_69, 117); + String::push(__local_69, 110); + String::push(__local_69, 32); + String::push(__local_69, 97); + String::push(__local_69, 116); + String::push(__local_69, 32); + String::push_str(__local_69, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_69, 58); __local_70 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_69 }; __local_147 = __local_70; i32::fmt_decimal(19, __local_147); - String::append(__local_69, String { repr: array.new_data(" + String::push_str(__local_69, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(0, prod) == 200 "), used: 56 }); - String::append(__local_69, String { repr: array.new_data("builtin::i32x4_extract_lane(0, prod): "), used: 38 }); + String::push_str(__local_69, String { repr: array.new_data("builtin::i32x4_extract_lane(0, prod): "), used: 38 }); __local_70 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_69 }; __local_152 = __local_70; i32::fmt_decimal(__v0_15, __local_152); - String::append_char(__local_69, 10); + String::push(__local_69, 10); break __tmpl: __local_69; }); unreachable; @@ -483,27 +483,27 @@ condition: builtin::i32x4_extract_lane(0, prod) == 200 if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_71 = String { repr: builtin::array_new(177), used: 0 }; - String::append(__local_71, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_71, 114); - String::append_char(__local_71, 117); - String::append_char(__local_71, 110); - String::append_char(__local_71, 32); - String::append_char(__local_71, 97); - String::append_char(__local_71, 116); - String::append_char(__local_71, 32); - String::append(__local_71, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_71, 58); + String::push_str(__local_71, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_71, 114); + String::push(__local_71, 117); + String::push(__local_71, 110); + String::push(__local_71, 32); + String::push(__local_71, 97); + String::push(__local_71, 116); + String::push(__local_71, 32); + String::push_str(__local_71, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_71, 58); __local_72 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_71 }; __local_158 = __local_72; i32::fmt_decimal(23, __local_158); - String::append(__local_71, String { repr: array.new_data(" + String::push_str(__local_71, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(0, c) == 10 "), used: 52 }); - String::append(__local_71, String { repr: array.new_data("builtin::i32x4_extract_lane(0, c): "), used: 35 }); + String::push_str(__local_71, String { repr: array.new_data("builtin::i32x4_extract_lane(0, c): "), used: 35 }); __local_72 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_71 }; __local_163 = __local_72; i32::fmt_decimal(__v0_18, __local_163); - String::append_char(__local_71, 10); + String::push(__local_71, 10); break __tmpl: __local_71; }); unreachable; @@ -513,27 +513,27 @@ condition: builtin::i32x4_extract_lane(0, c) == 10 if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_73 = String { repr: builtin::array_new(177), used: 0 }; - String::append(__local_73, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_73, 114); - String::append_char(__local_73, 117); - String::append_char(__local_73, 110); - String::append_char(__local_73, 32); - String::append_char(__local_73, 97); - String::append_char(__local_73, 116); - String::append_char(__local_73, 32); - String::append(__local_73, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_73, 58); + String::push_str(__local_73, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_73, 114); + String::push(__local_73, 117); + String::push(__local_73, 110); + String::push(__local_73, 32); + String::push(__local_73, 97); + String::push(__local_73, 116); + String::push(__local_73, 32); + String::push_str(__local_73, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_73, 58); __local_74 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_73 }; __local_169 = __local_74; i32::fmt_decimal(24, __local_169); - String::append(__local_73, String { repr: array.new_data(" + String::push_str(__local_73, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(2, c) == 99 "), used: 52 }); - String::append(__local_73, String { repr: array.new_data("builtin::i32x4_extract_lane(2, c): "), used: 35 }); + String::push_str(__local_73, String { repr: array.new_data("builtin::i32x4_extract_lane(2, c): "), used: 35 }); __local_74 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_73 }; __local_174 = __local_74; i32::fmt_decimal(__v0_20, __local_174); - String::append_char(__local_73, 10); + String::push(__local_73, 10); break __tmpl: __local_73; }); unreachable; @@ -546,27 +546,27 @@ condition: builtin::i32x4_extract_lane(2, c) == 99 if __cond_26 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_75 = String { repr: builtin::array_new(195), used: 0 }; - String::append(__local_75, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_75, 114); - String::append_char(__local_75, 117); - String::append_char(__local_75, 110); - String::append_char(__local_75, 32); - String::append_char(__local_75, 97); - String::append_char(__local_75, 116); - String::append_char(__local_75, 32); - String::append(__local_75, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_75, 58); + String::push_str(__local_75, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_75, 114); + String::push(__local_75, 117); + String::push(__local_75, 110); + String::push(__local_75, 32); + String::push(__local_75, 97); + String::push(__local_75, 116); + String::push(__local_75, 32); + String::push_str(__local_75, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_75, 58); __local_76 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_75 }; __local_180 = __local_76; i32::fmt_decimal(30, __local_180); - String::append(__local_75, String { repr: array.new_data(" + String::push_str(__local_75, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(0, and_result) == 10 "), used: 61 }); - String::append(__local_75, String { repr: array.new_data("builtin::i32x4_extract_lane(0, and_result): "), used: 44 }); + String::push_str(__local_75, String { repr: array.new_data("builtin::i32x4_extract_lane(0, and_result): "), used: 44 }); __local_76 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_75 }; __local_185 = __local_76; i32::fmt_decimal(__v0_25, __local_185); - String::append_char(__local_75, 10); + String::push(__local_75, 10); break __tmpl: __local_75; }); unreachable; @@ -577,27 +577,27 @@ condition: builtin::i32x4_extract_lane(0, and_result) == 10 if __cond_29 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_77 = String { repr: builtin::array_new(193), used: 0 }; - String::append(__local_77, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_77, 114); - String::append_char(__local_77, 117); - String::append_char(__local_77, 110); - String::append_char(__local_77, 32); - String::append_char(__local_77, 97); - String::append_char(__local_77, 116); - String::append_char(__local_77, 32); - String::append(__local_77, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_77, 58); + String::push_str(__local_77, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_77, 114); + String::push(__local_77, 117); + String::push(__local_77, 110); + String::push(__local_77, 32); + String::push(__local_77, 97); + String::push(__local_77, 116); + String::push(__local_77, 32); + String::push_str(__local_77, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_77, 58); __local_78 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_77 }; __local_191 = __local_78; i32::fmt_decimal(32, __local_191); - String::append(__local_77, String { repr: array.new_data(" + String::push_str(__local_77, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(0, or_result) == 10 "), used: 60 }); - String::append(__local_77, String { repr: array.new_data("builtin::i32x4_extract_lane(0, or_result): "), used: 43 }); + String::push_str(__local_77, String { repr: array.new_data("builtin::i32x4_extract_lane(0, or_result): "), used: 43 }); __local_78 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_77 }; __local_196 = __local_78; i32::fmt_decimal(__v0_28, __local_196); - String::append_char(__local_77, 10); + String::push(__local_77, 10); break __tmpl: __local_77; }); unreachable; @@ -608,27 +608,27 @@ condition: builtin::i32x4_extract_lane(0, or_result) == 10 if __cond_32 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_79 = String { repr: builtin::array_new(195), used: 0 }; - String::append(__local_79, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_79, 114); - String::append_char(__local_79, 117); - String::append_char(__local_79, 110); - String::append_char(__local_79, 32); - String::append_char(__local_79, 97); - String::append_char(__local_79, 116); - String::append_char(__local_79, 32); - String::append(__local_79, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_79, 58); + String::push_str(__local_79, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_79, 114); + String::push(__local_79, 117); + String::push(__local_79, 110); + String::push(__local_79, 32); + String::push(__local_79, 97); + String::push(__local_79, 116); + String::push(__local_79, 32); + String::push_str(__local_79, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_79, 58); __local_80 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_79 }; __local_202 = __local_80; i32::fmt_decimal(34, __local_202); - String::append(__local_79, String { repr: array.new_data(" + String::push_str(__local_79, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(0, not_result) == -1 "), used: 61 }); - String::append(__local_79, String { repr: array.new_data("builtin::i32x4_extract_lane(0, not_result): "), used: 44 }); + String::push_str(__local_79, String { repr: array.new_data("builtin::i32x4_extract_lane(0, not_result): "), used: 44 }); __local_80 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_79 }; __local_207 = __local_80; i32::fmt_decimal(__v0_31, __local_207); - String::append_char(__local_79, 10); + String::push(__local_79, 10); break __tmpl: __local_79; }); unreachable; @@ -639,27 +639,27 @@ condition: builtin::i32x4_extract_lane(0, not_result) == -1 if __cond_35 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_81 = String { repr: builtin::array_new(182), used: 0 }; - String::append(__local_81, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_81, 114); - String::append_char(__local_81, 117); - String::append_char(__local_81, 110); - String::append_char(__local_81, 32); - String::append_char(__local_81, 97); - String::append_char(__local_81, 116); - String::append_char(__local_81, 32); - String::append(__local_81, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_81, 58); + String::push_str(__local_81, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_81, 114); + String::push(__local_81, 117); + String::push(__local_81, 110); + String::push(__local_81, 32); + String::push(__local_81, 97); + String::push(__local_81, 116); + String::push(__local_81, 32); + String::push_str(__local_81, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_81, 58); __local_82 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_81 }; __local_213 = __local_82; i32::fmt_decimal(38, __local_213); - String::append(__local_81, String { repr: array.new_data(" + String::push_str(__local_81, String { repr: array.new_data(" condition: builtin::i32x4_extract_lane(0, neg) == -10 "), used: 55 }); - String::append(__local_81, String { repr: array.new_data("builtin::i32x4_extract_lane(0, neg): "), used: 37 }); + String::push_str(__local_81, String { repr: array.new_data("builtin::i32x4_extract_lane(0, neg): "), used: 37 }); __local_82 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_81 }; __local_218 = __local_82; i32::fmt_decimal(__v0_34, __local_218); - String::append_char(__local_81, 10); + String::push(__local_81, 10); break __tmpl: __local_81; }); unreachable; @@ -680,28 +680,28 @@ condition: builtin::i32x4_extract_lane(0, neg) == -10 if __cond_46 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_83 = String { repr: builtin::array_new(242), used: 0 }; - String::append(__local_83, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_83, 114); - String::append_char(__local_83, 117); - String::append_char(__local_83, 110); - String::append_char(__local_83, 32); - String::append_char(__local_83, 97); - String::append_char(__local_83, 116); - String::append_char(__local_83, 32); - String::append(__local_83, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_83, 58); + String::push_str(__local_83, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_83, 114); + String::push(__local_83, 117); + String::push(__local_83, 110); + String::push(__local_83, 32); + String::push(__local_83, 97); + String::push(__local_83, 116); + String::push(__local_83, 32); + String::push_str(__local_83, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_83, 58); __local_84 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_83 }; __local_224 = __local_84; i32::fmt_decimal(47, __local_224); - String::append(__local_83, String { repr: array.new_data(" + String::push_str(__local_83, String { repr: array.new_data(" condition: fsum_val > 5.13 && fsum_val < 5.15 "), used: 47 }); - String::append(__local_83, String { repr: array.new_data("fsum_val: "), used: 10 }); + String::push_str(__local_83, String { repr: array.new_data("fsum_val: "), used: 10 }); __local_84 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_83 }; __local_229 = __local_84; f64::inspect_into(fsum_val, __local_229); - String::append_char(__local_83, 10); - String::append(__local_83, String { repr: array.new_data("fsum_val > 5.13: "), used: 17 }); + String::push(__local_83, 10); + String::push_str(__local_83, String { repr: array.new_data("fsum_val > 5.13: "), used: 17 }); __local_84 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_83 }; __local_232 = __local_84; Formatter::pad(__local_232, if __v1_43 -> ref String { @@ -709,13 +709,13 @@ condition: fsum_val > 5.13 && fsum_val < 5.15 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_83, 10); - String::append(__local_83, String { repr: array.new_data("fsum_val: "), used: 10 }); + String::push(__local_83, 10); + String::push_str(__local_83, String { repr: array.new_data("fsum_val: "), used: 10 }); __local_84 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_83 }; __local_237 = __local_84; f64::inspect_into(fsum_val, __local_237); - String::append_char(__local_83, 10); - String::append(__local_83, String { repr: array.new_data("fsum_val < 5.15: "), used: 17 }); + String::push(__local_83, 10); + String::push_str(__local_83, String { repr: array.new_data("fsum_val < 5.15: "), used: 17 }); __local_84 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_83 }; __local_240 = __local_84; Formatter::pad(__local_240, if __v3_45 -> ref String { @@ -723,7 +723,7 @@ condition: fsum_val > 5.13 && fsum_val < 5.15 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_83, 10); + String::push(__local_83, 10); break __tmpl: __local_83; }); unreachable; @@ -739,28 +739,28 @@ condition: fsum_val > 5.13 && fsum_val < 5.15 if __cond_52 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_85 = String { repr: builtin::array_new(248), used: 0 }; - String::append(__local_85, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_85, 114); - String::append_char(__local_85, 117); - String::append_char(__local_85, 110); - String::append_char(__local_85, 32); - String::append_char(__local_85, 97); - String::append_char(__local_85, 116); - String::append_char(__local_85, 32); - String::append(__local_85, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_85, 58); + String::push_str(__local_85, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_85, 114); + String::push(__local_85, 117); + String::push(__local_85, 110); + String::push(__local_85, 32); + String::push(__local_85, 97); + String::push(__local_85, 116); + String::push(__local_85, 32); + String::push_str(__local_85, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_85, 58); __local_86 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_85 }; __local_246 = __local_86; i32::fmt_decimal(49, __local_246); - String::append(__local_85, String { repr: array.new_data(" + String::push_str(__local_85, String { repr: array.new_data(" condition: fprod_val > 6.27 && fprod_val < 6.29 "), used: 49 }); - String::append(__local_85, String { repr: array.new_data("fprod_val: "), used: 11 }); + String::push_str(__local_85, String { repr: array.new_data("fprod_val: "), used: 11 }); __local_86 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_85 }; __local_251 = __local_86; f64::inspect_into(fprod_val, __local_251); - String::append_char(__local_85, 10); - String::append(__local_85, String { repr: array.new_data("fprod_val > 6.27: "), used: 18 }); + String::push(__local_85, 10); + String::push_str(__local_85, String { repr: array.new_data("fprod_val > 6.27: "), used: 18 }); __local_86 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_85 }; __local_254 = __local_86; Formatter::pad(__local_254, if __v1_49 -> ref String { @@ -768,13 +768,13 @@ condition: fprod_val > 6.27 && fprod_val < 6.29 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_85, 10); - String::append(__local_85, String { repr: array.new_data("fprod_val: "), used: 11 }); + String::push(__local_85, 10); + String::push_str(__local_85, String { repr: array.new_data("fprod_val: "), used: 11 }); __local_86 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_85 }; __local_259 = __local_86; f64::inspect_into(fprod_val, __local_259); - String::append_char(__local_85, 10); - String::append(__local_85, String { repr: array.new_data("fprod_val < 6.29: "), used: 18 }); + String::push(__local_85, 10); + String::push_str(__local_85, String { repr: array.new_data("fprod_val < 6.29: "), used: 18 }); __local_86 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_85 }; __local_262 = __local_86; Formatter::pad(__local_262, if __v3_51 -> ref String { @@ -782,7 +782,7 @@ condition: fprod_val > 6.27 && fprod_val < 6.29 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_85, 10); + String::push(__local_85, 10); break __tmpl: __local_85; }); unreachable; @@ -798,28 +798,28 @@ condition: fprod_val > 6.27 && fprod_val < 6.29 if __cond_58 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_87 = String { repr: builtin::array_new(242), used: 0 }; - String::append(__local_87, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_87, 114); - String::append_char(__local_87, 117); - String::append_char(__local_87, 110); - String::append_char(__local_87, 32); - String::append_char(__local_87, 97); - String::append_char(__local_87, 116); - String::append_char(__local_87, 32); - String::append(__local_87, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); - String::append_char(__local_87, 58); + String::push_str(__local_87, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_87, 114); + String::push(__local_87, 117); + String::push(__local_87, 110); + String::push(__local_87, 32); + String::push(__local_87, 97); + String::push(__local_87, 116); + String::push(__local_87, 32); + String::push_str(__local_87, String { repr: array.new_data("wado-compiler/tests/fixtures/simd_basic.wado"), used: 44 }); + String::push(__local_87, 58); __local_88 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_87 }; __local_268 = __local_88; i32::fmt_decimal(51, __local_268); - String::append(__local_87, String { repr: array.new_data(" + String::push_str(__local_87, String { repr: array.new_data(" condition: fdiv_val > 1.56 && fdiv_val < 1.58 "), used: 47 }); - String::append(__local_87, String { repr: array.new_data("fdiv_val: "), used: 10 }); + String::push_str(__local_87, String { repr: array.new_data("fdiv_val: "), used: 10 }); __local_88 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_87 }; __local_273 = __local_88; f64::inspect_into(fdiv_val, __local_273); - String::append_char(__local_87, 10); - String::append(__local_87, String { repr: array.new_data("fdiv_val > 1.56: "), used: 17 }); + String::push(__local_87, 10); + String::push_str(__local_87, String { repr: array.new_data("fdiv_val > 1.56: "), used: 17 }); __local_88 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_87 }; __local_276 = __local_88; Formatter::pad(__local_276, if __v1_55 -> ref String { @@ -827,13 +827,13 @@ condition: fdiv_val > 1.56 && fdiv_val < 1.58 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_87, 10); - String::append(__local_87, String { repr: array.new_data("fdiv_val: "), used: 10 }); + String::push(__local_87, 10); + String::push_str(__local_87, String { repr: array.new_data("fdiv_val: "), used: 10 }); __local_88 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_87 }; __local_281 = __local_88; f64::inspect_into(fdiv_val, __local_281); - String::append_char(__local_87, 10); - String::append(__local_87, String { repr: array.new_data("fdiv_val < 1.58: "), used: 17 }); + String::push(__local_87, 10); + String::push_str(__local_87, String { repr: array.new_data("fdiv_val < 1.58: "), used: 17 }); __local_88 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_87 }; __local_284 = __local_88; Formatter::pad(__local_284, if __v3_57 -> ref String { @@ -841,7 +841,7 @@ condition: fdiv_val > 1.56 && fdiv_val < 1.58 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_87, 10); + String::push(__local_87, 10); break __tmpl: __local_87; }); unreachable; @@ -1610,8 +1610,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1666,13 +1666,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1680,25 +1680,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1706,7 +1706,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1748,8 +1748,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1781,7 +1781,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1910,27 +1910,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2053,9 +2053,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2065,8 +2065,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2121,13 +2121,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2162,9 +2162,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2217,7 +2217,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2232,7 +2232,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2270,7 +2270,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l186; }; @@ -2290,7 +2290,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2298,17 +2298,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2462,20 +2462,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2485,10 +2485,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2498,10 +2498,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2509,10 +2509,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/single_module_variant_iter.wir.wado b/wado-compiler/tests/fixtures.golden/single_module_variant_iter.wir.wado index 8fcac72d4..4ad9125fd 100644 --- a/wado-compiler/tests/fixtures.golden/single_module_variant_iter.wir.wado +++ b/wado-compiler/tests/fixtures.golden/single_module_variant_iter.wir.wado @@ -109,11 +109,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref Choice); +type "functype/Array::push" = fn(ref Array, ref Choice); type "functype/Array::grow" = fn(ref Array); @@ -175,43 +175,43 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/single_module_variant_iter.wado"), used: 60 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/single_module_variant_iter.wado"), used: 60 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_25 = __local_11; i32::fmt_decimal(52, __local_25); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); - String::append(__local_10, __tmpl: block -> ref String { + String::push(__local_10, 58); + String::push(__local_10, 32); + String::push_str(__local_10, __tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_8, String { repr: array.new_data("expected 30, got "), used: 17 }); + String::push_str(__local_8, String { repr: array.new_data("expected 30, got "), used: 17 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(result, __local_9); break __tmpl: __local_8; }); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: result == 30 "), used: 25 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 101); - String::append_char(__local_10, 115); - String::append_char(__local_10, 117); - String::append_char(__local_10, 108); - String::append_char(__local_10, 116); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 114); + String::push(__local_10, 101); + String::push(__local_10, 115); + String::push(__local_10, 117); + String::push(__local_10, 108); + String::push(__local_10, 116); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_36 = __local_11; i32::fmt_decimal(result, __local_36); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -459,7 +459,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -474,7 +474,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -501,7 +501,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -564,7 +564,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -598,20 +598,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -621,10 +621,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -634,10 +634,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -645,10 +645,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/static_1.wir.wado b/wado-compiler/tests/fixtures.golden/static_1.wir.wado index f4cb43c0c..696af53ef 100644 --- a/wado-compiler/tests/fixtures.golden/static_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/static_1.wir.wado @@ -152,13 +152,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Point::distance_squared" = fn(ref Point, ref Point) -> i32; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -226,30 +226,30 @@ fn __test_1_static_method_with_args() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_1_static_method_with_args"), used: 32 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_1_static_method_with_args"), used: 32 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_24 = __local_11; i32::fmt_decimal(120, __local_24); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: p1.x == 3 "), used: 22 }); - String::append_char(__local_10, 112); - String::append_char(__local_10, 49); - String::append_char(__local_10, 46); - String::append_char(__local_10, 120); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 112); + String::push(__local_10, 49); + String::push(__local_10, 46); + String::push(__local_10, 120); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_29 = __local_11; i32::fmt_decimal(__v0_1, __local_29); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -259,30 +259,30 @@ condition: p1.x == 3 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_1_static_method_with_args"), used: 32 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_1_static_method_with_args"), used: 32 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_35 = __local_13; i32::fmt_decimal(121, __local_35); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: p1.y == 4 "), used: 22 }); - String::append_char(__local_12, 112); - String::append_char(__local_12, 49); - String::append_char(__local_12, 46); - String::append_char(__local_12, 121); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 112); + String::push(__local_12, 49); + String::push(__local_12, 46); + String::push(__local_12, 121); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_40 = __local_13; i32::fmt_decimal(__v0_3, __local_40); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -296,30 +296,30 @@ condition: p1.y == 4 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_1_static_method_with_args"), used: 32 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_1_static_method_with_args"), used: 32 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_48 = __local_15; i32::fmt_decimal(124, __local_48); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: p2.x == 6 "), used: 22 }); - String::append_char(__local_14, 112); - String::append_char(__local_14, 50); - String::append_char(__local_14, 46); - String::append_char(__local_14, 120); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 112); + String::push(__local_14, 50); + String::push(__local_14, 46); + String::push(__local_14, 120); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_53 = __local_15; i32::fmt_decimal(__v0_6, __local_53); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -329,30 +329,30 @@ condition: p2.x == 6 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_1_static_method_with_args"), used: 32 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_1_static_method_with_args"), used: 32 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_59 = __local_17; i32::fmt_decimal(125, __local_59); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: p2.y == 8 "), used: 22 }); - String::append_char(__local_16, 112); - String::append_char(__local_16, 50); - String::append_char(__local_16, 46); - String::append_char(__local_16, 121); - String::append_char(__local_16, 58); - String::append_char(__local_16, 32); + String::push(__local_16, 112); + String::push(__local_16, 50); + String::push(__local_16, 46); + String::push(__local_16, 121); + String::push(__local_16, 58); + String::push(__local_16, 32); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_64 = __local_17; i32::fmt_decimal(__v0_8, __local_64); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -406,30 +406,30 @@ fn __test_2_static_method_nested() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_2_static_method_nested"), used: 29 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_2_static_method_nested"), used: 29 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_29 = __local_14; i32::fmt_decimal(130, __local_29); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: p1.x == 0 "), used: 22 }); - String::append_char(__local_13, 112); - String::append_char(__local_13, 49); - String::append_char(__local_13, 46); - String::append_char(__local_13, 120); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 112); + String::push(__local_13, 49); + String::push(__local_13, 46); + String::push(__local_13, 120); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_34 = __local_14; i32::fmt_decimal(__v0_1, __local_34); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -439,30 +439,30 @@ condition: p1.x == 0 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_2_static_method_nested"), used: 29 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_2_static_method_nested"), used: 29 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_40 = __local_16; i32::fmt_decimal(131, __local_40); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: p1.y == 0 "), used: 22 }); - String::append_char(__local_15, 112); - String::append_char(__local_15, 49); - String::append_char(__local_15, 46); - String::append_char(__local_15, 121); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 112); + String::push(__local_15, 49); + String::push(__local_15, 46); + String::push(__local_15, 121); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_45 = __local_16; i32::fmt_decimal(__v0_3, __local_45); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -479,30 +479,30 @@ condition: p1.y == 0 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_2_static_method_nested"), used: 29 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_2_static_method_nested"), used: 29 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_57 = __local_18; i32::fmt_decimal(134, __local_57); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: p2.x == 4 "), used: 22 }); - String::append_char(__local_17, 112); - String::append_char(__local_17, 50); - String::append_char(__local_17, 46); - String::append_char(__local_17, 120); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 112); + String::push(__local_17, 50); + String::push(__local_17, 46); + String::push(__local_17, 120); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_62 = __local_18; i32::fmt_decimal(__v0_6, __local_62); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -512,30 +512,30 @@ condition: p2.x == 4 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_2_static_method_nested"), used: 29 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_2_static_method_nested"), used: 29 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_68 = __local_20; i32::fmt_decimal(135, __local_68); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: p2.y == 6 "), used: 22 }); - String::append_char(__local_19, 112); - String::append_char(__local_19, 50); - String::append_char(__local_19, 46); - String::append_char(__local_19, 121); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 112); + String::push(__local_19, 50); + String::push(__local_19, 46); + String::push(__local_19, 121); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_73 = __local_20; i32::fmt_decimal(__v0_8, __local_73); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -545,30 +545,30 @@ condition: p2.y == 6 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_2_static_method_nested"), used: 29 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_2_static_method_nested"), used: 29 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_81 = __local_22; i32::fmt_decimal(138, __local_81); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: dist == 25 "), used: 23 }); - String::append_char(__local_21, 100); - String::append_char(__local_21, 105); - String::append_char(__local_21, 115); - String::append_char(__local_21, 116); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 100); + String::push(__local_21, 105); + String::push(__local_21, 115); + String::push(__local_21, 116); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_86 = __local_22; i32::fmt_decimal(dist, __local_86); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -606,25 +606,25 @@ fn __test_3_static_method_chained() { if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_3_static_method_chained"), used: 30 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_3_static_method_chained"), used: 30 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_47 = __local_17; i32::fmt_decimal(149, __local_47); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: inner_pair.get_first() == 100 "), used: 42 }); - String::append(__local_16, String { repr: array.new_data("inner_pair.get_first(): "), used: 24 }); + String::push_str(__local_16, String { repr: array.new_data("inner_pair.get_first(): "), used: 24 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_52 = __local_17; i32::fmt_decimal(__v0_7, __local_52); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -634,25 +634,25 @@ condition: inner_pair.get_first() == 100 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_3_static_method_chained"), used: 30 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_3_static_method_chained"), used: 30 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_59 = __local_19; i32::fmt_decimal(150, __local_59); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: inner_pair.get_second() == 200 "), used: 43 }); - String::append(__local_18, String { repr: array.new_data("inner_pair.get_second(): "), used: 25 }); + String::push_str(__local_18, String { repr: array.new_data("inner_pair.get_second(): "), used: 25 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_64 = __local_19; i32::fmt_decimal(__v0_9, __local_64); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -671,29 +671,29 @@ condition: inner_pair.get_second() == 200 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("__test_3_static_method_chained"), used: 30 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("__test_3_static_method_chained"), used: 30 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_75 = __local_21; i32::fmt_decimal(153, __local_75); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: val == 10 "), used: 22 }); - String::append_char(__local_20, 118); - String::append_char(__local_20, 97); - String::append_char(__local_20, 108); - String::append_char(__local_20, 58); - String::append_char(__local_20, 32); + String::push(__local_20, 118); + String::push(__local_20, 97); + String::push(__local_20, 108); + String::push(__local_20, 58); + String::push(__local_20, 32); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_80 = __local_21; i32::fmt_decimal(val, __local_80); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -738,56 +738,56 @@ fn __test_4_static_method_generic__array__with_capacity_() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_4_static_method_generic__array__with_capacity_"), used: 53 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_4_static_method_generic__array__with_capacity_"), used: 53 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_27 = __local_12; i32::fmt_decimal(158, __local_27); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: arr.len() == 0 "), used: 27 }); - String::append(__local_11, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_11, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_32 = __local_12; i32::fmt_decimal(__v0_1, __local_32); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; }; - Array::append(arr, 1); - Array::append(arr, 2); - Array::append(arr, 3); + Array::push(arr, 1); + Array::push(arr, 2); + Array::push(arr, 3); __v0_3 = arr.used; __cond_4 = __v0_3 == 3; if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_4_static_method_generic__array__with_capacity_"), used: 53 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_4_static_method_generic__array__with_capacity_"), used: 53 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_39 = __local_14; i32::fmt_decimal(163, __local_39); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: arr.len() == 3 "), used: 27 }); - String::append(__local_13, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_13, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_44 = __local_14; i32::fmt_decimal(__v0_3, __local_44); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -803,32 +803,32 @@ condition: arr.len() == 3 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_4_static_method_generic__array__with_capacity_"), used: 53 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_4_static_method_generic__array__with_capacity_"), used: 53 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_52 = __local_16; i32::fmt_decimal(164, __local_52); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: arr[0] == 1 "), used: 24 }); - String::append_char(__local_15, 97); - String::append_char(__local_15, 114); - String::append_char(__local_15, 114); - String::append_char(__local_15, 91); - String::append_char(__local_15, 48); - String::append_char(__local_15, 93); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 114); + String::push(__local_15, 114); + String::push(__local_15, 91); + String::push(__local_15, 48); + String::push(__local_15, 93); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_57 = __local_16; i32::fmt_decimal(__v0_5, __local_57); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -844,32 +844,32 @@ condition: arr[0] == 1 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_4_static_method_generic__array__with_capacity_"), used: 53 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_4_static_method_generic__array__with_capacity_"), used: 53 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_65 = __local_18; i32::fmt_decimal(165, __local_65); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: arr[1] == 2 "), used: 24 }); - String::append_char(__local_17, 97); - String::append_char(__local_17, 114); - String::append_char(__local_17, 114); - String::append_char(__local_17, 91); - String::append_char(__local_17, 49); - String::append_char(__local_17, 93); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 114); + String::push(__local_17, 114); + String::push(__local_17, 91); + String::push(__local_17, 49); + String::push(__local_17, 93); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_70 = __local_18; i32::fmt_decimal(__v0_7, __local_70); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -885,32 +885,32 @@ condition: arr[1] == 2 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_4_static_method_generic__array__with_capacity_"), used: 53 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_4_static_method_generic__array__with_capacity_"), used: 53 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_78 = __local_20; i32::fmt_decimal(166, __local_78); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: arr[2] == 3 "), used: 24 }); - String::append_char(__local_19, 97); - String::append_char(__local_19, 114); - String::append_char(__local_19, 114); - String::append_char(__local_19, 91); - String::append_char(__local_19, 50); - String::append_char(__local_19, 93); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 114); + String::push(__local_19, 114); + String::push(__local_19, 91); + String::push(__local_19, 50); + String::push(__local_19, 93); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_83 = __local_20; i32::fmt_decimal(__v0_9, __local_83); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -957,27 +957,27 @@ fn __test_8_static_method_in_other_module__u128_i128_() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_8_static_method_in_other_module__u128_i128_"), used: 50 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_8_static_method_in_other_module__u128_i128_"), used: 50 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_21 = __local_9; i32::fmt_decimal(200, __local_21); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: y == 42 as u128 "), used: 28 }); - String::append_char(__local_8, 121); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 121); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_26 = __local_9; u128::fmt_decimal(__v0_2, __local_26); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -996,28 +996,28 @@ condition: y == 42 as u128 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_8_static_method_in_other_module__u128_i128_"), used: 50 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_8_static_method_in_other_module__u128_i128_"), used: 50 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/static_1.wado"), used: 42 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_39 = __local_11; i32::fmt_decimal(204, __local_39); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: y2 == -10 as i128 "), used: 30 }); - String::append_char(__local_10, 121); - String::append_char(__local_10, 50); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 121); + String::push(__local_10, 50); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_44 = __local_11; i128::fmt_decimal(__v0_6, __local_44); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -1578,7 +1578,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1593,7 +1593,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1628,7 +1628,7 @@ fn Point::distance_squared(a, b) { return (dx * dx) + (dy * dy); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1681,7 +1681,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l87; }; @@ -1715,20 +1715,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1738,10 +1738,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1751,10 +1751,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1762,10 +1762,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/static_2.wir.wado b/wado-compiler/tests/fixtures.golden/static_2.wir.wado index 2d779d857..1f2a3d504 100644 --- a/wado-compiler/tests/fixtures.golden/static_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/static_2.wir.wado @@ -120,19 +120,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i64); +type "functype/Array::push" = fn(ref Array, i64); type "functype/Array::grow" = fn(ref Array); @@ -184,24 +184,24 @@ fn __test_0_generic_static_method_on_generic_type() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_0_generic_static_method_on_generic_type"), used: 46 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_0_generic_static_method_on_generic_type"), used: 46 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_16 = __local_7; i32::fmt_decimal(100, __local_16); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: b.get() == \"hello\" "), used: 31 }); - String::append(__local_6, String { repr: array.new_data("b.get(): "), used: 9 }); + String::push_str(__local_6, String { repr: array.new_data("b.get(): "), used: 9 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -225,24 +225,24 @@ fn __test_1_generic_static_method_called_from_generic_function() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_1_generic_static_method_called_from_generic_function"), used: 59 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_1_generic_static_method_called_from_generic_function"), used: 59 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; i32::fmt_decimal(108, __local_17); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: w.get() == \"hello\" "), used: 31 }); - String::append(__local_6, String { repr: array.new_data("w.get(): "), used: 9 }); + String::push_str(__local_6, String { repr: array.new_data("w.get(): "), used: 9 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -266,31 +266,31 @@ fn __test_2_both_type_params_from_outer_generic_context() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_2_both_type_params_from_outer_generic_context"), used: 52 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_2_both_type_params_from_outer_generic_context"), used: 52 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_16 = __local_7; i32::fmt_decimal(116, __local_16); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: result == \"test\" "), used: 29 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 101); - String::append_char(__local_6, 115); - String::append_char(__local_6, 117); - String::append_char(__local_6, 108); - String::append_char(__local_6, 116); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 114); + String::push(__local_6, 101); + String::push(__local_6, 115); + String::push(__local_6, 117); + String::push(__local_6, 108); + String::push(__local_6, 116); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -327,8 +327,8 @@ fn __test_3_literal_coercion_with_generic_static_method() { __local_37 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_37; }; - Array::append(__local_38, 10_i64); - Array::append(__local_38, 20_i64); + Array::push(__local_38, 10_i64); + Array::push(__local_38, 20_i64); break __inline_Factory_String___make_array_i64__11: __local_38; }; sum = __inline_Array_i64__IndexValue__index_value_15: block -> i64 { @@ -348,29 +348,29 @@ fn __test_3_literal_coercion_with_generic_static_method() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_3_literal_coercion_with_generic_static_method"), used: 52 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_3_literal_coercion_with_generic_static_method"), used: 52 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_49 = __local_16; i32::fmt_decimal(128, __local_49); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: sum == 30 as i64 "), used: 29 }); - String::append_char(__local_15, 115); - String::append_char(__local_15, 117); - String::append_char(__local_15, 109); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 115); + String::push(__local_15, 117); + String::push(__local_15, 109); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_54 = __local_16; i64::fmt_decimal(sum, __local_54); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -387,25 +387,25 @@ condition: sum == 30 as i64 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_3_literal_coercion_with_generic_static_method"), used: 52 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_3_literal_coercion_with_generic_static_method"), used: 52 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_71 = __local_18; i32::fmt_decimal(131, __local_71); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: arr2.len() == 3 "), used: 28 }); - String::append(__local_17, String { repr: array.new_data("arr2.len(): "), used: 12 }); + String::push_str(__local_17, String { repr: array.new_data("arr2.len(): "), used: 12 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_76 = __local_18; i32::fmt_decimal(__v0_9, __local_76); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -421,25 +421,25 @@ condition: arr2.len() == 3 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_3_literal_coercion_with_generic_static_method"), used: 52 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_3_literal_coercion_with_generic_static_method"), used: 52 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_84 = __local_20; i32::fmt_decimal(132, __local_84); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: arr2[0] == 100 as i64 "), used: 34 }); - String::append(__local_19, String { repr: array.new_data("arr2[0]: "), used: 9 }); + String::push_str(__local_19, String { repr: array.new_data("arr2[0]: "), used: 9 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_89 = __local_20; i64::fmt_decimal(__v0_11, __local_89); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -480,25 +480,25 @@ fn __test_4_nested_generic_types_with_static_methods() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_4_nested_generic_types_with_static_methods"), used: 49 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_4_nested_generic_types_with_static_methods"), used: 49 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_35 = __local_14; i32::fmt_decimal(139, __local_35); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: inner.len() == 3 "), used: 29 }); - String::append(__local_13, String { repr: array.new_data("inner.len(): "), used: 13 }); + String::push_str(__local_13, String { repr: array.new_data("inner.len(): "), used: 13 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_40 = __local_14; i32::fmt_decimal(__v0_4, __local_40); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -514,25 +514,25 @@ condition: inner.len() == 3 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_4_nested_generic_types_with_static_methods"), used: 49 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_4_nested_generic_types_with_static_methods"), used: 49 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_48 = __local_16; i32::fmt_decimal(140, __local_48); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: inner[0] == 1 "), used: 26 }); - String::append(__local_15, String { repr: array.new_data("inner[0]: "), used: 10 }); + String::push_str(__local_15, String { repr: array.new_data("inner[0]: "), used: 10 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_53 = __local_16; i32::fmt_decimal(__v0_6, __local_53); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -544,25 +544,25 @@ condition: inner[0] == 1 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_4_nested_generic_types_with_static_methods"), used: 49 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_4_nested_generic_types_with_static_methods"), used: 49 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_63 = __local_18; i32::fmt_decimal(145, __local_63); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: unwrapped.get() == 42 "), used: 34 }); - String::append(__local_17, String { repr: array.new_data("unwrapped.get(): "), used: 17 }); + String::push_str(__local_17, String { repr: array.new_data("unwrapped.get(): "), used: 17 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_68 = __local_18; i32::fmt_decimal(__v0_11, __local_68); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -586,26 +586,26 @@ fn __test_5_turbofish_on_non_generic_struct() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_5_turbofish_on_non_generic_struct"), used: 40 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_5_turbofish_on_non_generic_struct"), used: 40 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/static_2.wado"), used: 42 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_15 = __local_7; i32::fmt_decimal(150, __local_15); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: s == \"hello\" "), used: 25 }); - String::append_char(__local_6, 115); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 115); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; String^Inspect::inspect(__v0, __local_7); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -879,7 +879,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -967,7 +967,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -994,7 +994,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1036,7 +1036,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1089,7 +1089,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l56; }; @@ -1123,20 +1123,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1146,10 +1146,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1159,10 +1159,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1170,10 +1170,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1185,7 +1185,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1202,22 +1202,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b75; @@ -1225,7 +1225,7 @@ fn String^Inspect::inspect(self, f) { continue l76; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_generic_static_method_on_generic_type as "__test_0_generic_static_method_on_generic_type" diff --git a/wado-compiler/tests/fixtures.golden/store_to_load_forwarding.wir.wado b/wado-compiler/tests/fixtures.golden/store_to_load_forwarding.wir.wado index 919c3918b..a37356bb6 100644 --- a/wado-compiler/tests/fixtures.golden/store_to_load_forwarding.wir.wado +++ b/wado-compiler/tests/fixtures.golden/store_to_load_forwarding.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -104,13 +104,13 @@ fn run() with Stdout { __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_99 = __local_28; i32::fmt_decimal(10, __local_99); - String::append_char(__local_27, 44); - String::append_char(__local_27, 32); + String::push(__local_27, 44); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_104 = __local_28; i32::fmt_decimal(42, __local_104); - String::append_char(__local_27, 44); - String::append_char(__local_27, 32); + String::push(__local_27, 44); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_109 = __local_28; i32::fmt_decimal(100, __local_109); @@ -313,7 +313,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -328,7 +328,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -366,7 +366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -400,20 +400,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stores_basic.wir.wado b/wado-compiler/tests/fixtures.golden/stores_basic.wir.wado index 77a88f062..e043ab371 100644 --- a/wado-compiler/tests/fixtures.golden/stores_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stores_basic.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -111,29 +111,29 @@ fn run() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_7, 114); - String::append_char(__local_7, 117); - String::append_char(__local_7, 110); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_basic.wado"), used: 46 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_7, 114); + String::push(__local_7, 117); + String::push(__local_7, 110); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_basic.wado"), used: 46 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_17 = __local_8; i32::fmt_decimal(25, __local_17); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: v == 42 "), used: 20 }); - String::append_char(__local_7, 118); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 118); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_22 = __local_8; i32::fmt_decimal(v, __local_22); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -143,27 +143,27 @@ condition: v == 42 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_9, 114); - String::append_char(__local_9, 117); - String::append_char(__local_9, 110); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_basic.wado"), used: 46 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_9, 114); + String::push(__local_9, 117); + String::push(__local_9, 110); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_basic.wado"), used: 46 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_28 = __local_10; i32::fmt_decimal(26, __local_28); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: c.data.value == 42 "), used: 31 }); - String::append(__local_9, String { repr: array.new_data("c.data.value: "), used: 14 }); + String::push_str(__local_9, String { repr: array.new_data("c.data.value: "), used: 14 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_33 = __local_10; i32::fmt_decimal(__v0, __local_33); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -366,7 +366,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -381,7 +381,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -419,7 +419,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -453,20 +453,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -476,10 +476,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -489,10 +489,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -500,10 +500,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stores_fn_type_with_effect_param.wir.wado b/wado-compiler/tests/fixtures.golden/stores_fn_type_with_effect_param.wir.wado index 43c1e746b..dc25b046c 100644 --- a/wado-compiler/tests/fixtures.golden/stores_fn_type_with_effect_param.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stores_fn_type_with_effect_param.wir.wado @@ -74,9 +74,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/__Closure_0::__call" = fn(ref __Closure_0, i32) -> i32; @@ -126,48 +126,48 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_fn_type_with_effect_param.wado"), used: 66 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_5, 114); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_fn_type_with_effect_param.wado"), used: 66 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_15 = __local_6; i32::fmt_decimal(15, __local_15); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: result == 42 "), used: 25 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 101); - String::append_char(__local_5, 115); - String::append_char(__local_5, 117); - String::append_char(__local_5, 108); - String::append_char(__local_5, 116); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 114); + String::push(__local_5, 101); + String::push(__local_5, 115); + String::push(__local_5, 117); + String::push(__local_5, 108); + String::push(__local_5, 116); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_20 = __local_6; i32::fmt_decimal(result, __local_20); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; }; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_7, 114); - String::append_char(__local_7, 101); - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 108); - String::append_char(__local_7, 116); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 114); + String::push(__local_7, 101); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 108); + String::push(__local_7, 116); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(result, __local_8); break __tmpl: __local_7; @@ -406,7 +406,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -421,7 +421,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -453,10 +453,10 @@ fn __Closure_0::__call(self, x) { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_4, 120); - String::append_char(__local_4, 32); - String::append_char(__local_4, 61); - String::append_char(__local_4, 32); + String::push(__local_4, 120); + String::push(__local_4, 32); + String::push(__local_4, 61); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(x, __local_5); break __tmpl: __local_4; @@ -475,7 +475,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -509,20 +509,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -532,10 +532,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -545,10 +545,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -556,10 +556,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stores_optimize_field_forward.wir.wado b/wado-compiler/tests/fixtures.golden/stores_optimize_field_forward.wir.wado index 408ae16da..3afbfd3d7 100644 --- a/wado-compiler/tests/fixtures.golden/stores_optimize_field_forward.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stores_optimize_field_forward.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -300,7 +300,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -315,7 +315,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -353,7 +353,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -387,20 +387,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -410,10 +410,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -434,10 +434,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stores_optimize_mixed_calls.wir.wado b/wado-compiler/tests/fixtures.golden/stores_optimize_mixed_calls.wir.wado index a0c3fd647..41cba7cb5 100644 --- a/wado-compiler/tests/fixtures.golden/stores_optimize_mixed_calls.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stores_optimize_mixed_calls.wir.wado @@ -81,9 +81,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -131,31 +131,31 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_optimize_mixed_calls.wado"), used: 61 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_optimize_mixed_calls.wado"), used: 61 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_29 = __local_9; i32::fmt_decimal(36, __local_29); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: b.x == 30 "), used: 22 }); - String::append_char(__local_8, 98); - String::append_char(__local_8, 46); - String::append_char(__local_8, 120); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 98); + String::push(__local_8, 46); + String::push(__local_8, 120); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_34 = __local_9; i32::fmt_decimal(__v0, __local_34); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -165,7 +165,7 @@ condition: b.x == 30 __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_40 = __local_11; i32::fmt_decimal(10, __local_40); - String::append_char(__local_10, 32); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_45 = __local_11; i32::fmt_decimal(b.x, __local_45); @@ -405,7 +405,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -420,7 +420,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -458,7 +458,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -492,20 +492,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -515,10 +515,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -528,10 +528,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -539,10 +539,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stores_optimize_multiple_non_stores.wir.wado b/wado-compiler/tests/fixtures.golden/stores_optimize_multiple_non_stores.wir.wado index 6b16abd97..c9bdb975e 100644 --- a/wado-compiler/tests/fixtures.golden/stores_optimize_multiple_non_stores.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stores_optimize_multiple_non_stores.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -103,7 +103,7 @@ fn run() with Stdout { __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_41 = __local_12; i32::fmt_decimal(1, __local_41); - String::append_char(__local_11, 32); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_46 = __local_12; i32::fmt_decimal(2, __local_46); @@ -306,7 +306,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -321,7 +321,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -359,7 +359,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -393,20 +393,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -416,10 +416,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -440,10 +440,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stores_optimize_with_stores_no_forward.wir.wado b/wado-compiler/tests/fixtures.golden/stores_optimize_with_stores_no_forward.wir.wado index b45805d56..51aea3897 100644 --- a/wado-compiler/tests/fixtures.golden/stores_optimize_with_stores_no_forward.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stores_optimize_with_stores_no_forward.wir.wado @@ -77,9 +77,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -123,31 +123,31 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_optimize_with_stores_no_forward.wado"), used: 72 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_optimize_with_stores_no_forward.wado"), used: 72 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_13 = __local_5; i32::fmt_decimal(26, __local_13); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: p.a == 42 "), used: 22 }); - String::append_char(__local_4, 112); - String::append_char(__local_4, 46); - String::append_char(__local_4, 97); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 112); + String::push(__local_4, 46); + String::push(__local_4, 97); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_18 = __local_5; i32::fmt_decimal(__v0, __local_18); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -392,7 +392,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -407,7 +407,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -445,7 +445,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -479,20 +479,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -502,10 +502,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -515,10 +515,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -526,10 +526,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stores_self.wir.wado b/wado-compiler/tests/fixtures.golden/stores_self.wir.wado index 9ce3e6880..34f51e9fd 100644 --- a/wado-compiler/tests/fixtures.golden/stores_self.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stores_self.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -105,27 +105,27 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_self.wado"), used: 45 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_self.wado"), used: 45 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_11 = __local_5; i32::fmt_decimal(20, __local_11); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: c.data.value == 42 "), used: 31 }); - String::append(__local_4, String { repr: array.new_data("c.data.value: "), used: 14 }); + String::push_str(__local_4, String { repr: array.new_data("c.data.value: "), used: 14 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_16 = __local_5; i32::fmt_decimal(__v0, __local_16); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -328,7 +328,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -343,7 +343,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -381,7 +381,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -415,20 +415,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -438,10 +438,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -451,10 +451,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -462,10 +462,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stores_with_effects.wir.wado b/wado-compiler/tests/fixtures.golden/stores_with_effects.wir.wado index 413d76276..8ec599154 100644 --- a/wado-compiler/tests/fixtures.golden/stores_with_effects.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stores_with_effects.wir.wado @@ -82,9 +82,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -117,7 +117,7 @@ fn store_and_log(data) with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(41), used: 0 }; - String::append(__local_1, String { repr: array.new_data("Storing data with value: "), used: 25 }); + String::push_str(__local_1, String { repr: array.new_data("Storing data with value: "), used: 25 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(data.value, __local_2); break __tmpl: __local_1; @@ -141,27 +141,27 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_with_effects.wado"), used: 53 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/stores_with_effects.wado"), used: 53 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(21, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: c.data.value == 99 "), used: 31 }); - String::append(__local_4, String { repr: array.new_data("c.data.value: "), used: 14 }); + String::push_str(__local_4, String { repr: array.new_data("c.data.value: "), used: 14 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(__v0, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -400,7 +400,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -415,7 +415,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -453,7 +453,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -487,20 +487,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -510,10 +510,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -523,10 +523,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -534,10 +534,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stream-cm-stdin-read.wir.wado b/wado-compiler/tests/fixtures.golden/stream-cm-stdin-read.wir.wado index 8ecd087dc..05b95adb2 100644 --- a/wado-compiler/tests/fixtures.golden/stream-cm-stdin-read.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-cm-stdin-read.wir.wado @@ -70,9 +70,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -133,19 +133,19 @@ fn run() with Stdout, Stdin { "wasi/stream-drop-readable"(stdin_stream); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(27), used: 0 }; - String::append_char(__local_4, 114); - String::append_char(__local_4, 101); - String::append_char(__local_4, 97); - String::append_char(__local_4, 100); - String::append_char(__local_4, 32); + String::push(__local_4, 114); + String::push(__local_4, 101); + String::push(__local_4, 97); + String::push(__local_4, 100); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(total, __local_5); - String::append_char(__local_4, 32); - String::append_char(__local_4, 98); - String::append_char(__local_4, 121); - String::append_char(__local_4, 116); - String::append_char(__local_4, 101); - String::append_char(__local_4, 115); + String::push(__local_4, 32); + String::push(__local_4, 98); + String::push(__local_4, 121); + String::push(__local_4, 116); + String::push(__local_4, 101); + String::push(__local_4, 115); break __tmpl: __local_4; }); } @@ -393,7 +393,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -408,7 +408,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -446,7 +446,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l30; }; @@ -480,20 +480,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -503,10 +503,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -516,10 +516,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -527,10 +527,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stream-http-echo.wir.wado b/wado-compiler/tests/fixtures.golden/stream-http-echo.wir.wado index 8d147234e..b7cb7803b 100644 --- a/wado-compiler/tests/fixtures.golden/stream-http-echo.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-http-echo.wir.wado @@ -268,7 +268,7 @@ type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); type "functype/ArrayIter>^Iterator::next" = fn(ref "core:allocator/ArrayIter>") -> ref null Array; -type "functype/Array>::append" = fn(ref Array>, ref Array); +type "functype/Array>::push" = fn(ref Array>, ref Array); type "functype/Array>::grow" = fn(ref Array>); @@ -473,7 +473,7 @@ fn handle(request) { if chunk_7.used == 0 { break b0; }; - Array>::append(chunks, chunk_7); + Array>::push(chunks, chunk_7); continue l1; }; }; @@ -977,7 +977,7 @@ fn ArrayIter>^Iterator::next(self) { return item; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/stream-http-read-request-body.wir.wado b/wado-compiler/tests/fixtures.golden/stream-http-read-request-body.wir.wado index 219ea32e9..e5c045d03 100644 --- a/wado-compiler/tests/fixtures.golden/stream-http-read-request-body.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-http-read-request-body.wir.wado @@ -251,7 +251,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -942,7 +942,7 @@ fn "core:internal/cm_stream_write_u8"(handle, data) { // from core:internal drop("mem/realloc"(ptr, len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/stream-http-response-body-multi.wir.wado b/wado-compiler/tests/fixtures.golden/stream-http-response-body-multi.wir.wado index 5df4b9107..3bb3e97e8 100644 --- a/wado-compiler/tests/fixtures.golden/stream-http-response-body-multi.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-http-response-body-multi.wir.wado @@ -245,7 +245,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -857,7 +857,7 @@ fn "core:internal/cm_stream_write_u8"(handle, data) { // from core:internal drop("mem/realloc"(ptr, len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/stream-http-response-body-string.wir.wado b/wado-compiler/tests/fixtures.golden/stream-http-response-body-string.wir.wado index 8d933eff7..52171a753 100644 --- a/wado-compiler/tests/fixtures.golden/stream-http-response-body-string.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-http-response-body-string.wir.wado @@ -253,7 +253,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -301,7 +301,7 @@ fn string_to_bytes(s) { multivalue_bind [__sroa___pattern_temp_0_discriminant, __sroa___pattern_temp_0_payload_0] = StrCharIter^Iterator::next(__iter_3); if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; - Array::append(bytes, c & 255); + Array::push(bytes, c & 255); } else { break b0; }; @@ -927,7 +927,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/stream-http-response-body.wir.wado b/wado-compiler/tests/fixtures.golden/stream-http-response-body.wir.wado index 21ff1318e..bcb7784fd 100644 --- a/wado-compiler/tests/fixtures.golden/stream-http-response-body.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-http-response-body.wir.wado @@ -245,7 +245,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -850,7 +850,7 @@ fn "core:internal/cm_stream_write_u8"(handle, data) { // from core:internal drop("mem/realloc"(ptr, len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/stream-read-basic.wir.wado b/wado-compiler/tests/fixtures.golden/stream-read-basic.wir.wado index 6a7ff0a16..b49456824 100644 --- a/wado-compiler/tests/fixtures.golden/stream-read-basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-read-basic.wir.wado @@ -76,9 +76,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -134,27 +134,27 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/stream-read-basic.wado"), used: 51 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_5, 114); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/stream-read-basic.wado"), used: 51 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_13 = __local_6; i32::fmt_decimal(13, __local_13); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: result.len() == 0 "), used: 30 }); - String::append(__local_5, String { repr: array.new_data("result.len(): "), used: 14 }); + String::push_str(__local_5, String { repr: array.new_data("result.len(): "), used: 14 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_18 = __local_6; i32::fmt_decimal(__v0, __local_18); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -431,7 +431,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -446,7 +446,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -484,7 +484,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l29; }; @@ -518,20 +518,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -541,10 +541,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -554,10 +554,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -565,10 +565,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stream-read-eof.wir.wado b/wado-compiler/tests/fixtures.golden/stream-read-eof.wir.wado index b5f0f403b..f704e9596 100644 --- a/wado-compiler/tests/fixtures.golden/stream-read-eof.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-read-eof.wir.wado @@ -76,9 +76,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -134,27 +134,27 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/stream-read-eof.wado"), used: 49 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_5, 114); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/stream-read-eof.wado"), used: 49 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_13 = __local_6; i32::fmt_decimal(13, __local_13); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: result.len() == 0 "), used: 30 }); - String::append(__local_5, String { repr: array.new_data("result.len(): "), used: 14 }); + String::push_str(__local_5, String { repr: array.new_data("result.len(): "), used: 14 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_18 = __local_6; i32::fmt_decimal(__v0, __local_18); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -431,7 +431,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -446,7 +446,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -484,7 +484,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l29; }; @@ -518,20 +518,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -541,10 +541,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -554,10 +554,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -565,10 +565,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stream-read-multiple.wir.wado b/wado-compiler/tests/fixtures.golden/stream-read-multiple.wir.wado index ded3d3f1b..6b7b5a7ba 100644 --- a/wado-compiler/tests/fixtures.golden/stream-read-multiple.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-read-multiple.wir.wado @@ -76,9 +76,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -145,33 +145,33 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/stream-read-multiple.wado"), used: 54 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/stream-read-multiple.wado"), used: 54 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_14 = __local_7; i32::fmt_decimal(21, __local_14); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: reads == 0 "), used: 23 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 101); - String::append_char(__local_6, 97); - String::append_char(__local_6, 100); - String::append_char(__local_6, 115); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 114); + String::push(__local_6, 101); + String::push(__local_6, 97); + String::push(__local_6, 100); + String::push(__local_6, 115); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_19 = __local_7; i32::fmt_decimal(__v0, __local_19); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -448,7 +448,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -463,7 +463,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -501,7 +501,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l32; }; @@ -535,20 +535,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -558,10 +558,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -571,10 +571,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -582,10 +582,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/stream-write-hello.wir.wado b/wado-compiler/tests/fixtures.golden/stream-write-hello.wir.wado index c30f0a255..15a15e28e 100644 --- a/wado-compiler/tests/fixtures.golden/stream-write-hello.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-write-hello.wir.wado @@ -50,7 +50,7 @@ type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -210,7 +210,7 @@ fn "core:internal/cm_stream_write_raw_u8"(handle, data, len) { // from core:int drop("mem/realloc"(ptr, raw_len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/stream-write-multiple.wir.wado b/wado-compiler/tests/fixtures.golden/stream-write-multiple.wir.wado index 07753dfaf..64fee12cd 100644 --- a/wado-compiler/tests/fixtures.golden/stream-write-multiple.wir.wado +++ b/wado-compiler/tests/fixtures.golden/stream-write-multiple.wir.wado @@ -50,7 +50,7 @@ type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -210,7 +210,7 @@ fn "core:internal/cm_stream_write_raw_u8"(handle, data, len) { // from core:int drop("mem/realloc"(ptr, raw_len, 1, 0)); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/string-truncate-panic.wir.wado b/wado-compiler/tests/fixtures.golden/string-truncate-panic.wir.wado index 3bb0bc24b..a3050a55b 100644 --- a/wado-compiler/tests/fixtures.golden/string-truncate-panic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/string-truncate-panic.wir.wado @@ -64,11 +64,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/String::truncate_bytes" = fn(ref String, i32); +type "functype/String::truncate" = fn(ref String, i32); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,13 +100,13 @@ import fn future-drop-readable:transmission-cli from "wasi/future-drop-readable: fn run() { let s: ref String; s = String { repr: array.new_data("日本語"), used: 9 }; - String::truncate_bytes(s, 4); + String::truncate(s, 4); } fn __cm_export__run() { let s: ref String; s = String { repr: array.new_data("日本語"), used: 9 }; - String::truncate_bytes(s, 4); + String::truncate(s, 4); "wasi/task-return"(0); } @@ -301,7 +301,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -316,7 +316,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -343,7 +343,7 @@ fn String::append_char(self, c) { }; } -fn String::truncate_bytes(self, byte_len) { +fn String::truncate(self, byte_len) { let __cond_3: bool; let b: u8; let __v1: bool; @@ -367,28 +367,28 @@ fn String::truncate_bytes(self, byte_len) { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("String::truncate_bytes"), used: 22 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("core:prelude/string.wado"), used: 24 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("String::truncate"), used: 16 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("core:prelude/string.wado"), used: 24 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_17 = __local_11; - i32::fmt_decimal(355, __local_17); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("negative length"), used: 15 }); - String::append(__local_10, String { repr: array.new_data(" + i32::fmt_decimal(365, __local_17); + String::push(__local_10, 58); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("negative length"), used: 15 }); + String::push_str(__local_10, String { repr: array.new_data(" condition: byte_len >= 0 "), used: 26 }); - String::append(__local_10, String { repr: array.new_data("byte_len: "), used: 10 }); + String::push_str(__local_10, String { repr: array.new_data("byte_len: "), used: 10 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_22 = __local_11; i32::fmt_decimal(byte_len, __local_22); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -405,31 +405,31 @@ condition: byte_len >= 0 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(220), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("String::truncate_bytes"), used: 22 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("core:prelude/string.wado"), used: 24 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("String::truncate"), used: 16 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("core:prelude/string.wado"), used: 24 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_28 = __local_13; - i32::fmt_decimal(360, __local_28); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("not on a UTF-8 character boundary"), used: 33 }); - String::append(__local_12, String { repr: array.new_data(" + i32::fmt_decimal(370, __local_28); + String::push(__local_12, 58); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("not on a UTF-8 character boundary"), used: 33 }); + String::push_str(__local_12, String { repr: array.new_data(" condition: b < 0x80 || b >= 0xC0 "), used: 34 }); - String::append_char(__local_12, 98); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 98); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_33 = __local_13; i32::fmt_decimal(b, __local_33); - String::append_char(__local_12, 10); - String::append(__local_12, String { repr: array.new_data("b < 0x80: "), used: 10 }); + String::push(__local_12, 10); + String::push_str(__local_12, String { repr: array.new_data("b < 0x80: "), used: 10 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_38 = __local_13; Formatter::pad(__local_38, if __v1 -> ref String { @@ -437,15 +437,15 @@ condition: b < 0x80 || b >= 0xC0 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); - String::append_char(__local_12, 98); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 10); + String::push(__local_12, 98); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_43 = __local_13; i32::fmt_decimal(b, __local_43); - String::append_char(__local_12, 10); - String::append(__local_12, String { repr: array.new_data("b >= 0xC0: "), used: 11 }); + String::push(__local_12, 10); + String::push_str(__local_12, String { repr: array.new_data("b >= 0xC0: "), used: 11 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_48 = __local_13; Formatter::pad(__local_48, if __v3 -> ref String { @@ -453,7 +453,7 @@ condition: b < 0x80 || b >= 0xC0 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -473,7 +473,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l30; }; @@ -493,7 +493,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -501,17 +501,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -541,20 +541,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -564,10 +564,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -577,10 +577,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -588,10 +588,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/string_from_utf8_lossy_newtype.wir.wado b/wado-compiler/tests/fixtures.golden/string_from_utf8_lossy_newtype.wir.wado index fd4dcf170..5d18c63f7 100644 --- a/wado-compiler/tests/fixtures.golden/string_from_utf8_lossy_newtype.wir.wado +++ b/wado-compiler/tests/fixtures.golden/string_from_utf8_lossy_newtype.wir.wado @@ -91,19 +91,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/String::from_utf8_lossy>" = fn(ref Array) -> ref String; type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref Option; -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -155,28 +155,28 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_5, 114); - String::append_char(__local_5, 117); - String::append_char(__local_5, 110); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/string_from_utf8_lossy_newtype.wado"), used: 64 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_5, 114); + String::push(__local_5, 117); + String::push(__local_5, 110); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/string_from_utf8_lossy_newtype.wado"), used: 64 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_24 = __local_6; i32::fmt_decimal(10, __local_24); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: s == \"Hello\" "), used: 25 }); - String::append_char(__local_5, 115); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 115); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -379,7 +379,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -467,7 +467,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -538,12 +538,12 @@ fn String::from_utf8_lossy>(bytes) { if ref.test Option::Some(b0_opt) { b0 = ref.cast Option::Some(b0_opt).payload_0; if b0 char { + String::push(builder, __inline_char__from_u32_unchecked_2: block -> char { __local_25 = b0; break __inline_char__from_u32_unchecked_2: __local_25; }); } else if b0 ^Iterator::next(iter); if ref.test Option::Some(__pattern_temp_1) { @@ -553,14 +553,14 @@ fn String::from_utf8_lossy>(bytes) { } else { b1_7 >u 191; } { - String::append_char(builder, 65533); + String::push(builder, 65533); pending = Option::Some { discriminant: 0, payload_0: b1_7 }; } else { code_8 = ((b0 & 31) << 6) | (b1_7 & 63); - String::append_char(builder, code_8); + String::push(builder, code_8); }; } else { - String::append_char(builder, 65533); + String::push(builder, 65533); }; } else if b0 ^Iterator::next(iter); @@ -583,7 +583,7 @@ fn String::from_utf8_lossy>(bytes) { } else { 0; } { - String::append_char(builder, 65533); + String::push(builder, 65533); pending = Option::Some { discriminant: 0, payload_0: b1_9 }; } else { __pattern_temp_3 = ArrayIter^Iterator::next(iter); @@ -594,18 +594,18 @@ fn String::from_utf8_lossy>(bytes) { } else { b2_10 >u 191; } { - String::append_char(builder, 65533); + String::push(builder, 65533); pending = Option::Some { discriminant: 0, payload_0: b2_10 }; } else { code_11 = (((b0 & 15) << 12) | ((b1_9 & 63) << 6)) | (b2_10 & 63); - String::append_char(builder, code_11); + String::push(builder, code_11); }; } else { - String::append_char(builder, 65533); + String::push(builder, 65533); }; }; } else { - String::append_char(builder, 65533); + String::push(builder, 65533); }; } else if b0 ^Iterator::next(iter); @@ -628,7 +628,7 @@ fn String::from_utf8_lossy>(bytes) { } else { 0; } { - String::append_char(builder, 65533); + String::push(builder, 65533); pending = Option::Some { discriminant: 0, payload_0: b1_12 }; } else { __pattern_temp_5 = ArrayIter^Iterator::next(iter); @@ -639,7 +639,7 @@ fn String::from_utf8_lossy>(bytes) { } else { b2_13 >u 191; } { - String::append_char(builder, 65533); + String::push(builder, 65533); pending = Option::Some { discriminant: 0, payload_0: b2_13 }; } else { __pattern_temp_6 = ArrayIter^Iterator::next(iter); @@ -650,25 +650,25 @@ fn String::from_utf8_lossy>(bytes) { } else { b3 >u 191; } { - String::append_char(builder, 65533); + String::push(builder, 65533); pending = Option::Some { discriminant: 0, payload_0: b3 }; } else { code_15 = ((((b0 & 7) << 18) | ((b1_12 & 63) << 12)) | ((b2_13 & 63) << 6)) | (b3 & 63); - String::append_char(builder, code_15); + String::push(builder, code_15); }; } else { - String::append_char(builder, 65533); + String::push(builder, 65533); }; }; } else { - String::append_char(builder, 65533); + String::push(builder, 65533); }; }; } else { - String::append_char(builder, 65533); + String::push(builder, 65533); }; } else { - String::append_char(builder, 65533); + String::push(builder, 65533); }; } else { break b32; @@ -689,7 +689,7 @@ fn ArrayIter^Iterator::next(self) { return Option::Some { discriminant: 0, payload_0: item }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -742,7 +742,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l74; }; @@ -776,20 +776,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -799,10 +799,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -812,10 +812,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -823,10 +823,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -838,7 +838,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -855,22 +855,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b93; @@ -878,7 +878,7 @@ fn String^Inspect::inspect(self, f) { continue l94; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/struct_1.wir.wado b/wado-compiler/tests/fixtures.golden/struct_1.wir.wado index 430fdb3f4..66833df20 100644 --- a/wado-compiler/tests/fixtures.golden/struct_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/struct_1.wir.wado @@ -119,7 +119,7 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -127,9 +127,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -328,25 +328,25 @@ fn __test_12_literal_restrict_condition() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_12_literal_restrict_condition"), used: 36 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_1.wado"), used: 42 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_12_literal_restrict_condition"), used: 36 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_1.wado"), used: 42 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_19 = __local_9; i32::fmt_decimal(197, __local_19); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: dispatch(0) == 100 "), used: 31 }); - String::append(__local_8, String { repr: array.new_data("dispatch(0): "), used: 13 }); + String::push_str(__local_8, String { repr: array.new_data("dispatch(0): "), used: 13 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_24 = __local_9; i32::fmt_decimal(__v0_0, __local_24); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -356,25 +356,25 @@ condition: dispatch(0) == 100 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_12_literal_restrict_condition"), used: 36 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_1.wado"), used: 42 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_12_literal_restrict_condition"), used: 36 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_1.wado"), used: 42 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_30 = __local_11; i32::fmt_decimal(198, __local_30); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: dispatch(1) == 200 "), used: 31 }); - String::append(__local_10, String { repr: array.new_data("dispatch(1): "), used: 13 }); + String::push_str(__local_10, String { repr: array.new_data("dispatch(1): "), used: 13 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_35 = __local_11; i32::fmt_decimal(__v0_2, __local_35); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -384,25 +384,25 @@ condition: dispatch(1) == 200 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_12_literal_restrict_condition"), used: 36 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_1.wado"), used: 42 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_12_literal_restrict_condition"), used: 36 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_1.wado"), used: 42 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_41 = __local_13; i32::fmt_decimal(199, __local_41); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: dispatch(2) == 300 "), used: 31 }); - String::append(__local_12, String { repr: array.new_data("dispatch(2): "), used: 13 }); + String::push_str(__local_12, String { repr: array.new_data("dispatch(2): "), used: 13 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_46 = __local_13; i32::fmt_decimal(__v0_4, __local_46); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -412,25 +412,25 @@ condition: dispatch(2) == 300 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_12_literal_restrict_condition"), used: 36 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_1.wado"), used: 42 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_12_literal_restrict_condition"), used: 36 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_1.wado"), used: 42 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_52 = __local_15; i32::fmt_decimal(200, __local_52); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: dispatch(3) == -1 "), used: 30 }); - String::append(__local_14, String { repr: array.new_data("dispatch(3): "), used: 13 }); + String::push_str(__local_14, String { repr: array.new_data("dispatch(3): "), used: 13 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_57 = __local_15; i32::fmt_decimal(__v0_6, __local_57); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -702,7 +702,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -798,7 +798,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -813,7 +813,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -851,7 +851,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l57; }; @@ -885,20 +885,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -908,10 +908,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -921,10 +921,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -932,10 +932,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/struct_2.wir.wado b/wado-compiler/tests/fixtures.golden/struct_2.wir.wado index 7461ce742..fa656c896 100644 --- a/wado-compiler/tests/fixtures.golden/struct_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/struct_2.wir.wado @@ -131,17 +131,17 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref null SDPoint; -type "functype/Array::append" = fn(ref Array, ref SDPoint); +type "functype/Array::push" = fn(ref Array, ref SDPoint); type "functype/Array::grow" = fn(ref Array); @@ -199,8 +199,8 @@ fn destruct_basic() with Stdout { __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_23 = __local_9; i32::fmt_decimal(x, __local_23); - String::append_char(__local_8, 44); - String::append_char(__local_8, 32); + String::push(__local_8, 44); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_28 = __local_9; i32::fmt_decimal(y, __local_28); @@ -213,8 +213,8 @@ fn destruct_basic() with Stdout { __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_34 = __local_11; i32::fmt_decimal(a, __local_34); - String::append_char(__local_10, 44); - String::append_char(__local_10, 32); + String::push(__local_10, 44); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_39 = __local_11; i32::fmt_decimal(b, __local_39); @@ -236,8 +236,8 @@ fn destruct_basic() with Stdout { __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_51 = __local_15; i32::fmt_decimal(mx, __local_51); - String::append_char(__local_14, 44); - String::append_char(__local_14, 32); + String::push(__local_14, 44); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_56 = __local_15; i32::fmt_decimal(my, __local_56); @@ -331,8 +331,8 @@ fn destruct_if_let() with Stdout { __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_22 = __local_10; i32::fmt_decimal(x_1, __local_22); - String::append_char(__local_9, 44); - String::append_char(__local_9, 32); + String::push(__local_9, 44); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_27 = __local_10; i32::fmt_decimal(y_2, __local_27); @@ -388,18 +388,18 @@ fn destruct_nested() with Stdout { __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_18 = __local_7; i32::fmt_decimal(x1, __local_18); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); + String::push(__local_6, 44); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_23 = __local_7; i32::fmt_decimal(y1, __local_23); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); + String::push(__local_6, 44); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_28 = __local_7; i32::fmt_decimal(x2, __local_28); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); + String::push(__local_6, 44); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_33 = __local_7; i32::fmt_decimal(y2, __local_33); @@ -442,8 +442,8 @@ fn destruct_rename() with Stdout { __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_22 = __local_10; i32::fmt_decimal(horizontal, __local_22); - String::append_char(__local_9, 44); - String::append_char(__local_9, 32); + String::push(__local_9, 44); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_27 = __local_10; i32::fmt_decimal(vertical, __local_27); @@ -456,8 +456,8 @@ fn destruct_rename() with Stdout { __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_33 = __local_12; i32::fmt_decimal(x, __local_33); - String::append_char(__local_11, 44); - String::append_char(__local_11, 32); + String::push(__local_11, 44); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_38 = __local_12; i32::fmt_decimal(vertical2, __local_38); @@ -472,8 +472,8 @@ fn destruct_rename() with Stdout { __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_44 = __local_14; i32::fmt_decimal(a, __local_44); - String::append_char(__local_13, 44); - String::append_char(__local_13, 32); + String::push(__local_13, 44); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_49 = __local_14; i32::fmt_decimal(b, __local_49); @@ -585,13 +585,13 @@ fn destruct_match() with Stdout { __local_11 = __match_scrut_2.y; __tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_15, 101); - String::append_char(__local_15, 113); - String::append_char(__local_15, 117); - String::append_char(__local_15, 97); - String::append_char(__local_15, 108); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 101); + String::push(__local_15, 113); + String::push(__local_15, 117); + String::push(__local_15, 97); + String::push(__local_15, 108); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(__local_10, __local_16); break __tmpl: __local_15; @@ -604,8 +604,8 @@ fn destruct_match() with Stdout { __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_28 = __local_18; i32::fmt_decimal(__local_12, __local_28); - String::append_char(__local_17, 44); - String::append_char(__local_17, 32); + String::push(__local_17, 44); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_33 = __local_18; i32::fmt_decimal(__local_13, __local_33); @@ -700,8 +700,8 @@ fn destruct_literal() with Stdout { __local_22 = __match_scrut_0.value; __tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_16, String { repr: array.new_data("matched int: "), used: 13 }); - String::append(__local_16, __local_1); + String::push_str(__local_16, String { repr: array.new_data("matched int: "), used: 13 }); + String::push_str(__local_16, __local_1); break __tmpl: __local_16; }; } else { @@ -716,8 +716,8 @@ fn destruct_literal() with Stdout { __local_23 = __match_scrut_1.flag; __tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_17, String { repr: array.new_data("matched bool: "), used: 14 }); - String::append(__local_17, __local_4); + String::push_str(__local_17, String { repr: array.new_data("matched bool: "), used: 14 }); + String::push_str(__local_17, __local_4); break __tmpl: __local_17; }; __local_5 = __match_scrut_1.label; @@ -727,8 +727,8 @@ fn destruct_literal() with Stdout { __local_24 = __match_scrut_1.flag; __tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_18, String { repr: array.new_data("not matched: "), used: 13 }); - String::append(__local_18, __local_5); + String::push_str(__local_18, String { repr: array.new_data("not matched: "), used: 13 }); + String::push_str(__local_18, __local_5); break __tmpl: __local_18; }; } else { @@ -743,8 +743,8 @@ fn destruct_literal() with Stdout { __local_25 = __match_scrut_2.ch; __tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_19, String { repr: array.new_data("matched char: "), used: 14 }); - String::append(__local_19, __local_8); + String::push_str(__local_19, String { repr: array.new_data("matched char: "), used: 14 }); + String::push_str(__local_19, __local_8); break __tmpl: __local_19; }; } else { @@ -759,8 +759,8 @@ fn destruct_literal() with Stdout { __local_26 = __match_scrut_3.second; __tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_20, String { repr: array.new_data("matched string: "), used: 16 }); - String::append(__local_20, __local_11); + String::push_str(__local_20, String { repr: array.new_data("matched string: "), used: 16 }); + String::push_str(__local_20, __local_11); break __tmpl: __local_20; }; } else { @@ -770,8 +770,8 @@ fn destruct_literal() with Stdout { __sroa_ip2_label = String { repr: array.new_data("test"), used: 4 }; "core:cli/println"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_21, String { repr: array.new_data("if-let int: "), used: 12 }); - String::append(__local_21, __sroa_ip2_label); + String::push_str(__local_21, String { repr: array.new_data("if-let int: "), used: 12 }); + String::push_str(__local_21, __sroa_ip2_label); break __tmpl: __local_21; }); bp2 = SDBoolPair { label: String { repr: array.new_data("check"), used: 5 }, flag: 0 }; @@ -1002,7 +1002,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1046,7 +1046,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1083,7 +1083,7 @@ fn ArrayIter^Iterator::next(self) { return item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1136,7 +1136,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l56; }; @@ -1170,20 +1170,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1193,10 +1193,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1206,10 +1206,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1217,10 +1217,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/struct_eq_auto.wir.wado b/wado-compiler/tests/fixtures.golden/struct_eq_auto.wir.wado index 8a2c764ae..519a62762 100644 --- a/wado-compiler/tests/fixtures.golden/struct_eq_auto.wir.wado +++ b/wado-compiler/tests/fixtures.golden/struct_eq_auto.wir.wado @@ -75,9 +75,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Point^Eq::eq" = fn(ref Point, ref Point) -> bool; @@ -162,34 +162,34 @@ fn run() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_27, 114); - String::append_char(__local_27, 117); - String::append_char(__local_27, 110); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto.wado"), used: 48 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_27, 114); + String::push(__local_27, 117); + String::push(__local_27, 110); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto.wado"), used: 48 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_43 = __local_28; i32::fmt_decimal(21, __local_43); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: a == b "), used: 19 }); - String::append_char(__local_27, 97); - String::append_char(__local_27, 58); - String::append_char(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 58); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; Point^Inspect::inspect(__v0_3, __local_28); - String::append_char(__local_27, 10); - String::append_char(__local_27, 98); - String::append_char(__local_27, 58); - String::append_char(__local_27, 32); + String::push(__local_27, 10); + String::push(__local_27, 98); + String::push(__local_27, 58); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; Point^Inspect::inspect(__v1_4, __local_28); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -201,42 +201,42 @@ condition: a == b if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_29, 114); - String::append_char(__local_29, 117); - String::append_char(__local_29, 110); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto.wado"), used: 48 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_29, 114); + String::push(__local_29, 117); + String::push(__local_29, 110); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto.wado"), used: 48 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_51 = __local_30; i32::fmt_decimal(22, __local_51); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: !a == c "), used: 20 }); - String::append_char(__local_29, 97); - String::append_char(__local_29, 58); - String::append_char(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 58); + String::push(__local_29, 32); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; Point^Inspect::inspect(__v0_6, __local_30); - String::append_char(__local_29, 10); - String::append_char(__local_29, 99); - String::append_char(__local_29, 58); - String::append_char(__local_29, 32); + String::push(__local_29, 10); + String::push(__local_29, 99); + String::push(__local_29, 58); + String::push(__local_29, 32); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; Point^Inspect::inspect(__v1_7, __local_30); - String::append_char(__local_29, 10); - String::append_char(__local_29, 97); - String::append_char(__local_29, 32); - String::append_char(__local_29, 61); - String::append_char(__local_29, 61); - String::append_char(__local_29, 32); - String::append_char(__local_29, 99); - String::append_char(__local_29, 58); - String::append_char(__local_29, 32); + String::push(__local_29, 10); + String::push(__local_29, 97); + String::push(__local_29, 32); + String::push(__local_29, 61); + String::push(__local_29, 61); + String::push(__local_29, 32); + String::push(__local_29, 99); + String::push(__local_29, 58); + String::push(__local_29, 32); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_58 = __local_30; Formatter::pad(__local_58, if __v2 -> ref String { @@ -244,7 +244,7 @@ condition: !a == c } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_29, 10); + String::push(__local_29, 10); break __tmpl: __local_29; }); unreachable; @@ -255,34 +255,34 @@ condition: !a == c if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_31, 114); - String::append_char(__local_31, 117); - String::append_char(__local_31, 110); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto.wado"), used: 48 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_31, 114); + String::push(__local_31, 117); + String::push(__local_31, 110); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto.wado"), used: 48 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_64 = __local_32; i32::fmt_decimal(23, __local_64); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: a != c "), used: 19 }); - String::append_char(__local_31, 97); - String::append_char(__local_31, 58); - String::append_char(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 58); + String::push(__local_31, 32); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; Point^Inspect::inspect(__v0_10, __local_32); - String::append_char(__local_31, 10); - String::append_char(__local_31, 99); - String::append_char(__local_31, 58); - String::append_char(__local_31, 32); + String::push(__local_31, 10); + String::push(__local_31, 99); + String::push(__local_31, 58); + String::push(__local_31, 32); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; Point^Inspect::inspect(__v1_11, __local_32); - String::append_char(__local_31, 10); + String::push(__local_31, 10); break __tmpl: __local_31; }); unreachable; @@ -296,40 +296,40 @@ condition: a != c if __cond_18 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_33, 114); - String::append_char(__local_33, 117); - String::append_char(__local_33, 110); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto.wado"), used: 48 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_33, 114); + String::push(__local_33, 117); + String::push(__local_33, 110); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto.wado"), used: 48 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_72 = __local_34; i32::fmt_decimal(29, __local_72); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: red1 == red2 "), used: 25 }); - String::append_char(__local_33, 114); - String::append_char(__local_33, 101); - String::append_char(__local_33, 100); - String::append_char(__local_33, 49); - String::append_char(__local_33, 58); - String::append_char(__local_33, 32); + String::push(__local_33, 114); + String::push(__local_33, 101); + String::push(__local_33, 100); + String::push(__local_33, 49); + String::push(__local_33, 58); + String::push(__local_33, 32); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; Color^Inspect::inspect(__v0_16, __local_34); - String::append_char(__local_33, 10); - String::append_char(__local_33, 114); - String::append_char(__local_33, 101); - String::append_char(__local_33, 100); - String::append_char(__local_33, 50); - String::append_char(__local_33, 58); - String::append_char(__local_33, 32); + String::push(__local_33, 10); + String::push(__local_33, 114); + String::push(__local_33, 101); + String::push(__local_33, 100); + String::push(__local_33, 50); + String::push(__local_33, 58); + String::push(__local_33, 32); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; Color^Inspect::inspect(__v1_17, __local_34); - String::append_char(__local_33, 10); + String::push(__local_33, 10); break __tmpl: __local_33; }); unreachable; @@ -340,40 +340,40 @@ condition: red1 == red2 if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_35 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_35, 114); - String::append_char(__local_35, 117); - String::append_char(__local_35, 110); - String::append_char(__local_35, 32); - String::append_char(__local_35, 97); - String::append_char(__local_35, 116); - String::append_char(__local_35, 32); - String::append(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto.wado"), used: 48 }); - String::append_char(__local_35, 58); + String::push_str(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_35, 114); + String::push(__local_35, 117); + String::push(__local_35, 110); + String::push(__local_35, 32); + String::push(__local_35, 97); + String::push(__local_35, 116); + String::push(__local_35, 32); + String::push_str(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto.wado"), used: 48 }); + String::push(__local_35, 58); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; __local_80 = __local_36; i32::fmt_decimal(30, __local_80); - String::append(__local_35, String { repr: array.new_data(" + String::push_str(__local_35, String { repr: array.new_data(" condition: red1 != blue "), used: 25 }); - String::append_char(__local_35, 114); - String::append_char(__local_35, 101); - String::append_char(__local_35, 100); - String::append_char(__local_35, 49); - String::append_char(__local_35, 58); - String::append_char(__local_35, 32); + String::push(__local_35, 114); + String::push(__local_35, 101); + String::push(__local_35, 100); + String::push(__local_35, 49); + String::push(__local_35, 58); + String::push(__local_35, 32); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; Color^Inspect::inspect(__v0_19, __local_36); - String::append_char(__local_35, 10); - String::append_char(__local_35, 98); - String::append_char(__local_35, 108); - String::append_char(__local_35, 117); - String::append_char(__local_35, 101); - String::append_char(__local_35, 58); - String::append_char(__local_35, 32); + String::push(__local_35, 10); + String::push(__local_35, 98); + String::push(__local_35, 108); + String::push(__local_35, 117); + String::push(__local_35, 101); + String::push(__local_35, 58); + String::push(__local_35, 32); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; Color^Inspect::inspect(__v1_20, __local_36); - String::append_char(__local_35, 10); + String::push(__local_35, 10); break __tmpl: __local_35; }); unreachable; @@ -576,7 +576,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -591,7 +591,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -655,17 +655,17 @@ fn Point^Inspect::inspect(self, f) { let s_13: ref String; let s_19: ref String; s_3 = String { repr: array.new_data("Point { "), used: 8 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("x: "), used: 3 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self.x, f); s_11 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); s_13 = String { repr: array.new_data("y: "), used: 3 }; - String::append(f.buf, s_13); + String::push_str(f.buf, s_13); i32::fmt_decimal(self.y, f); s_19 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); } fn Color^Inspect::inspect(self, f) { @@ -680,25 +680,25 @@ fn Color^Inspect::inspect(self, f) { let __sroa_self_value_29: u8; let __sroa_self_value_30: u8; s_3 = String { repr: array.new_data("Color { "), used: 8 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("r: "), used: 3 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); __sroa_self_value_28 = self.r; i32::fmt_decimal(__sroa_self_value_28, f); s_11 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); s_13 = String { repr: array.new_data("g: "), used: 3 }; - String::append(f.buf, s_13); + String::push_str(f.buf, s_13); __sroa_self_value_29 = self.g; i32::fmt_decimal(__sroa_self_value_29, f); s_19 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); s_21 = String { repr: array.new_data("b: "), used: 3 }; - String::append(f.buf, s_21); + String::push_str(f.buf, s_21); __sroa_self_value_30 = self.b; i32::fmt_decimal(__sroa_self_value_30, f); s_27 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_27); + String::push_str(f.buf, s_27); } fn Formatter::write_char_n(self, c, n) { @@ -712,7 +712,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l32; }; @@ -732,7 +732,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -740,17 +740,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -780,20 +780,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -803,10 +803,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -816,10 +816,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -827,10 +827,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/struct_eq_auto_generic.wir.wado b/wado-compiler/tests/fixtures.golden/struct_eq_auto_generic.wir.wado index b88f411b3..8ca35029e 100644 --- a/wado-compiler/tests/fixtures.golden/struct_eq_auto_generic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/struct_eq_auto_generic.wir.wado @@ -82,13 +82,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Pair^Inspect::inspect" = fn(ref Pair, ref Formatter); @@ -185,34 +185,34 @@ fn run() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_24, 114); - String::append_char(__local_24, 117); - String::append_char(__local_24, 110); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_24, 114); + String::push(__local_24, 117); + String::push(__local_24, 110); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_42 = __local_25; i32::fmt_decimal(13, __local_42); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: a == b "), used: 19 }); - String::append_char(__local_24, 97); - String::append_char(__local_24, 58); - String::append_char(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 58); + String::push(__local_24, 32); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; Pair^Inspect::inspect(__v0_3, __local_25); - String::append_char(__local_24, 10); - String::append_char(__local_24, 98); - String::append_char(__local_24, 58); - String::append_char(__local_24, 32); + String::push(__local_24, 10); + String::push(__local_24, 98); + String::push(__local_24, 58); + String::push(__local_24, 32); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; Pair^Inspect::inspect(__v1_4, __local_25); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -227,34 +227,34 @@ condition: a == b if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_26, 114); - String::append_char(__local_26, 117); - String::append_char(__local_26, 110); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_26, 114); + String::push(__local_26, 117); + String::push(__local_26, 110); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_52 = __local_27; i32::fmt_decimal(14, __local_52); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: a != c "), used: 19 }); - String::append_char(__local_26, 97); - String::append_char(__local_26, 58); - String::append_char(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 58); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; Pair^Inspect::inspect(__v0_6, __local_27); - String::append_char(__local_26, 10); - String::append_char(__local_26, 99); - String::append_char(__local_26, 58); - String::append_char(__local_26, 32); + String::push(__local_26, 10); + String::push(__local_26, 99); + String::push(__local_26, 58); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; Pair^Inspect::inspect(__v1_7, __local_27); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -265,34 +265,34 @@ condition: a != c if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_28, 114); - String::append_char(__local_28, 117); - String::append_char(__local_28, 110); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_28, 114); + String::push(__local_28, 117); + String::push(__local_28, 110); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_60 = __local_29; i32::fmt_decimal(17, __local_60); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: a < c "), used: 18 }); - String::append_char(__local_28, 97); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; Pair^Inspect::inspect(__v0_9, __local_29); - String::append_char(__local_28, 10); - String::append_char(__local_28, 99); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 10); + String::push(__local_28, 99); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; Pair^Inspect::inspect(__v1_10, __local_29); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -303,34 +303,34 @@ condition: a < c if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_30, 114); - String::append_char(__local_30, 117); - String::append_char(__local_30, 110); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_30, 114); + String::push(__local_30, 117); + String::push(__local_30, 110); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_68 = __local_31; i32::fmt_decimal(18, __local_68); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: c > a "), used: 18 }); - String::append_char(__local_30, 99); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 99); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; Pair^Inspect::inspect(__v0_12, __local_31); - String::append_char(__local_30, 10); - String::append_char(__local_30, 97); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 10); + String::push(__local_30, 97); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; Pair^Inspect::inspect(__v1_13, __local_31); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -344,36 +344,36 @@ condition: c > a if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_32, 114); - String::append_char(__local_32, 117); - String::append_char(__local_32, 110); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_32, 114); + String::push(__local_32, 117); + String::push(__local_32, 110); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_76 = __local_33; i32::fmt_decimal(24, __local_76); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: s1 == s2 "), used: 21 }); - String::append_char(__local_32, 115); - String::append_char(__local_32, 49); - String::append_char(__local_32, 58); - String::append_char(__local_32, 32); + String::push(__local_32, 115); + String::push(__local_32, 49); + String::push(__local_32, 58); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; Pair^Inspect::inspect(__v0_18, __local_33); - String::append_char(__local_32, 10); - String::append_char(__local_32, 115); - String::append_char(__local_32, 50); - String::append_char(__local_32, 58); - String::append_char(__local_32, 32); + String::push(__local_32, 10); + String::push(__local_32, 115); + String::push(__local_32, 50); + String::push(__local_32, 58); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; Pair^Inspect::inspect(__v1_19, __local_33); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -384,36 +384,36 @@ condition: s1 == s2 if __cond_23 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_34, 114); - String::append_char(__local_34, 117); - String::append_char(__local_34, 110); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_34, 114); + String::push(__local_34, 117); + String::push(__local_34, 110); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_generic.wado"), used: 56 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_84 = __local_35; i32::fmt_decimal(25, __local_84); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: s1 != s3 "), used: 21 }); - String::append_char(__local_34, 115); - String::append_char(__local_34, 49); - String::append_char(__local_34, 58); - String::append_char(__local_34, 32); + String::push(__local_34, 115); + String::push(__local_34, 49); + String::push(__local_34, 58); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; Pair^Inspect::inspect(__v0_21, __local_35); - String::append_char(__local_34, 10); - String::append_char(__local_34, 115); - String::append_char(__local_34, 51); - String::append_char(__local_34, 58); - String::append_char(__local_34, 32); + String::push(__local_34, 10); + String::push(__local_34, 115); + String::push(__local_34, 51); + String::push(__local_34, 58); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; Pair^Inspect::inspect(__v1_22, __local_35); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -626,7 +626,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -714,7 +714,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -748,17 +748,17 @@ fn Pair^Inspect::inspect(self, f) { let s_9: ref String; let s_11: ref String; s_3 = String { repr: array.new_data("Pair { "), used: 7 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("first: "), used: 7 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); String^Inspect::inspect(self.first, f); s_7 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_7); + String::push_str(f.buf, s_7); s_9 = String { repr: array.new_data("second: "), used: 8 }; - String::append(f.buf, s_9); + String::push_str(f.buf, s_9); String^Inspect::inspect(self.second, f); s_11 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); } fn Pair^Eq::eq(self, other) { @@ -790,17 +790,17 @@ fn Pair^Inspect::inspect(self, f) { let s_13: ref String; let s_19: ref String; s_3 = String { repr: array.new_data("Pair { "), used: 7 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("first: "), used: 7 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self.first, f); s_11 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); s_13 = String { repr: array.new_data("second: "), used: 8 }; - String::append(f.buf, s_13); + String::push_str(f.buf, s_13); i32::fmt_decimal(self.second, f); s_19 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); } fn Formatter::write_char_n(self, c, n) { @@ -814,7 +814,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l45; }; @@ -848,20 +848,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -871,10 +871,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -884,10 +884,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -895,10 +895,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -910,7 +910,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -927,22 +927,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b64; @@ -950,7 +950,7 @@ fn String^Inspect::inspect(self, f) { continue l65; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/struct_eq_auto_ord.wir.wado b/wado-compiler/tests/fixtures.golden/struct_eq_auto_ord.wir.wado index 0cb5e0d73..61eccee57 100644 --- a/wado-compiler/tests/fixtures.golden/struct_eq_auto_ord.wir.wado +++ b/wado-compiler/tests/fixtures.golden/struct_eq_auto_ord.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Point^Ord::cmp" = fn(ref Point, ref Point) -> enum:Ordering; @@ -168,34 +168,34 @@ fn run() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_28, 114); - String::append_char(__local_28, 117); - String::append_char(__local_28, 110); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_28, 114); + String::push(__local_28, 117); + String::push(__local_28, 110); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_48 = __local_29; i32::fmt_decimal(14, __local_48); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: a < b "), used: 18 }); - String::append_char(__local_28, 97); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; Point^Inspect::inspect(__v0_3, __local_29); - String::append_char(__local_28, 10); - String::append_char(__local_28, 98); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 10); + String::push(__local_28, 98); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; Point^Inspect::inspect(__v1_4, __local_29); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -206,34 +206,34 @@ condition: a < b if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_30, 114); - String::append_char(__local_30, 117); - String::append_char(__local_30, 110); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_30, 114); + String::push(__local_30, 117); + String::push(__local_30, 110); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_56 = __local_31; i32::fmt_decimal(15, __local_56); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: b > a "), used: 18 }); - String::append_char(__local_30, 98); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 98); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; Point^Inspect::inspect(__v0_6, __local_31); - String::append_char(__local_30, 10); - String::append_char(__local_30, 97); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 10); + String::push(__local_30, 97); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; Point^Inspect::inspect(__v1_7, __local_31); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -244,34 +244,34 @@ condition: b > a if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_32, 114); - String::append_char(__local_32, 117); - String::append_char(__local_32, 110); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_32, 114); + String::push(__local_32, 117); + String::push(__local_32, 110); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_64 = __local_33; i32::fmt_decimal(16, __local_64); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: a <= b "), used: 19 }); - String::append_char(__local_32, 97); - String::append_char(__local_32, 58); - String::append_char(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 58); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; Point^Inspect::inspect(__v0_9, __local_33); - String::append_char(__local_32, 10); - String::append_char(__local_32, 98); - String::append_char(__local_32, 58); - String::append_char(__local_32, 32); + String::push(__local_32, 10); + String::push(__local_32, 98); + String::push(__local_32, 58); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; Point^Inspect::inspect(__v1_10, __local_33); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -282,34 +282,34 @@ condition: a <= b if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_34, 114); - String::append_char(__local_34, 117); - String::append_char(__local_34, 110); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_34, 114); + String::push(__local_34, 117); + String::push(__local_34, 110); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_72 = __local_35; i32::fmt_decimal(17, __local_72); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: b >= a "), used: 19 }); - String::append_char(__local_34, 98); - String::append_char(__local_34, 58); - String::append_char(__local_34, 32); + String::push(__local_34, 98); + String::push(__local_34, 58); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; Point^Inspect::inspect(__v0_12, __local_35); - String::append_char(__local_34, 10); - String::append_char(__local_34, 97); - String::append_char(__local_34, 58); - String::append_char(__local_34, 32); + String::push(__local_34, 10); + String::push(__local_34, 97); + String::push(__local_34, 58); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; Point^Inspect::inspect(__v1_13, __local_35); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -320,34 +320,34 @@ condition: b >= a if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_36, 114); - String::append_char(__local_36, 117); - String::append_char(__local_36, 110); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_36, 114); + String::push(__local_36, 117); + String::push(__local_36, 110); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_80 = __local_37; i32::fmt_decimal(20, __local_80); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: a < c "), used: 18 }); - String::append_char(__local_36, 97); - String::append_char(__local_36, 58); - String::append_char(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 58); + String::push(__local_36, 32); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; Point^Inspect::inspect(__v0_15, __local_37); - String::append_char(__local_36, 10); - String::append_char(__local_36, 99); - String::append_char(__local_36, 58); - String::append_char(__local_36, 32); + String::push(__local_36, 10); + String::push(__local_36, 99); + String::push(__local_36, 58); + String::push(__local_36, 32); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; Point^Inspect::inspect(__v1_16, __local_37); - String::append_char(__local_36, 10); + String::push(__local_36, 10); break __tmpl: __local_36; }); unreachable; @@ -358,34 +358,34 @@ condition: a < c if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_38, 114); - String::append_char(__local_38, 117); - String::append_char(__local_38, 110); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_38, 114); + String::push(__local_38, 117); + String::push(__local_38, 110); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_88 = __local_39; i32::fmt_decimal(21, __local_88); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: c > a "), used: 18 }); - String::append_char(__local_38, 99); - String::append_char(__local_38, 58); - String::append_char(__local_38, 32); + String::push(__local_38, 99); + String::push(__local_38, 58); + String::push(__local_38, 32); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; Point^Inspect::inspect(__v0_18, __local_39); - String::append_char(__local_38, 10); - String::append_char(__local_38, 97); - String::append_char(__local_38, 58); - String::append_char(__local_38, 32); + String::push(__local_38, 10); + String::push(__local_38, 97); + String::push(__local_38, 58); + String::push(__local_38, 32); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; Point^Inspect::inspect(__v1_19, __local_39); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; @@ -397,34 +397,34 @@ condition: c > a if __cond_24 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_40, 114); - String::append_char(__local_40, 117); - String::append_char(__local_40, 110); - String::append_char(__local_40, 32); - String::append_char(__local_40, 97); - String::append_char(__local_40, 116); - String::append_char(__local_40, 32); - String::append(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); - String::append_char(__local_40, 58); + String::push_str(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_40, 114); + String::push(__local_40, 117); + String::push(__local_40, 110); + String::push(__local_40, 32); + String::push(__local_40, 97); + String::push(__local_40, 116); + String::push(__local_40, 32); + String::push_str(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); + String::push(__local_40, 58); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_96 = __local_41; i32::fmt_decimal(25, __local_96); - String::append(__local_40, String { repr: array.new_data(" + String::push_str(__local_40, String { repr: array.new_data(" condition: a <= d "), used: 19 }); - String::append_char(__local_40, 97); - String::append_char(__local_40, 58); - String::append_char(__local_40, 32); + String::push(__local_40, 97); + String::push(__local_40, 58); + String::push(__local_40, 32); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; Point^Inspect::inspect(__v0_22, __local_41); - String::append_char(__local_40, 10); - String::append_char(__local_40, 100); - String::append_char(__local_40, 58); - String::append_char(__local_40, 32); + String::push(__local_40, 10); + String::push(__local_40, 100); + String::push(__local_40, 58); + String::push(__local_40, 32); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; Point^Inspect::inspect(__v1_23, __local_41); - String::append_char(__local_40, 10); + String::push(__local_40, 10); break __tmpl: __local_40; }); unreachable; @@ -435,34 +435,34 @@ condition: a <= d if __cond_27 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_42, 114); - String::append_char(__local_42, 117); - String::append_char(__local_42, 110); - String::append_char(__local_42, 32); - String::append_char(__local_42, 97); - String::append_char(__local_42, 116); - String::append_char(__local_42, 32); - String::append(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); - String::append_char(__local_42, 58); + String::push_str(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_42, 114); + String::push(__local_42, 117); + String::push(__local_42, 110); + String::push(__local_42, 32); + String::push(__local_42, 97); + String::push(__local_42, 116); + String::push(__local_42, 32); + String::push_str(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_ord.wado"), used: 52 }); + String::push(__local_42, 58); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_104 = __local_43; i32::fmt_decimal(26, __local_104); - String::append(__local_42, String { repr: array.new_data(" + String::push_str(__local_42, String { repr: array.new_data(" condition: a >= d "), used: 19 }); - String::append_char(__local_42, 97); - String::append_char(__local_42, 58); - String::append_char(__local_42, 32); + String::push(__local_42, 97); + String::push(__local_42, 58); + String::push(__local_42, 32); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; Point^Inspect::inspect(__v0_25, __local_43); - String::append_char(__local_42, 10); - String::append_char(__local_42, 100); - String::append_char(__local_42, 58); - String::append_char(__local_42, 32); + String::push(__local_42, 10); + String::push(__local_42, 100); + String::push(__local_42, 58); + String::push(__local_42, 32); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; Point^Inspect::inspect(__v1_26, __local_43); - String::append_char(__local_42, 10); + String::push(__local_42, 10); break __tmpl: __local_42; }); unreachable; @@ -675,7 +675,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -690,7 +690,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -738,17 +738,17 @@ fn Point^Inspect::inspect(self, f) { let s_13: ref String; let s_19: ref String; s_3 = String { repr: array.new_data("Point { "), used: 8 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("x: "), used: 3 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self.x, f); s_11 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); s_13 = String { repr: array.new_data("y: "), used: 3 }; - String::append(f.buf, s_13); + String::push_str(f.buf, s_13); i32::fmt_decimal(self.y, f); s_19 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); } fn Formatter::write_char_n(self, c, n) { @@ -762,7 +762,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -796,20 +796,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -819,10 +819,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -832,10 +832,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -843,10 +843,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/struct_eq_auto_user_override.wir.wado b/wado-compiler/tests/fixtures.golden/struct_eq_auto_user_override.wir.wado index 800531612..3e6369513 100644 --- a/wado-compiler/tests/fixtures.golden/struct_eq_auto_user_override.wir.wado +++ b/wado-compiler/tests/fixtures.golden/struct_eq_auto_user_override.wir.wado @@ -93,7 +93,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -103,9 +103,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -191,34 +191,34 @@ fn run() { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_9, 114); - String::append_char(__local_9, 117); - String::append_char(__local_9, 110); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_user_override.wado"), used: 62 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_9, 114); + String::push(__local_9, 117); + String::push(__local_9, 110); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_user_override.wado"), used: 62 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_16 = __local_10; i32::fmt_decimal(21, __local_16); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: a == b "), used: 19 }); - String::append_char(__local_9, 97); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; ApproxFloat^Inspect::inspect(__v0_3.value, __local_10); - String::append_char(__local_9, 10); - String::append_char(__local_9, 98); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 10); + String::push(__local_9, 98); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; ApproxFloat^Inspect::inspect(__v1_4.value, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -229,34 +229,34 @@ condition: a == b if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_11, 114); - String::append_char(__local_11, 117); - String::append_char(__local_11, 110); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_user_override.wado"), used: 62 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_11, 114); + String::push(__local_11, 117); + String::push(__local_11, 110); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/struct_eq_auto_user_override.wado"), used: 62 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_24 = __local_12; i32::fmt_decimal(22, __local_24); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: a != c "), used: 19 }); - String::append_char(__local_11, 97); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; ApproxFloat^Inspect::inspect(__v0_6.value, __local_12); - String::append_char(__local_11, 10); - String::append_char(__local_11, 99); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 10); + String::push(__local_11, 99); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; ApproxFloat^Inspect::inspect(__v1_7.value, __local_12); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -988,8 +988,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1044,13 +1044,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -1058,25 +1058,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -1084,7 +1084,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -1126,8 +1126,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1159,7 +1159,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1288,27 +1288,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1431,9 +1431,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -1443,8 +1443,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -1499,13 +1499,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1540,9 +1540,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1595,7 +1595,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1610,7 +1610,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1654,12 +1654,12 @@ fn ApproxFloat^Inspect::inspect(self, f) { let s_5: ref String; let s_9: ref String; s_3 = String { repr: array.new_data("ApproxFloat { "), used: 14 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("value: "), used: 7 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); f64::inspect_into(self, f); s_9 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_9); + String::push_str(f.buf, s_9); } fn Formatter::write_char_n(self, c, n) { @@ -1673,7 +1673,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l164; }; @@ -1831,20 +1831,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1854,10 +1854,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1867,10 +1867,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1878,10 +1878,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/struct_implicit_error_no_type.wir.wado b/wado-compiler/tests/fixtures.golden/struct_implicit_error_no_type.wir.wado index e33f7bb2d..cac59c134 100644 --- a/wado-compiler/tests/fixtures.golden/struct_implicit_error_no_type.wir.wado +++ b/wado-compiler/tests/fixtures.golden/struct_implicit_error_no_type.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -103,8 +103,8 @@ fn run() with Stdout { __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_7 = __local_2; i32::fmt_decimal(1, __local_7); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_12 = __local_2; i32::fmt_decimal(2, __local_12); @@ -307,7 +307,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -322,7 +322,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -360,7 +360,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -394,20 +394,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -417,10 +417,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -430,10 +430,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -441,10 +441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/struct_import_alias.wir.wado b/wado-compiler/tests/fixtures.golden/struct_import_alias.wir.wado index b3c8ff301..cd042515d 100644 --- a/wado-compiler/tests/fixtures.golden/struct_import_alias.wir.wado +++ b/wado-compiler/tests/fixtures.golden/struct_import_alias.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,18 +100,18 @@ fn run() with Stdout { let __local_4: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_1, 115); - String::append_char(__local_1, 117); - String::append_char(__local_1, 109); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 115); + String::push(__local_1, 117); + String::push(__local_1, 109); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(14, __local_2); break __tmpl: __local_1; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_3, String { repr: array.new_data("product: "), used: 9 }); + String::push_str(__local_3, String { repr: array.new_data("product: "), used: 9 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(40, __local_4); break __tmpl: __local_3; @@ -313,7 +313,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -328,7 +328,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -366,7 +366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -400,20 +400,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/struct_import_collision.wir.wado b/wado-compiler/tests/fixtures.golden/struct_import_collision.wir.wado index 10b029a9a..ff07e07ba 100644 --- a/wado-compiler/tests/fixtures.golden/struct_import_collision.wir.wado +++ b/wado-compiler/tests/fixtures.golden/struct_import_collision.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,21 +102,21 @@ fn run() with Stdout { let __local_7: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_2, String { repr: array.new_data("local total: "), used: 13 }); + String::push_str(__local_2, String { repr: array.new_data("local total: "), used: 13 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(6, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_4, String { repr: array.new_data("other sum: "), used: 11 }); + String::push_str(__local_4, String { repr: array.new_data("other sum: "), used: 11 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(14, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_6, String { repr: array.new_data("other product: "), used: 15 }); + String::push_str(__local_6, String { repr: array.new_data("other product: "), used: 15 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(40, __local_7); break __tmpl: __local_6; @@ -318,7 +318,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -333,7 +333,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -371,7 +371,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -405,20 +405,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -428,10 +428,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -441,10 +441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -452,10 +452,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/struct_name_conflict.wir.wado b/wado-compiler/tests/fixtures.golden/struct_name_conflict.wir.wado index 5b98a1119..080117d9b 100644 --- a/wado-compiler/tests/fixtures.golden/struct_name_conflict.wir.wado +++ b/wado-compiler/tests/fixtures.golden/struct_name_conflict.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -109,31 +109,31 @@ fn run() with Stdout { let __local_51: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_2, String { repr: array.new_data("local total: "), used: 13 }); + String::push_str(__local_2, String { repr: array.new_data("local total: "), used: 13 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(6, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_4, String { repr: array.new_data("remote sum: "), used: 12 }); + String::push_str(__local_4, String { repr: array.new_data("remote sum: "), used: 12 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(30, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(66), used: 0 }; - String::append(__local_6, String { repr: array.new_data("local fields: "), used: 14 }); + String::push_str(__local_6, String { repr: array.new_data("local fields: "), used: 14 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_30 = __local_7; i32::fmt_decimal(1, __local_30); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); + String::push(__local_6, 44); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_35 = __local_7; i32::fmt_decimal(2, __local_35); - String::append_char(__local_6, 44); - String::append_char(__local_6, 32); + String::push(__local_6, 44); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_40 = __local_7; i32::fmt_decimal(3, __local_40); @@ -141,12 +141,12 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(49), used: 0 }; - String::append(__local_8, String { repr: array.new_data("remote fields: "), used: 15 }); + String::push_str(__local_8, String { repr: array.new_data("remote fields: "), used: 15 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_46 = __local_9; i32::fmt_decimal(10, __local_46); - String::append_char(__local_8, 44); - String::append_char(__local_8, 32); + String::push(__local_8, 44); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_51 = __local_9; i32::fmt_decimal(20, __local_51); @@ -349,7 +349,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -364,7 +364,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -402,7 +402,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -436,20 +436,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -459,10 +459,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -472,10 +472,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -483,10 +483,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/template-string-generic.wir.wado b/wado-compiler/tests/fixtures.golden/template-string-generic.wir.wado index 83750b0fd..cdae33fbb 100644 --- a/wado-compiler/tests/fixtures.golden/template-string-generic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/template-string-generic.wir.wado @@ -98,13 +98,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -159,24 +159,24 @@ fn __test_0_display_integer() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_0_display_integer"), used: 24 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_0_display_integer"), used: 24 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_18 = __local_4; i32::fmt_decimal(29, __local_18); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: b.display_value() == \"42\" "), used: 38 }); - String::append(__local_3, String { repr: array.new_data("b.display_value(): "), used: 19 }); + String::push_str(__local_3, String { repr: array.new_data("b.display_value(): "), used: 19 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -201,24 +201,24 @@ fn __test_1_inspect_integer() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_1_inspect_integer"), used: 24 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_1_inspect_integer"), used: 24 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_18 = __local_4; i32::fmt_decimal(34, __local_18); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: b.inspect_value() == \"42\" "), used: 38 }); - String::append(__local_3, String { repr: array.new_data("b.inspect_value(): "), used: 19 }); + String::push_str(__local_3, String { repr: array.new_data("b.inspect_value(): "), used: 19 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -245,24 +245,24 @@ fn __test_2_display_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_2_display_string"), used: 23 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_2_display_string"), used: 23 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_16 = __local_4; i32::fmt_decimal(40, __local_16); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: b.display_value() == \"hello\" "), used: 41 }); - String::append(__local_3, String { repr: array.new_data("b.display_value(): "), used: 19 }); + String::push_str(__local_3, String { repr: array.new_data("b.display_value(): "), used: 19 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -289,24 +289,24 @@ fn __test_3_inspect_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(152), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_3_inspect_string"), used: 23 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_3_inspect_string"), used: 23 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; i32::fmt_decimal(45, __local_14); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: b.inspect_value() == `\"hello\"` "), used: 43 }); - String::append(__local_3, String { repr: array.new_data("b.inspect_value(): "), used: 19 }); + String::push_str(__local_3, String { repr: array.new_data("b.inspect_value(): "), used: 19 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -324,24 +324,24 @@ fn __test_4_both_display_and_inspect_for_integer() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_4_both_display_and_inspect_for_integer"), used: 45 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_4_both_display_and_inspect_for_integer"), used: 45 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(51, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: b.both() == \"display=99 inspect=99\" "), used: 48 }); - String::append(__local_3, String { repr: array.new_data("b.both(): "), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("b.both(): "), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -359,24 +359,24 @@ fn __test_5_both_display_and_inspect_for_string() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(156), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_5_both_display_and_inspect_for_string"), used: 44 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_5_both_display_and_inspect_for_string"), used: 44 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(56, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: b.both() == `display=world inspect=\"world\"` "), used: 56 }); - String::append(__local_3, String { repr: array.new_data("b.both(): "), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("b.both(): "), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -403,24 +403,24 @@ fn __test_6_display_bool() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_6_display_bool"), used: 21 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_6_display_bool"), used: 21 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_18 = __local_4; i32::fmt_decimal(62, __local_18); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: b.display_value() == \"true\" "), used: 40 }); - String::append(__local_3, String { repr: array.new_data("b.display_value(): "), used: 19 }); + String::push_str(__local_3, String { repr: array.new_data("b.display_value(): "), used: 19 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -447,24 +447,24 @@ fn __test_7_inspect_bool() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_7_inspect_bool"), used: 21 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_7_inspect_bool"), used: 21 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/template-string-generic.wado"), used: 57 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_18 = __local_4; i32::fmt_decimal(67, __local_18); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: b.inspect_value() == \"true\" "), used: 40 }); - String::append(__local_3, String { repr: array.new_data("b.inspect_value(): "), used: 19 }); + String::push_str(__local_3, String { repr: array.new_data("b.inspect_value(): "), used: 19 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(__v0, __local_4); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -702,7 +702,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -790,7 +790,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -824,19 +824,19 @@ fn Box::both(self) { let __local_6: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(49), used: 0 }; - String::append_char(__local_1, 100); - String::append_char(__local_1, 105); - String::append_char(__local_1, 115); - String::append_char(__local_1, 112); - String::append_char(__local_1, 108); - String::append_char(__local_1, 97); - String::append_char(__local_1, 121); - String::append_char(__local_1, 61); + String::push(__local_1, 100); + String::push(__local_1, 105); + String::push(__local_1, 115); + String::push(__local_1, 112); + String::push(__local_1, 108); + String::push(__local_1, 97); + String::push(__local_1, 121); + String::push(__local_1, 61); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_5 = self; __local_6 = __local_2; Formatter::pad(__local_6, __local_5); - String::append(__local_1, String { repr: array.new_data(" inspect="), used: 9 }); + String::push_str(__local_1, String { repr: array.new_data(" inspect="), used: 9 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; String^Inspect::inspect(self, __local_2); break __tmpl: __local_1; @@ -850,18 +850,18 @@ fn Box::both(self) { let __local_11: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(49), used: 0 }; - String::append_char(__local_1, 100); - String::append_char(__local_1, 105); - String::append_char(__local_1, 115); - String::append_char(__local_1, 112); - String::append_char(__local_1, 108); - String::append_char(__local_1, 97); - String::append_char(__local_1, 121); - String::append_char(__local_1, 61); + String::push(__local_1, 100); + String::push(__local_1, 105); + String::push(__local_1, 115); + String::push(__local_1, 112); + String::push(__local_1, 108); + String::push(__local_1, 97); + String::push(__local_1, 121); + String::push(__local_1, 61); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_6 = __local_2; i32::fmt_decimal(self, __local_6); - String::append(__local_1, String { repr: array.new_data(" inspect="), used: 9 }); + String::push_str(__local_1, String { repr: array.new_data(" inspect="), used: 9 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_11 = __local_2; i32::fmt_decimal(self, __local_11); @@ -880,7 +880,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l40; }; @@ -900,7 +900,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -908,17 +908,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -948,20 +948,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -971,10 +971,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -984,10 +984,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -995,10 +995,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1010,7 +1010,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1027,22 +1027,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b63; @@ -1050,7 +1050,7 @@ fn String^Inspect::inspect(self, f) { continue l64; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_display_integer as "__test_0_display_integer" diff --git a/wado-compiler/tests/fixtures.golden/template_string.wir.wado b/wado-compiler/tests/fixtures.golden/template_string.wir.wado index 3760b3623..e0ec4a510 100644 --- a/wado-compiler/tests/fixtures.golden/template_string.wir.wado +++ b/wado-compiler/tests/fixtures.golden/template_string.wir.wado @@ -115,7 +115,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -125,9 +125,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -191,12 +191,12 @@ fn template_string_bool() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_2, 116); - String::append_char(__local_2, 114); - String::append_char(__local_2, 117); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 116); + String::push(__local_2, 114); + String::push(__local_2, 117); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; Formatter::pad(__local_3, block -> ref String { String { repr: array.new_data("true"), used: 4 }; @@ -205,13 +205,13 @@ fn template_string_bool() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_4, 102); - String::append_char(__local_4, 97); - String::append_char(__local_4, 108); - String::append_char(__local_4, 115); - String::append_char(__local_4, 101); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 102); + String::push(__local_4, 97); + String::push(__local_4, 108); + String::push(__local_4, 115); + String::push(__local_4, 101); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; Formatter::pad(__local_5, block -> ref String { String { repr: array.new_data("false"), used: 5 }; @@ -227,28 +227,28 @@ fn template_string_char() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_2, 99); - String::append_char(__local_2, 104); - String::append_char(__local_2, 97); - String::append_char(__local_2, 114); - String::append_char(__local_2, 32); - String::append_char(__local_2, 65); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 99); + String::push(__local_2, 104); + String::push(__local_2, 97); + String::push(__local_2, 114); + String::push(__local_2, 32); + String::push(__local_2, 65); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; char^Display::fmt(65, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_4, 99); - String::append_char(__local_4, 104); - String::append_char(__local_4, 97); - String::append_char(__local_4, 114); - String::append_char(__local_4, 32); - String::append_char(__local_4, 90); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 99); + String::push(__local_4, 104); + String::push(__local_4, 97); + String::push(__local_4, 114); + String::push(__local_4, 32); + String::push(__local_4, 90); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; char^Display::fmt(90, __local_5); break __tmpl: __local_4; @@ -262,17 +262,17 @@ fn template_string_f64() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_2, 112); - String::append_char(__local_2, 105); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 112); + String::push(__local_2, 105); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; f64::fmt_into(3.14159, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_4, String { repr: array.new_data("negative: "), used: 10 }); + String::push_str(__local_4, String { repr: array.new_data("negative: "), used: 10 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; f64::fmt_into(-2.5, __local_5); break __tmpl: __local_4; @@ -288,26 +288,26 @@ fn template_string_i32() with Stdout { let __local_8: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_3, String { repr: array.new_data("positive: "), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("positive: "), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(42, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_5, String { repr: array.new_data("negative: "), used: 10 }); + String::push_str(__local_5, String { repr: array.new_data("negative: "), used: 10 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(-17, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_7, 122); - String::append_char(__local_7, 101); - String::append_char(__local_7, 114); - String::append_char(__local_7, 111); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 122); + String::push(__local_7, 101); + String::push(__local_7, 114); + String::push(__local_7, 111); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(0, __local_8); break __tmpl: __local_7; @@ -323,25 +323,25 @@ fn template_string_i64() with Stdout { let __local_8: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_3, String { repr: array.new_data("positive: "), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("positive: "), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i64::fmt_decimal(12345_i64, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_5, 98); - String::append_char(__local_5, 105); - String::append_char(__local_5, 103); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 98); + String::push(__local_5, 105); + String::push(__local_5, 103); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i64::fmt_decimal(100000000000_i64, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_7, String { repr: array.new_data("negative: "), used: 10 }); + String::push_str(__local_7, String { repr: array.new_data("negative: "), used: 10 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i64::fmt_decimal(-9876_i64, __local_8); break __tmpl: __local_7; @@ -366,13 +366,13 @@ Line 3"), used: 20 }; name = String { repr: array.new_data("Alice"), used: 5 }; greeting = __tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(54), used: 0 }; - String::append_char(__local_6, 68); - String::append_char(__local_6, 101); - String::append_char(__local_6, 97); - String::append_char(__local_6, 114); - String::append_char(__local_6, 32); - String::append(__local_6, name); - String::append(__local_6, String { repr: array.new_data(", + String::push(__local_6, 68); + String::push(__local_6, 101); + String::push(__local_6, 97); + String::push(__local_6, 114); + String::push(__local_6, 32); + String::push_str(__local_6, name); + String::push_str(__local_6, String { repr: array.new_data(", Welcome to Wado! @@ -382,27 +382,27 @@ Best regards"), used: 33 }); "core:cli/println"(greeting); result = __tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(70), used: 0 }; - String::append_char(__local_7, 70); - String::append_char(__local_7, 105); - String::append_char(__local_7, 114); - String::append_char(__local_7, 115); - String::append_char(__local_7, 116); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 70); + String::push(__local_7, 105); + String::push(__local_7, 114); + String::push(__local_7, 115); + String::push(__local_7, 116); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_13 = __local_8; i32::fmt_decimal(1, __local_13); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" Second: "), used: 9 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_18 = __local_8; i32::fmt_decimal(2, __local_18); - String::append_char(__local_7, 10); - String::append_char(__local_7, 83); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 10); + String::push(__local_7, 83); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_23 = __local_8; i32::fmt_decimal(3, __local_23); @@ -422,15 +422,15 @@ fn template_string_three_interp() with Stdout { s3 = String { repr: array.new_data("Z"), used: 1 }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(54), used: 0 }; - String::append(__local_3, s1); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 32); - String::append(__local_3, s2); - String::append_char(__local_3, 32); - String::append_char(__local_3, 99); - String::append_char(__local_3, 32); - String::append(__local_3, s3); + String::push_str(__local_3, s1); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 32); + String::push_str(__local_3, s2); + String::push(__local_3, 32); + String::push(__local_3, 99); + String::push(__local_3, 32); + String::push_str(__local_3, s3); break __tmpl: __local_3; }); } @@ -443,13 +443,13 @@ fn template_string_two_end() with Stdout { s2 = String { repr: array.new_data("Y"), used: 1 }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(37), used: 0 }; - String::append_char(__local_2, 97); - String::append_char(__local_2, 32); - String::append(__local_2, s1); - String::append_char(__local_2, 32); - String::append_char(__local_2, 98); - String::append_char(__local_2, 32); - String::append(__local_2, s2); + String::push(__local_2, 97); + String::push(__local_2, 32); + String::push_str(__local_2, s1); + String::push(__local_2, 32); + String::push(__local_2, 98); + String::push(__local_2, 32); + String::push_str(__local_2, s2); break __tmpl: __local_2; }); } @@ -462,13 +462,13 @@ fn template_string_two_interp() with Stdout { s2 = String { repr: array.new_data("Y"), used: 1 }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(37), used: 0 }; - String::append(__local_2, s1); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 32); - String::append(__local_2, s2); - String::append_char(__local_2, 32); - String::append_char(__local_2, 99); + String::push_str(__local_2, s1); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 32); + String::push_str(__local_2, s2); + String::push(__local_2, 32); + String::push(__local_2, 99); break __tmpl: __local_2; }); } @@ -481,15 +481,15 @@ fn template_string_two_middle() with Stdout { s2 = String { repr: array.new_data("Y"), used: 1 }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_2, 97); - String::append_char(__local_2, 32); - String::append(__local_2, s1); - String::append_char(__local_2, 32); - String::append_char(__local_2, 98); - String::append_char(__local_2, 32); - String::append(__local_2, s2); - String::append_char(__local_2, 32); - String::append_char(__local_2, 99); + String::push(__local_2, 97); + String::push(__local_2, 32); + String::push_str(__local_2, s1); + String::push(__local_2, 32); + String::push(__local_2, 98); + String::push(__local_2, 32); + String::push_str(__local_2, s2); + String::push(__local_2, 32); + String::push(__local_2, 99); break __tmpl: __local_2; }); } @@ -1297,8 +1297,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1353,8 +1353,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1386,7 +1386,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1515,27 +1515,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1695,9 +1695,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1751,13 +1751,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1792,9 +1792,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1805,10 +1805,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1860,7 +1860,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1875,7 +1875,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1913,7 +1913,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l159; }; @@ -1933,7 +1933,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1941,17 +1941,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2105,20 +2105,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2128,10 +2128,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2141,10 +2141,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2152,10 +2152,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/template_string_option_loop.wir.wado b/wado-compiler/tests/fixtures.golden/template_string_option_loop.wir.wado index 3e2f0c35f..2de58fa0e 100644 --- a/wado-compiler/tests/fixtures.golden/template_string_option_loop.wir.wado +++ b/wado-compiler/tests/fixtures.golden/template_string_option_loop.wir.wado @@ -30,20 +30,20 @@ struct Case { mut payload: ref null String, } -array array (mut ref Case); - array array (mut ref String); -struct Array { // Array with T=Case - mut repr: ref array, - mut used: i32, -} +array array (mut ref Case); struct Array { // Array with T=String mut repr: ref array, mut used: i32, } +struct Array { // Array with T=Case + mut repr: ref array, + mut used: i32, +} + enum Alignment { Left = 0, Center = 1, Right = 2 }; type "functype/mem/realloc" = fn(i32, i32, i32, i32) -> i32; @@ -88,19 +88,19 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref Case); +type "functype/Array::push" = fn(ref Array, ref Case); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -183,14 +183,14 @@ fn run() { }; s = __tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_13, base); - String::append(__local_13, __inline_Array_String__IndexValue__index_value_12: block -> ref String { + String::push_str(__local_13, base); + String::push_str(__local_13, __inline_Array_String__IndexValue__index_value_12: block -> ref String { __local_34 = i; break __inline_Array_String__IndexValue__index_value_12: builtin::array_get(_licm_repr_64, __local_34); }); break __tmpl: __local_13; }; - Array::append(cases, Case { payload: s }); + Array::push(cases, Case { payload: s }); i = i + 1; continue l1; }; @@ -231,37 +231,37 @@ fn run() { if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_15, 114); - String::append_char(__local_15, 117); - String::append_char(__local_15, 110); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/template_string_option_loop.wado"), used: 61 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_15, 114); + String::push(__local_15, 117); + String::push(__local_15, 110); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/template_string_option_loop.wado"), used: 61 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_48 = __local_16; i32::fmt_decimal(20, __local_48); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); - String::append(__local_15, __tmpl: block -> ref String { + String::push(__local_15, 58); + String::push(__local_15, 32); + String::push_str(__local_15, __tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(40), used: 0 }; - String::append(__local_14, String { repr: array.new_data("expected ExprBinOp, got "), used: 24 }); - String::append(__local_14, p0); + String::push_str(__local_14, String { repr: array.new_data("expected ExprBinOp, got "), used: 24 }); + String::push_str(__local_14, p0); break __tmpl: __local_14; }); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: p0 == \"ExprBinOp\" "), used: 30 }); - String::append_char(__local_15, 112); - String::append_char(__local_15, 48); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 112); + String::push(__local_15, 48); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; String^Inspect::inspect(__v0_9, __local_16); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -271,37 +271,37 @@ condition: p0 == \"ExprBinOp\" if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(141), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/template_string_option_loop.wado"), used: 61 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/template_string_option_loop.wado"), used: 61 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_56 = __local_19; i32::fmt_decimal(21, __local_56); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); - String::append(__local_18, __tmpl: block -> ref String { + String::push(__local_18, 58); + String::push(__local_18, 32); + String::push_str(__local_18, __tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_17, String { repr: array.new_data("expected ExprPass, got "), used: 23 }); - String::append(__local_17, p1); + String::push_str(__local_17, String { repr: array.new_data("expected ExprPass, got "), used: 23 }); + String::push_str(__local_17, p1); break __tmpl: __local_17; }); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: p1 == \"ExprPass\" "), used: 29 }); - String::append_char(__local_18, 112); - String::append_char(__local_18, 49); - String::append_char(__local_18, 58); - String::append_char(__local_18, 32); + String::push(__local_18, 112); + String::push(__local_18, 49); + String::push(__local_18, 58); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; String^Inspect::inspect(__v0_11, __local_19); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -504,7 +504,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -592,7 +592,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -619,7 +619,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -661,7 +661,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -714,7 +714,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l49; }; @@ -748,20 +748,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -771,10 +771,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -784,10 +784,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -795,10 +795,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -810,7 +810,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -827,22 +827,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b68; @@ -850,7 +850,7 @@ fn String^Inspect::inspect(self, f) { continue l69; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/test_expect_trap.wir.wado b/wado-compiler/tests/fixtures.golden/test_expect_trap.wir.wado index 6cba22fcc..608293ddc 100644 --- a/wado-compiler/tests/fixtures.golden/test_expect_trap.wir.wado +++ b/wado-compiler/tests/fixtures.golden/test_expect_trap.wir.wado @@ -78,9 +78,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -122,20 +122,20 @@ fn __test_trap_2_assert_failure() { let __local_2: ref Formatter; "core:internal/panic"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_1, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_1, String { repr: array.new_data("__test_trap_2_assert_failure"), used: 28 }); - String::append_char(__local_1, 32); - String::append_char(__local_1, 97); - String::append_char(__local_1, 116); - String::append_char(__local_1, 32); - String::append(__local_1, String { repr: array.new_data("wado-compiler/tests/fixtures/test_expect_trap.wado"), used: 50 }); - String::append_char(__local_1, 58); + String::push_str(__local_1, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_1, String { repr: array.new_data("__test_trap_2_assert_failure"), used: 28 }); + String::push(__local_1, 32); + String::push(__local_1, 97); + String::push(__local_1, 116); + String::push(__local_1, 32); + String::push_str(__local_1, String { repr: array.new_data("wado-compiler/tests/fixtures/test_expect_trap.wado"), used: 50 }); + String::push(__local_1, 58); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(19, __local_2); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); - String::append(__local_1, String { repr: array.new_data("this assertion should fail"), used: 26 }); - String::append(__local_1, String { repr: array.new_data(" + String::push(__local_1, 58); + String::push(__local_1, 32); + String::push_str(__local_1, String { repr: array.new_data("this assertion should fail"), used: 26 }); + String::push_str(__local_1, String { repr: array.new_data(" condition: 1 == 2 "), used: 19 }); break __tmpl: __local_1; @@ -366,7 +366,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -381,7 +381,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -419,7 +419,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -453,20 +453,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -476,10 +476,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -489,10 +489,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -500,10 +500,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/test_fail.wir.wado b/wado-compiler/tests/fixtures.golden/test_fail.wir.wado index 941a9bfcc..3bb254c1d 100644 --- a/wado-compiler/tests/fixtures.golden/test_fail.wir.wado +++ b/wado-compiler/tests/fixtures.golden/test_fail.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -105,20 +105,20 @@ fn __test_trap_1_failing() { let __local_2: ref Formatter; "core:internal/panic"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_1, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_1, String { repr: array.new_data("__test_trap_1_failing"), used: 21 }); - String::append_char(__local_1, 32); - String::append_char(__local_1, 97); - String::append_char(__local_1, 116); - String::append_char(__local_1, 32); - String::append(__local_1, String { repr: array.new_data("wado-compiler/tests/fixtures/test_fail.wado"), used: 43 }); - String::append_char(__local_1, 58); + String::push_str(__local_1, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_1, String { repr: array.new_data("__test_trap_1_failing"), used: 21 }); + String::push(__local_1, 32); + String::push(__local_1, 97); + String::push(__local_1, 116); + String::push(__local_1, 32); + String::push_str(__local_1, String { repr: array.new_data("wado-compiler/tests/fixtures/test_fail.wado"), used: 43 }); + String::push(__local_1, 58); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(10, __local_2); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); - String::append(__local_1, String { repr: array.new_data("this should fail"), used: 16 }); - String::append(__local_1, String { repr: array.new_data(" + String::push(__local_1, 58); + String::push(__local_1, 32); + String::push_str(__local_1, String { repr: array.new_data("this should fail"), used: 16 }); + String::push_str(__local_1, String { repr: array.new_data(" condition: 1 == 2 "), used: 19 }); break __tmpl: __local_1; @@ -326,7 +326,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -341,7 +341,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -379,7 +379,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -413,20 +413,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -449,10 +449,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -460,10 +460,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/test_world_variant_generic.wir.wado b/wado-compiler/tests/fixtures.golden/test_world_variant_generic.wir.wado index 317759019..a1086df33 100644 --- a/wado-compiler/tests/fixtures.golden/test_world_variant_generic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/test_world_variant_generic.wir.wado @@ -132,15 +132,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/./sub/test_world_variant_generic_helper.wado/Array::append" = fn(ref Array, ref "./sub/test_world_variant_generic_helper.wado/CstChild"); +type "functype/./sub/test_world_variant_generic_helper.wado/Array::push" = fn(ref Array, ref "./sub/test_world_variant_generic_helper.wado/CstChild"); type "functype/./sub/test_world_variant_generic_helper.wado/Array::grow" = fn(ref Array); @@ -193,27 +193,27 @@ fn __test_0_to_tree_with_variant_walk() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(160), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_0_to_tree_with_variant_walk"), used: 34 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/test_world_variant_generic.wado"), used: 60 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_0_to_tree_with_variant_walk"), used: 34 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/test_world_variant_generic.wado"), used: 60 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(6, __local_10); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); - String::append(__local_4, __sroa_result_name); - String::append(__local_4, String { repr: array.new_data(" + String::push(__local_4, 58); + String::push(__local_4, 32); + String::push_str(__local_4, __sroa_result_name); + String::push_str(__local_4, String { repr: array.new_data(" condition: result.name == \"counted:2\" "), used: 39 }); - String::append(__local_4, String { repr: array.new_data("result.name: "), used: 13 }); + String::push_str(__local_4, String { repr: array.new_data("result.name: "), used: 13 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -372,14 +372,14 @@ fn "./sub/test_world_variant_generic_helper.wado/to_tree"(node) { // from ./sub "./sub/test_world_variant_generic_helper.wado/./sub/test_world_variant_generic_helper.wado/walk_node"(rec, node); return ref.as_non_null(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_3, 99); - String::append_char(__local_3, 111); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 116); - String::append_char(__local_3, 101); - String::append_char(__local_3, 100); - String::append_char(__local_3, 58); + String::push(__local_3, 99); + String::push(__local_3, 111); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 116); + String::push(__local_3, 101); + String::push(__local_3, 100); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_7 = "core:internal/Box" { value: rec.count }; i32::fmt_decimal(__local_7.value, __local_4); @@ -502,7 +502,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -590,7 +590,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -617,7 +617,7 @@ fn String::append_char(self, c) { }; } -fn "./sub/test_world_variant_generic_helper.wado/Array::append"(self, value) { // from ./sub/test_world_variant_generic_helper.wado +fn "./sub/test_world_variant_generic_helper.wado/Array::push"(self, value) { // from ./sub/test_world_variant_generic_helper.wado let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -680,7 +680,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l43; }; @@ -714,20 +714,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -737,10 +737,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -750,10 +750,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -761,10 +761,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -776,7 +776,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -793,22 +793,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b62; @@ -816,7 +816,7 @@ fn String^Inspect::inspect(self, f) { continue l63; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_to_tree_with_variant_walk as "__test_0_to_tree_with_variant_walk" diff --git a/wado-compiler/tests/fixtures.golden/test_world_variant_generic_run.wir.wado b/wado-compiler/tests/fixtures.golden/test_world_variant_generic_run.wir.wado index d865e6c24..0e79ed0be 100644 --- a/wado-compiler/tests/fixtures.golden/test_world_variant_generic_run.wir.wado +++ b/wado-compiler/tests/fixtures.golden/test_world_variant_generic_run.wir.wado @@ -132,15 +132,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/./sub/test_world_variant_generic_helper.wado/Array::append" = fn(ref Array, ref "./sub/test_world_variant_generic_helper.wado/CstChild"); +type "functype/./sub/test_world_variant_generic_helper.wado/Array::push" = fn(ref Array, ref "./sub/test_world_variant_generic_helper.wado/CstChild"); type "functype/./sub/test_world_variant_generic_helper.wado/Array::grow" = fn(ref Array); @@ -193,29 +193,29 @@ fn run() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(160), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/test_world_variant_generic_run.wado"), used: 64 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/test_world_variant_generic_run.wado"), used: 64 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(6, __local_10); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); - String::append(__local_4, __sroa_result_name); - String::append(__local_4, String { repr: array.new_data(" + String::push(__local_4, 58); + String::push(__local_4, 32); + String::push_str(__local_4, __sroa_result_name); + String::push_str(__local_4, String { repr: array.new_data(" condition: result.name == \"counted:2\" "), used: 39 }); - String::append(__local_4, String { repr: array.new_data("result.name: "), used: 13 }); + String::push_str(__local_4, String { repr: array.new_data("result.name: "), used: 13 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -374,14 +374,14 @@ fn "./sub/test_world_variant_generic_helper.wado/to_tree"(node) { // from ./sub "./sub/test_world_variant_generic_helper.wado/./sub/test_world_variant_generic_helper.wado/walk_node"(rec, node); return ref.as_non_null(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_3, 99); - String::append_char(__local_3, 111); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 116); - String::append_char(__local_3, 101); - String::append_char(__local_3, 100); - String::append_char(__local_3, 58); + String::push(__local_3, 99); + String::push(__local_3, 111); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 116); + String::push(__local_3, 101); + String::push(__local_3, 100); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_7 = "core:internal/Box" { value: rec.count }; i32::fmt_decimal(__local_7.value, __local_4); @@ -504,7 +504,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -592,7 +592,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -619,7 +619,7 @@ fn String::append_char(self, c) { }; } -fn "./sub/test_world_variant_generic_helper.wado/Array::append"(self, value) { // from ./sub/test_world_variant_generic_helper.wado +fn "./sub/test_world_variant_generic_helper.wado/Array::push"(self, value) { // from ./sub/test_world_variant_generic_helper.wado let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -682,7 +682,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l43; }; @@ -716,20 +716,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -739,10 +739,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -752,10 +752,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -763,10 +763,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -778,7 +778,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -795,22 +795,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b62; @@ -818,7 +818,7 @@ fn String^Inspect::inspect(self, f) { continue l63; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/test_world_variant_group.wir.wado b/wado-compiler/tests/fixtures.golden/test_world_variant_group.wir.wado index eb4f46f6b..8335c2166 100644 --- a/wado-compiler/tests/fixtures.golden/test_world_variant_group.wir.wado +++ b/wado-compiler/tests/fixtures.golden/test_world_variant_group.wir.wado @@ -93,13 +93,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -162,31 +162,31 @@ fn __test_0_use_variant_from_imported_module() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_0_use_variant_from_imported_module"), used: 41 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/test_world_variant_group.wado"), used: 58 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_0_use_variant_from_imported_module"), used: 41 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/test_world_variant_group.wado"), used: 58 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_11 = __local_5; i32::fmt_decimal(7, __local_11); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: result == \"a\" "), used: 26 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 101); - String::append_char(__local_4, 115); - String::append_char(__local_4, 117); - String::append_char(__local_4, 108); - String::append_char(__local_4, 116); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 114); + String::push(__local_4, 101); + String::push(__local_4, 115); + String::push(__local_4, 117); + String::push(__local_4, 108); + String::push(__local_4, 116); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; String^Inspect::inspect(__v0, __local_5); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -389,7 +389,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -477,7 +477,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -515,7 +515,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -549,20 +549,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -572,10 +572,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -585,10 +585,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -596,10 +596,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -611,7 +611,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -628,22 +628,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b54; @@ -651,7 +651,7 @@ fn String^Inspect::inspect(self, f) { continue l55; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_use_variant_from_imported_module as "__test_0_use_variant_from_imported_module" diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_mixed.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_mixed.wir.wado index 4647ce43b..78980e8d3 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_mixed.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_mixed.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -116,8 +116,8 @@ fn run() with Stdout { }; safe = __tmpl: block -> ref String { __tmpl_buf_30.used = 0; - String::append_char(__tmpl_buf_30, 115); - String::append_char(__tmpl_buf_30, 61); + String::push(__tmpl_buf_30, 115); + String::push(__tmpl_buf_30, 61); __fmt_buf_31.indent = 0; i32::fmt_decimal(i, __fmt_buf_31); break __tmpl: __tmpl_buf_30; @@ -125,8 +125,8 @@ fn run() with Stdout { total = total + safe.used; escaped = __tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_6, 101); - String::append_char(__local_6, 61); + String::push(__local_6, 101); + String::push(__local_6, 61); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(i, __local_7); break __tmpl: __local_6; @@ -139,12 +139,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_8, 116); - String::append_char(__local_8, 111); - String::append_char(__local_8, 116); - String::append_char(__local_8, 97); - String::append_char(__local_8, 108); - String::append_char(__local_8, 61); + String::push(__local_8, 116); + String::push(__local_8, 111); + String::push(__local_8, 116); + String::push(__local_8, 97); + String::push(__local_8, 108); + String::push(__local_8, 61); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(total, __local_9); break __tmpl: __local_8; @@ -346,7 +346,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -361,7 +361,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -399,7 +399,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -433,20 +433,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -456,10 +456,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -469,10 +469,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -480,10 +480,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_safe.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_safe.wir.wado index 66cdee941..8e69c7ce2 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_safe.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_safe.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -148,8 +148,8 @@ fn run() with Stdout { }; s_2 = __tmpl: block -> ref String { __tmpl_buf_106.used = 0; - String::append_char(__tmpl_buf_106, 110); - String::append_char(__tmpl_buf_106, 61); + String::push(__tmpl_buf_106, 110); + String::push(__tmpl_buf_106, 61); __fmt_buf_107.indent = 0; i32::fmt_decimal(i_1, __fmt_buf_107); break __tmpl: __tmpl_buf_106; @@ -162,10 +162,10 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_18, 108); - String::append_char(__local_18, 101); - String::append_char(__local_18, 110); - String::append_char(__local_18, 61); + String::push(__local_18, 108); + String::push(__local_18, 101); + String::push(__local_18, 110); + String::push(__local_18, 61); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(total, __local_19); break __tmpl: __local_18; @@ -182,8 +182,8 @@ fn run() with Stdout { }; s_5 = __tmpl: block -> ref String { __tmpl_buf_108.used = 0; - String::append_char(__tmpl_buf_108, 118); - String::append_char(__tmpl_buf_108, 61); + String::push(__tmpl_buf_108, 118); + String::push(__tmpl_buf_108, 61); __fmt_buf_109.indent = 0; i32::fmt_decimal(i_4, __fmt_buf_109); break __tmpl: __tmpl_buf_108; @@ -215,12 +215,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_22, 98); - String::append_char(__local_22, 121); - String::append_char(__local_22, 116); - String::append_char(__local_22, 101); - String::append_char(__local_22, 115); - String::append_char(__local_22, 61); + String::push(__local_22, 98); + String::push(__local_22, 121); + String::push(__local_22, 116); + String::push(__local_22, 101); + String::push(__local_22, 115); + String::push(__local_22, 61); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; u64::fmt_decimal(byte_sum, __local_23); break __tmpl: __local_22; @@ -240,16 +240,16 @@ fn run() with Stdout { }; a = __tmpl: block -> ref String { __tmpl_buf_110.used = 0; - String::append_char(__tmpl_buf_110, 97); - String::append_char(__tmpl_buf_110, 61); + String::push(__tmpl_buf_110, 97); + String::push(__tmpl_buf_110, 61); __fmt_buf_111.indent = 0; i32::fmt_decimal(i_10, __fmt_buf_111); break __tmpl: __tmpl_buf_110; }; b = __tmpl: block -> ref String { __tmpl_buf_112.used = 0; - String::append_char(__tmpl_buf_112, 98); - String::append_char(__tmpl_buf_112, 61); + String::push(__tmpl_buf_112, 98); + String::push(__tmpl_buf_112, 61); __fmt_buf_113.indent = 0; i32::fmt_decimal(i_10, __fmt_buf_113); break __tmpl: __tmpl_buf_112; @@ -263,16 +263,16 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_28, 116); - String::append_char(__local_28, 49); - String::append_char(__local_28, 61); + String::push(__local_28, 116); + String::push(__local_28, 49); + String::push(__local_28, 61); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_82 = __local_29; i32::fmt_decimal(t1, __local_82); - String::append_char(__local_28, 44); - String::append_char(__local_28, 116); - String::append_char(__local_28, 50); - String::append_char(__local_28, 61); + String::push(__local_28, 44); + String::push(__local_28, 116); + String::push(__local_28, 50); + String::push(__local_28, 61); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_87 = __local_29; i32::fmt_decimal(t2, __local_87); @@ -290,8 +290,8 @@ fn run() with Stdout { }; s_15 = __tmpl: block -> ref String { __tmpl_buf_114.used = 0; - String::append_char(__tmpl_buf_114, 99); - String::append_char(__tmpl_buf_114, 61); + String::push(__tmpl_buf_114, 99); + String::push(__tmpl_buf_114, 61); __fmt_buf_115.indent = 0; i32::fmt_decimal(i_14, __fmt_buf_115); break __tmpl: __tmpl_buf_114; @@ -304,9 +304,9 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_32, 116); - String::append_char(__local_32, 51); - String::append_char(__local_32, 61); + String::push(__local_32, 116); + String::push(__local_32, 51); + String::push(__local_32, 61); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; i32::fmt_decimal(t3, __local_33); break __tmpl: __local_32; @@ -597,7 +597,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -612,7 +612,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -650,7 +650,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l50; }; @@ -684,20 +684,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -707,10 +707,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -720,10 +720,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -731,10 +731,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_unsafe.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_unsafe.wir.wado index b79531886..dd2f471b3 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_unsafe.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_escape_unsafe.wir.wado @@ -113,7 +113,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -121,7 +121,7 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/TreeMap^IndexValue::index_value" = fn(ref "core:allocator/TreeMap", ref String) -> i32; @@ -135,7 +135,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -211,8 +211,8 @@ fn run() with Stdout { }; s = __tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_11, 120); - String::append_char(__local_11, 61); + String::push(__local_11, 120); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(i_0, __local_12); break __tmpl: __local_11; @@ -232,8 +232,8 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_13, 121); - String::append_char(__local_13, 61); + String::push(__local_13, 121); + String::push(__local_13, 61); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(i_2, __local_14); break __tmpl: __local_13; @@ -256,7 +256,7 @@ fn run() with Stdout { }; key = __tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(17), used: 0 }; - String::append_char(__local_15, 107); + String::push(__local_15, 107); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(i_4, __local_16); break __tmpl: __local_15; @@ -273,27 +273,27 @@ fn run() with Stdout { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_17, 114); - String::append_char(__local_17, 117); - String::append_char(__local_17, 110); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/tmpl_hoist_escape_unsafe.wado"), used: 58 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_17, 114); + String::push(__local_17, 117); + String::push(__local_17, 110); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/tmpl_hoist_escape_unsafe.wado"), used: 58 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_53 = __local_18; i32::fmt_decimal(24, __local_53); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: map.len() == 5 "), used: 27 }); - String::append(__local_17, String { repr: array.new_data("map.len(): "), used: 11 }); + String::push_str(__local_17, String { repr: array.new_data("map.len(): "), used: 11 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_58 = __local_18; i32::fmt_decimal(__v0_5, __local_58); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -303,27 +303,27 @@ condition: map.len() == 5 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 114); - String::append_char(__local_19, 117); - String::append_char(__local_19, 110); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/tmpl_hoist_escape_unsafe.wado"), used: 58 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 114); + String::push(__local_19, 117); + String::push(__local_19, 110); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/tmpl_hoist_escape_unsafe.wado"), used: 58 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_64 = __local_20; i32::fmt_decimal(25, __local_64); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: map[\"k0\"] == 0 "), used: 27 }); - String::append(__local_19, String { repr: array.new_data("map[\"k0\"]: "), used: 11 }); + String::push_str(__local_19, String { repr: array.new_data("map[\"k0\"]: "), used: 11 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_69 = __local_20; i32::fmt_decimal(__v0_7, __local_69); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -333,27 +333,27 @@ condition: map[\"k0\"] == 0 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 114); - String::append_char(__local_21, 117); - String::append_char(__local_21, 110); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/tmpl_hoist_escape_unsafe.wado"), used: 58 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 114); + String::push(__local_21, 117); + String::push(__local_21, 110); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/tmpl_hoist_escape_unsafe.wado"), used: 58 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_75 = __local_22; i32::fmt_decimal(26, __local_75); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: map[\"k4\"] == 4 "), used: 27 }); - String::append(__local_21, String { repr: array.new_data("map[\"k4\"]: "), used: 11 }); + String::push_str(__local_21, String { repr: array.new_data("map[\"k4\"]: "), used: 11 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_80 = __local_22; i32::fmt_decimal(__v0_9, __local_80); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -593,7 +593,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -724,7 +724,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -760,7 +760,7 @@ fn TreeMap^IndexValue::index_value(self, key) { if index < 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -846,7 +846,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_i32____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -920,7 +920,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -973,7 +973,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l77; }; @@ -1007,20 +1007,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1030,10 +1030,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1043,10 +1043,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1054,10 +1054,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1069,7 +1069,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1086,22 +1086,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b96; @@ -1109,7 +1109,7 @@ fn String^Inspect::inspect(self, f) { continue l97; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_default.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_default.wir.wado index 575b19e10..0b30242e9 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_default.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_default.wir.wado @@ -95,7 +95,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -105,9 +105,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -212,12 +212,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_12, 116); - String::append_char(__local_12, 111); - String::append_char(__local_12, 116); - String::append_char(__local_12, 97); - String::append_char(__local_12, 108); - String::append_char(__local_12, 61); + String::push(__local_12, 116); + String::push(__local_12, 111); + String::push(__local_12, 116); + String::push(__local_12, 97); + String::push(__local_12, 108); + String::push(__local_12, 61); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(total, __local_13); break __tmpl: __local_12; @@ -247,13 +247,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_16, 116); - String::append_char(__local_16, 111); - String::append_char(__local_16, 116); - String::append_char(__local_16, 97); - String::append_char(__local_16, 108); - String::append_char(__local_16, 50); - String::append_char(__local_16, 61); + String::push(__local_16, 116); + String::push(__local_16, 111); + String::push(__local_16, 116); + String::push(__local_16, 97); + String::push(__local_16, 108); + String::push(__local_16, 50); + String::push(__local_16, 61); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(total2, __local_17); break __tmpl: __local_16; @@ -270,11 +270,11 @@ fn run() with Stdout { }; s_9 = __tmpl: block -> ref String { __tmpl_buf_63.used = 0; - String::append_char(__tmpl_buf_63, 118); - String::append_char(__tmpl_buf_63, 61); + String::push(__tmpl_buf_63, 118); + String::push(__tmpl_buf_63, 61); __fmt_buf_64.indent = 0; i32::fmt_decimal(i_8, __fmt_buf_64); - String::append_char(__tmpl_buf_63, 33); + String::push(__tmpl_buf_63, 33); break __tmpl: __tmpl_buf_63; }; total3 = total3 + s_9.used; @@ -285,13 +285,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_20, 116); - String::append_char(__local_20, 111); - String::append_char(__local_20, 116); - String::append_char(__local_20, 97); - String::append_char(__local_20, 108); - String::append_char(__local_20, 51); - String::append_char(__local_20, 61); + String::push(__local_20, 116); + String::push(__local_20, 111); + String::push(__local_20, 116); + String::push(__local_20, 97); + String::push(__local_20, 108); + String::push(__local_20, 51); + String::push(__local_20, 61); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(total3, __local_21); break __tmpl: __local_20; @@ -1059,8 +1059,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1115,8 +1115,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1148,7 +1148,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1277,27 +1277,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1418,9 +1418,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1474,13 +1474,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1515,9 +1515,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1570,7 +1570,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1585,7 +1585,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1623,7 +1623,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l162; }; @@ -1781,20 +1781,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1804,10 +1804,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1817,10 +1817,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1828,10 +1828,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_edge.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_edge.wir.wado index dd1397368..57b986715 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_edge.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_edge.wir.wado @@ -110,7 +110,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -122,9 +122,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Pair^InspectAlt::inspect_alt" = fn(ref Pair, ref Formatter); @@ -248,7 +248,7 @@ fn run() with Stdout { __tmpl_buf_80.used = 0; __fmt_buf_81.indent = 0; i32::fmt_decimal(i_1, __fmt_buf_81); - String::append_char(__tmpl_buf_80, 44); + String::push(__tmpl_buf_80, 44); __fmt_buf_82.indent = 0; i32::fmt_decimal(j, __fmt_buf_82); break __tmpl: __tmpl_buf_80; @@ -266,13 +266,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_18, 110); - String::append_char(__local_18, 101); - String::append_char(__local_18, 115); - String::append_char(__local_18, 116); - String::append_char(__local_18, 101); - String::append_char(__local_18, 100); - String::append_char(__local_18, 61); + String::push(__local_18, 110); + String::push(__local_18, 101); + String::push(__local_18, 115); + String::push(__local_18, 116); + String::push(__local_18, 101); + String::push(__local_18, 100); + String::push(__local_18, 61); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(total, __local_19); break __tmpl: __local_18; @@ -302,7 +302,7 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_22, String { repr: array.new_data("len_only="), used: 9 }); + String::push_str(__local_22, String { repr: array.new_data("len_only="), used: 9 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i32::fmt_decimal(sum, __local_23); break __tmpl: __local_22; @@ -341,11 +341,11 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_26, 99); - String::append_char(__local_26, 104); - String::append_char(__local_26, 97); - String::append_char(__local_26, 114); - String::append_char(__local_26, 61); + String::push(__local_26, 99); + String::push(__local_26, 104); + String::push(__local_26, 97); + String::push(__local_26, 114); + String::push(__local_26, 61); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; i32::fmt_decimal(total3, __local_27); break __tmpl: __local_26; @@ -375,13 +375,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_30, 112); - String::append_char(__local_30, 114); - String::append_char(__local_30, 101); - String::append_char(__local_30, 116); - String::append_char(__local_30, 116); - String::append_char(__local_30, 121); - String::append_char(__local_30, 61); + String::push(__local_30, 112); + String::push(__local_30, 114); + String::push(__local_30, 101); + String::push(__local_30, 116); + String::push(__local_30, 116); + String::push(__local_30, 121); + String::push(__local_30, 61); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; i32::fmt_decimal(total4, __local_31); break __tmpl: __local_30; @@ -1149,8 +1149,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1205,8 +1205,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1238,7 +1238,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1367,27 +1367,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1522,9 +1522,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1578,13 +1578,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1619,9 +1619,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1632,10 +1632,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -1687,7 +1687,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1702,7 +1702,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1737,27 +1737,27 @@ fn Pair^InspectAlt::inspect_alt(self, f) { let s_31: ref String; let close: ref String; open = String { repr: array.new_data("Pair {"), used: 6 }; - String::append(f.buf, open); + String::push_str(f.buf, open); f.indent = f.indent + 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); s_10 = String { repr: array.new_data("a: "), used: 3 }; - String::append(f.buf, s_10); + String::push_str(f.buf, s_10); i32::fmt_decimal(self.a, f); s_18 = String { repr: array.new_data(","), used: 1 }; - String::append(f.buf, s_18); - String::append_char(f.buf, 10); + String::push_str(f.buf, s_18); + String::push(f.buf, 10); Formatter::write_indent(f); s_23 = String { repr: array.new_data("b: "), used: 3 }; - String::append(f.buf, s_23); + String::push_str(f.buf, s_23); i32::fmt_decimal(self.b, f); s_31 = String { repr: array.new_data(","), used: 1 }; - String::append(f.buf, s_31); + String::push_str(f.buf, s_31); close = String { repr: array.new_data("}"), used: 1 }; f.indent = f.indent - 1; - String::append_char(f.buf, 10); + String::push(f.buf, 10); Formatter::write_indent(f); - String::append(f.buf, close); + String::push_str(f.buf, close); } fn Formatter::write_char_n(self, c, n) { @@ -1771,7 +1771,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l174; }; @@ -1791,7 +1791,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1799,17 +1799,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1963,20 +1963,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1986,10 +1986,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1999,10 +1999,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2010,10 +2010,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -2034,7 +2034,7 @@ fn Formatter::write_indent(self) { break __for_4; }; s = String { repr: array.new_data(" "), used: 2 }; - String::append(_licm_buf_5, s); + String::push_str(_licm_buf_5, s); i = i + 1; continue l214; }; diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_mixed.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_mixed.wir.wado index 8eec187cb..96d9f6fa6 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_mixed.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_mixed.wir.wado @@ -99,7 +99,7 @@ type "functype/count_digits_base" = fn(i64, i32) -> i32; type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -109,9 +109,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -216,8 +216,8 @@ fn run() with Stdout { __tmpl_buf_64.used = 0; __fmt_buf_65.indent = 0; i32::fmt_decimal(i_1, __fmt_buf_65); - String::append_char(__tmpl_buf_64, 58); - String::append_char(__tmpl_buf_64, 32); + String::push(__tmpl_buf_64, 58); + String::push(__tmpl_buf_64, 32); __fmt_buf_66.indent = 0; f64::fmt_into(x_2, __fmt_buf_66); break __tmpl: __tmpl_buf_64; @@ -230,12 +230,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_13, 116); - String::append_char(__local_13, 111); - String::append_char(__local_13, 116); - String::append_char(__local_13, 97); - String::append_char(__local_13, 108); - String::append_char(__local_13, 61); + String::push(__local_13, 116); + String::push(__local_13, 111); + String::push(__local_13, 116); + String::push(__local_13, 97); + String::push(__local_13, 108); + String::push(__local_13, 61); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(total, __local_14); break __tmpl: __local_13; @@ -256,9 +256,9 @@ fn run() with Stdout { __tmpl_buf_67.used = 0; __fmt_buf_68.indent = 0; f64::fmt_into(x_6, __fmt_buf_68); - String::append_char(__tmpl_buf_67, 32); - String::append_char(__tmpl_buf_67, 47); - String::append_char(__tmpl_buf_67, 32); + String::push(__tmpl_buf_67, 32); + String::push(__tmpl_buf_67, 47); + String::push(__tmpl_buf_67, 32); __fmt_buf_69.indent = 0; f64::fmt_into(x_6, __fmt_buf_69); break __tmpl: __tmpl_buf_67; @@ -271,13 +271,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_17, 116); - String::append_char(__local_17, 111); - String::append_char(__local_17, 116); - String::append_char(__local_17, 97); - String::append_char(__local_17, 108); - String::append_char(__local_17, 50); - String::append_char(__local_17, 61); + String::push(__local_17, 116); + String::push(__local_17, 111); + String::push(__local_17, 116); + String::push(__local_17, 97); + String::push(__local_17, 108); + String::push(__local_17, 50); + String::push(__local_17, 61); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; i32::fmt_decimal(total2, __local_18); break __tmpl: __local_17; @@ -295,17 +295,17 @@ fn run() with Stdout { }; s_10 = __tmpl: block -> ref String { __tmpl_buf_70.used = 0; - String::append_char(__tmpl_buf_70, 100); - String::append_char(__tmpl_buf_70, 101); - String::append_char(__tmpl_buf_70, 99); - String::append_char(__tmpl_buf_70, 61); + String::push(__tmpl_buf_70, 100); + String::push(__tmpl_buf_70, 101); + String::push(__tmpl_buf_70, 99); + String::push(__tmpl_buf_70, 61); __fmt_buf_71.indent = 0; i32::fmt_decimal(i_9, __fmt_buf_71); - String::append_char(__tmpl_buf_70, 32); - String::append_char(__tmpl_buf_70, 104); - String::append_char(__tmpl_buf_70, 101); - String::append_char(__tmpl_buf_70, 120); - String::append_char(__tmpl_buf_70, 61); + String::push(__tmpl_buf_70, 32); + String::push(__tmpl_buf_70, 104); + String::push(__tmpl_buf_70, 101); + String::push(__tmpl_buf_70, 120); + String::push(__tmpl_buf_70, 61); __fmt_buf_72.indent = 0; i32^LowerHex::fmt(i_9, __fmt_buf_72); break __tmpl: __tmpl_buf_70; @@ -318,13 +318,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_21, 116); - String::append_char(__local_21, 111); - String::append_char(__local_21, 116); - String::append_char(__local_21, 97); - String::append_char(__local_21, 108); - String::append_char(__local_21, 51); - String::append_char(__local_21, 61); + String::push(__local_21, 116); + String::push(__local_21, 111); + String::push(__local_21, 116); + String::push(__local_21, 97); + String::push(__local_21, 108); + String::push(__local_21, 51); + String::push(__local_21, 61); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; i32::fmt_decimal(total3, __local_22); break __tmpl: __local_21; @@ -1092,8 +1092,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1148,8 +1148,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1181,7 +1181,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1371,27 +1371,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1526,9 +1526,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1582,13 +1582,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1623,9 +1623,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1692,7 +1692,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1707,7 +1707,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1745,7 +1745,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l173; }; @@ -1903,20 +1903,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1926,10 +1926,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1939,10 +1939,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1950,10 +1950,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_multi_default.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_multi_default.wir.wado index b41f48f21..7d2cca90f 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_multi_default.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_multi_default.wir.wado @@ -95,7 +95,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -105,9 +105,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -213,7 +213,7 @@ fn run() with Stdout { __tmpl_buf_92.used = 0; __fmt_buf_93.indent = 0; i32::fmt_decimal(i_1, __fmt_buf_93); - String::append_char(__tmpl_buf_92, 44); + String::push(__tmpl_buf_92, 44); __fmt_buf_94.indent = 0; i32::fmt_decimal(x, __fmt_buf_94); break __tmpl: __tmpl_buf_92; @@ -226,12 +226,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_15, 116); - String::append_char(__local_15, 111); - String::append_char(__local_15, 116); - String::append_char(__local_15, 97); - String::append_char(__local_15, 108); - String::append_char(__local_15, 61); + String::push(__local_15, 116); + String::push(__local_15, 111); + String::push(__local_15, 116); + String::push(__local_15, 97); + String::push(__local_15, 108); + String::push(__local_15, 61); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(total, __local_16); break __tmpl: __local_15; @@ -255,10 +255,10 @@ fn run() with Stdout { __tmpl_buf_95.used = 0; __fmt_buf_96.indent = 0; i32::fmt_decimal(a, __fmt_buf_96); - String::append_char(__tmpl_buf_95, 45); + String::push(__tmpl_buf_95, 45); __fmt_buf_97.indent = 0; i32::fmt_decimal(b, __fmt_buf_97); - String::append_char(__tmpl_buf_95, 45); + String::push(__tmpl_buf_95, 45); __fmt_buf_98.indent = 0; f64::fmt_into(c, __fmt_buf_98); break __tmpl: __tmpl_buf_95; @@ -271,13 +271,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_19, 116); - String::append_char(__local_19, 111); - String::append_char(__local_19, 116); - String::append_char(__local_19, 97); - String::append_char(__local_19, 108); - String::append_char(__local_19, 50); - String::append_char(__local_19, 61); + String::push(__local_19, 116); + String::push(__local_19, 111); + String::push(__local_19, 116); + String::push(__local_19, 97); + String::push(__local_19, 108); + String::push(__local_19, 50); + String::push(__local_19, 61); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; i32::fmt_decimal(total2, __local_20); break __tmpl: __local_19; @@ -297,19 +297,19 @@ fn run() with Stdout { }; s_12 = __tmpl: block -> ref String { __tmpl_buf_99.used = 0; - String::append_char(__tmpl_buf_99, 91); + String::push(__tmpl_buf_99, 91); __fmt_buf_100.indent = 0; i32::fmt_decimal(i_11, __fmt_buf_100); - String::append_char(__tmpl_buf_99, 44); + String::push(__tmpl_buf_99, 44); __fmt_buf_101.indent = 0; i32::fmt_decimal(i_11, __fmt_buf_101); - String::append_char(__tmpl_buf_99, 44); + String::push(__tmpl_buf_99, 44); __fmt_buf_102.indent = 0; i32::fmt_decimal(i_11, __fmt_buf_102); - String::append_char(__tmpl_buf_99, 44); + String::push(__tmpl_buf_99, 44); __fmt_buf_103.indent = 0; i32::fmt_decimal(i_11, __fmt_buf_103); - String::append_char(__tmpl_buf_99, 93); + String::push(__tmpl_buf_99, 93); break __tmpl: __tmpl_buf_99; }; total3 = total3 + s_12.used; @@ -320,13 +320,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_23, 116); - String::append_char(__local_23, 111); - String::append_char(__local_23, 116); - String::append_char(__local_23, 97); - String::append_char(__local_23, 108); - String::append_char(__local_23, 51); - String::append_char(__local_23, 61); + String::push(__local_23, 116); + String::push(__local_23, 111); + String::push(__local_23, 116); + String::push(__local_23, 97); + String::push(__local_23, 108); + String::push(__local_23, 51); + String::push(__local_23, 61); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; i32::fmt_decimal(total3, __local_24); break __tmpl: __local_23; @@ -1094,8 +1094,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1150,8 +1150,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1183,7 +1183,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1312,27 +1312,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1453,9 +1453,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1509,13 +1509,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1550,9 +1550,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1605,7 +1605,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1620,7 +1620,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1658,7 +1658,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l162; }; @@ -1816,20 +1816,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1839,10 +1839,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1852,10 +1852,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1863,10 +1863,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_params.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_params.wir.wado index 48afaceed..b0bb4820d 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_params.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_params.wir.wado @@ -95,7 +95,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -105,9 +105,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -216,7 +216,7 @@ fn run() with Stdout { __tmpl_buf_90.used = 0; __fmt_buf_91.indent = 0; i32::fmt_decimal(i_1, __fmt_buf_91); - String::append_char(__tmpl_buf_90, 32); + String::push(__tmpl_buf_90, 32); __fmt_buf_92.indent = 0; i32::fmt_decimal(i_1, __fmt_buf_92); break __tmpl: __tmpl_buf_90; @@ -229,7 +229,7 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_16, String { repr: array.new_data("pad_vs_align="), used: 13 }); + String::push_str(__local_16, String { repr: array.new_data("pad_vs_align="), used: 13 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(total, __local_17); break __tmpl: __local_16; @@ -250,7 +250,7 @@ fn run() with Stdout { __tmpl_buf_93.used = 0; __fmt_buf_94.indent = 0; f64::fmt_into(f_5, __fmt_buf_94); - String::append_char(__tmpl_buf_93, 32); + String::push(__tmpl_buf_93, 32); __fmt_buf_95.indent = 0; f64::fmt_into(f_5, __fmt_buf_95); break __tmpl: __tmpl_buf_93; @@ -263,11 +263,11 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_20, 115); - String::append_char(__local_20, 105); - String::append_char(__local_20, 103); - String::append_char(__local_20, 110); - String::append_char(__local_20, 61); + String::push(__local_20, 115); + String::push(__local_20, 105); + String::push(__local_20, 103); + String::push(__local_20, 110); + String::push(__local_20, 61); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(total2, __local_21); break __tmpl: __local_20; @@ -288,10 +288,10 @@ fn run() with Stdout { __tmpl_buf_96.used = 0; __fmt_buf_97.indent = 0; i32::fmt_decimal(i_8, __fmt_buf_97); - String::append_char(__tmpl_buf_96, 32); + String::push(__tmpl_buf_96, 32); __fmt_buf_98.indent = 0; i32::fmt_decimal(i_8, __fmt_buf_98); - String::append_char(__tmpl_buf_96, 32); + String::push(__tmpl_buf_96, 32); __fmt_buf_99.indent = 0; i32::fmt_decimal(i_8, __fmt_buf_99); break __tmpl: __tmpl_buf_96; @@ -304,13 +304,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_24, 119); - String::append_char(__local_24, 105); - String::append_char(__local_24, 100); - String::append_char(__local_24, 116); - String::append_char(__local_24, 104); - String::append_char(__local_24, 115); - String::append_char(__local_24, 61); + String::push(__local_24, 119); + String::push(__local_24, 105); + String::push(__local_24, 100); + String::push(__local_24, 116); + String::push(__local_24, 104); + String::push(__local_24, 115); + String::push(__local_24, 61); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i32::fmt_decimal(total3, __local_25); break __tmpl: __local_24; @@ -331,7 +331,7 @@ fn run() with Stdout { __tmpl_buf_100.used = 0; __fmt_buf_101.indent = 0; f64::fmt_into(f_12, __fmt_buf_101); - String::append_char(__tmpl_buf_100, 32); + String::push(__tmpl_buf_100, 32); __fmt_buf_102.indent = 0; f64::fmt_into(f_12, __fmt_buf_102); break __tmpl: __tmpl_buf_100; @@ -344,7 +344,7 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_28, String { repr: array.new_data("zeroprec="), used: 9 }); + String::push_str(__local_28, String { repr: array.new_data("zeroprec="), used: 9 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; i32::fmt_decimal(total4, __local_29); break __tmpl: __local_28; @@ -1112,8 +1112,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1168,8 +1168,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1201,7 +1201,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1330,27 +1330,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1471,9 +1471,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1527,13 +1527,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1568,9 +1568,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1623,7 +1623,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1638,7 +1638,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1676,7 +1676,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l165; }; @@ -1834,20 +1834,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1857,10 +1857,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1870,10 +1870,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1881,10 +1881,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_specifier.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_specifier.wir.wado index c19352ed1..c8408d430 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_specifier.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_specifier.wir.wado @@ -99,7 +99,7 @@ type "functype/count_digits_base" = fn(i64, i32) -> i32; type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -109,9 +109,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -231,12 +231,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_16, 102); - String::append_char(__local_16, 105); - String::append_char(__local_16, 120); - String::append_char(__local_16, 101); - String::append_char(__local_16, 100); - String::append_char(__local_16, 61); + String::push(__local_16, 102); + String::push(__local_16, 105); + String::push(__local_16, 120); + String::push(__local_16, 101); + String::push(__local_16, 100); + String::push(__local_16, 61); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(total, __local_17); break __tmpl: __local_16; @@ -265,10 +265,10 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_20, 104); - String::append_char(__local_20, 101); - String::append_char(__local_20, 120); - String::append_char(__local_20, 61); + String::push(__local_20, 104); + String::push(__local_20, 101); + String::push(__local_20, 120); + String::push(__local_20, 61); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(total2, __local_21); break __tmpl: __local_20; @@ -297,14 +297,14 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_24, 104); - String::append_char(__local_24, 101); - String::append_char(__local_24, 120); - String::append_char(__local_24, 95); - String::append_char(__local_24, 97); - String::append_char(__local_24, 108); - String::append_char(__local_24, 116); - String::append_char(__local_24, 61); + String::push(__local_24, 104); + String::push(__local_24, 101); + String::push(__local_24, 120); + String::push(__local_24, 95); + String::push(__local_24, 97); + String::push(__local_24, 108); + String::push(__local_24, 116); + String::push(__local_24, 61); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i32::fmt_decimal(total3, __local_25); break __tmpl: __local_24; @@ -334,12 +334,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_28, 112); - String::append_char(__local_28, 114); - String::append_char(__local_28, 101); - String::append_char(__local_28, 99); - String::append_char(__local_28, 50); - String::append_char(__local_28, 61); + String::push(__local_28, 112); + String::push(__local_28, 114); + String::push(__local_28, 101); + String::push(__local_28, 99); + String::push(__local_28, 50); + String::push(__local_28, 61); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; i32::fmt_decimal(total4, __local_29); break __tmpl: __local_28; @@ -1107,8 +1107,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1163,8 +1163,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1196,7 +1196,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1386,27 +1386,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1541,9 +1541,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1597,13 +1597,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1638,9 +1638,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1721,7 +1721,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1736,7 +1736,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1774,7 +1774,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l177; }; @@ -1932,20 +1932,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1955,10 +1955,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1968,10 +1968,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1979,10 +1979,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_struct.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_struct.wir.wado index e57aa2e04..eac43a614 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_fmt_struct.wir.wado @@ -100,7 +100,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -110,9 +110,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Point^Inspect::inspect" = fn(ref Point, ref Formatter); @@ -233,14 +233,14 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_19, 105); - String::append_char(__local_19, 110); - String::append_char(__local_19, 115); - String::append_char(__local_19, 112); - String::append_char(__local_19, 101); - String::append_char(__local_19, 99); - String::append_char(__local_19, 116); - String::append_char(__local_19, 61); + String::push(__local_19, 105); + String::push(__local_19, 110); + String::push(__local_19, 115); + String::push(__local_19, 112); + String::push(__local_19, 101); + String::push(__local_19, 99); + String::push(__local_19, 116); + String::push(__local_19, 61); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; i32::fmt_decimal(total, __local_20); break __tmpl: __local_19; @@ -258,15 +258,15 @@ fn run() with Stdout { p_6 = Point { x: i_5, y: i_5 * 2 }; s_7 = __tmpl: block -> ref String { __tmpl_buf_78.used = 0; - String::append_char(__tmpl_buf_78, 112); - String::append_char(__tmpl_buf_78, 111); - String::append_char(__tmpl_buf_78, 105); - String::append_char(__tmpl_buf_78, 110); - String::append_char(__tmpl_buf_78, 116); - String::append_char(__tmpl_buf_78, 61); + String::push(__tmpl_buf_78, 112); + String::push(__tmpl_buf_78, 111); + String::push(__tmpl_buf_78, 105); + String::push(__tmpl_buf_78, 110); + String::push(__tmpl_buf_78, 116); + String::push(__tmpl_buf_78, 61); __fmt_buf_79.indent = 0; Point^Inspect::inspect(p_6, __fmt_buf_79); - String::append_char(__tmpl_buf_78, 33); + String::push(__tmpl_buf_78, 33); break __tmpl: __tmpl_buf_78; }; total2 = total2 + s_7.used; @@ -277,10 +277,10 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_23, 99); - String::append_char(__local_23, 116); - String::append_char(__local_23, 120); - String::append_char(__local_23, 61); + String::push(__local_23, 99); + String::push(__local_23, 116); + String::push(__local_23, 120); + String::push(__local_23, 61); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; i32::fmt_decimal(total2, __local_24); break __tmpl: __local_23; @@ -302,9 +302,9 @@ fn run() with Stdout { __tmpl_buf_80.used = 0; __fmt_buf_81.indent = 0; Point^Inspect::inspect(p_10, __fmt_buf_81); - String::append_char(__tmpl_buf_80, 32); - String::append_char(__tmpl_buf_80, 100); - String::append_char(__tmpl_buf_80, 61); + String::push(__tmpl_buf_80, 32); + String::push(__tmpl_buf_80, 100); + String::push(__tmpl_buf_80, 61); __fmt_buf_82.indent = 0; f64::fmt_into(d, __fmt_buf_82); break __tmpl: __tmpl_buf_80; @@ -317,12 +317,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_27, 109); - String::append_char(__local_27, 105); - String::append_char(__local_27, 120); - String::append_char(__local_27, 101); - String::append_char(__local_27, 100); - String::append_char(__local_27, 61); + String::push(__local_27, 109); + String::push(__local_27, 105); + String::push(__local_27, 120); + String::push(__local_27, 101); + String::push(__local_27, 100); + String::push(__local_27, 61); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; i32::fmt_decimal(total3, __local_28); break __tmpl: __local_27; @@ -343,9 +343,9 @@ fn run() with Stdout { __tmpl_buf_83.used = 0; __fmt_buf_84.indent = 0; Point^Inspect::inspect(p_15, __fmt_buf_84); - String::append_char(__tmpl_buf_83, 32); - String::append_char(__tmpl_buf_83, 105); - String::append_char(__tmpl_buf_83, 61); + String::push(__tmpl_buf_83, 32); + String::push(__tmpl_buf_83, 105); + String::push(__tmpl_buf_83, 61); __fmt_buf_85.indent = 0; i32::fmt_decimal(i_14, __fmt_buf_85); break __tmpl: __tmpl_buf_83; @@ -358,11 +358,11 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_31, 98); - String::append_char(__local_31, 111); - String::append_char(__local_31, 116); - String::append_char(__local_31, 104); - String::append_char(__local_31, 61); + String::push(__local_31, 98); + String::push(__local_31, 111); + String::push(__local_31, 116); + String::push(__local_31, 104); + String::push(__local_31, 61); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; i32::fmt_decimal(total4, __local_32); break __tmpl: __local_31; @@ -1130,8 +1130,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1186,8 +1186,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1219,7 +1219,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1348,27 +1348,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1489,9 +1489,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1545,13 +1545,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1586,9 +1586,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1641,7 +1641,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1656,7 +1656,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1690,17 +1690,17 @@ fn Point^Inspect::inspect(self, f) { let s_13: ref String; let s_19: ref String; s_3 = String { repr: array.new_data("Point { "), used: 8 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("x: "), used: 3 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); i32::fmt_decimal(self.x, f); s_11 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); s_13 = String { repr: array.new_data("y: "), used: 3 }; - String::append(f.buf, s_13); + String::push_str(f.buf, s_13); i32::fmt_decimal(self.y, f); s_19 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_19); + String::push_str(f.buf, s_19); } fn Formatter::write_char_n(self, c, n) { @@ -1714,7 +1714,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l165; }; @@ -1872,20 +1872,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1895,10 +1895,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1908,10 +1908,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1919,10 +1919,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_formatter.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_formatter.wir.wado index a01eb0494..a4f62fcfa 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_formatter.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_formatter.wir.wado @@ -99,7 +99,7 @@ type "functype/count_digits_base" = fn(i64, i32) -> i32; type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -109,9 +109,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -223,12 +223,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_13, 116); - String::append_char(__local_13, 111); - String::append_char(__local_13, 116); - String::append_char(__local_13, 97); - String::append_char(__local_13, 108); - String::append_char(__local_13, 61); + String::push(__local_13, 116); + String::push(__local_13, 111); + String::push(__local_13, 116); + String::push(__local_13, 97); + String::push(__local_13, 108); + String::push(__local_13, 61); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(total, __local_14); break __tmpl: __local_13; @@ -257,13 +257,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_17, 116); - String::append_char(__local_17, 111); - String::append_char(__local_17, 116); - String::append_char(__local_17, 97); - String::append_char(__local_17, 108); - String::append_char(__local_17, 50); - String::append_char(__local_17, 61); + String::push(__local_17, 116); + String::push(__local_17, 111); + String::push(__local_17, 116); + String::push(__local_17, 97); + String::push(__local_17, 108); + String::push(__local_17, 50); + String::push(__local_17, 61); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; i32::fmt_decimal(total2, __local_18); break __tmpl: __local_17; @@ -282,14 +282,14 @@ fn run() with Stdout { x_9 = builtin::f64_convert_i32_s(i_8); s_10 = __tmpl: block -> ref String { __tmpl_buf_61.used = 0; - String::append_char(__tmpl_buf_61, 105); - String::append_char(__tmpl_buf_61, 61); + String::push(__tmpl_buf_61, 105); + String::push(__tmpl_buf_61, 61); __fmt_buf_62.indent = 0; i32::fmt_decimal(i_8, __fmt_buf_62); - String::append_char(__tmpl_buf_61, 44); - String::append_char(__tmpl_buf_61, 32); - String::append_char(__tmpl_buf_61, 120); - String::append_char(__tmpl_buf_61, 61); + String::push(__tmpl_buf_61, 44); + String::push(__tmpl_buf_61, 32); + String::push(__tmpl_buf_61, 120); + String::push(__tmpl_buf_61, 61); __fmt_buf_63.indent = 0; f64::fmt_into(x_9, __fmt_buf_63); break __tmpl: __tmpl_buf_61; @@ -302,13 +302,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_21, 116); - String::append_char(__local_21, 111); - String::append_char(__local_21, 116); - String::append_char(__local_21, 97); - String::append_char(__local_21, 108); - String::append_char(__local_21, 51); - String::append_char(__local_21, 61); + String::push(__local_21, 116); + String::push(__local_21, 111); + String::push(__local_21, 116); + String::push(__local_21, 97); + String::push(__local_21, 108); + String::push(__local_21, 51); + String::push(__local_21, 61); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; i32::fmt_decimal(total3, __local_22); break __tmpl: __local_21; @@ -1076,8 +1076,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1132,8 +1132,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1165,7 +1165,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1355,27 +1355,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1510,9 +1510,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1566,13 +1566,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1607,9 +1607,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1676,7 +1676,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1691,7 +1691,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1729,7 +1729,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l173; }; @@ -1887,20 +1887,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1910,10 +1910,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1923,10 +1923,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1934,10 +1934,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tmpl_hoist_loop.wir.wado b/wado-compiler/tests/fixtures.golden/tmpl_hoist_loop.wir.wado index 6486ad0da..c05e0edcf 100644 --- a/wado-compiler/tests/fixtures.golden/tmpl_hoist_loop.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tmpl_hoist_loop.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -126,12 +126,12 @@ fn run() with Stdout { }; s_2 = __tmpl: block -> ref String { __tmpl_buf_57.used = 0; - String::append_char(__tmpl_buf_57, 118); - String::append_char(__tmpl_buf_57, 97); - String::append_char(__tmpl_buf_57, 108); - String::append_char(__tmpl_buf_57, 117); - String::append_char(__tmpl_buf_57, 101); - String::append_char(__tmpl_buf_57, 61); + String::push(__tmpl_buf_57, 118); + String::push(__tmpl_buf_57, 97); + String::push(__tmpl_buf_57, 108); + String::push(__tmpl_buf_57, 117); + String::push(__tmpl_buf_57, 101); + String::push(__tmpl_buf_57, 61); __fmt_buf_58.indent = 0; i32::fmt_decimal(i_1, __fmt_buf_58); break __tmpl: __tmpl_buf_57; @@ -144,12 +144,12 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 116); - String::append_char(__local_11, 111); - String::append_char(__local_11, 116); - String::append_char(__local_11, 97); - String::append_char(__local_11, 108); - String::append_char(__local_11, 61); + String::push(__local_11, 116); + String::push(__local_11, 111); + String::push(__local_11, 116); + String::push(__local_11, 97); + String::push(__local_11, 108); + String::push(__local_11, 61); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(total, __local_12); break __tmpl: __local_11; @@ -168,14 +168,14 @@ fn run() with Stdout { x = i_4 * 10; s_6 = __tmpl: block -> ref String { __tmpl_buf_59.used = 0; - String::append_char(__tmpl_buf_59, 105); - String::append_char(__tmpl_buf_59, 61); + String::push(__tmpl_buf_59, 105); + String::push(__tmpl_buf_59, 61); __fmt_buf_60.indent = 0; i32::fmt_decimal(i_4, __fmt_buf_60); - String::append_char(__tmpl_buf_59, 44); - String::append_char(__tmpl_buf_59, 32); - String::append_char(__tmpl_buf_59, 120); - String::append_char(__tmpl_buf_59, 61); + String::push(__tmpl_buf_59, 44); + String::push(__tmpl_buf_59, 32); + String::push(__tmpl_buf_59, 120); + String::push(__tmpl_buf_59, 61); __fmt_buf_61.indent = 0; i32::fmt_decimal(x, __fmt_buf_61); break __tmpl: __tmpl_buf_59; @@ -188,13 +188,13 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_15, 116); - String::append_char(__local_15, 111); - String::append_char(__local_15, 116); - String::append_char(__local_15, 97); - String::append_char(__local_15, 108); - String::append_char(__local_15, 50); - String::append_char(__local_15, 61); + String::push(__local_15, 116); + String::push(__local_15, 111); + String::push(__local_15, 116); + String::push(__local_15, 97); + String::push(__local_15, 108); + String::push(__local_15, 50); + String::push(__local_15, 61); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(total2, __local_16); break __tmpl: __local_15; @@ -208,11 +208,11 @@ fn run() with Stdout { }; s_8 = __tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_17, 105); - String::append_char(__local_17, 116); - String::append_char(__local_17, 101); - String::append_char(__local_17, 109); - String::append_char(__local_17, 95); + String::push(__local_17, 105); + String::push(__local_17, 116); + String::push(__local_17, 101); + String::push(__local_17, 109); + String::push(__local_17, 95); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; i32::fmt_decimal(i_7, __local_18); break __tmpl: __local_17; @@ -420,7 +420,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -435,7 +435,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -473,7 +473,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l32; }; @@ -507,20 +507,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -530,10 +530,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -543,10 +543,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -554,10 +554,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_basic.wir.wado b/wado-compiler/tests/fixtures.golden/trait_basic.wir.wado index 878ae1015..f27901c19 100644 --- a/wado-compiler/tests/fixtures.golden/trait_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_basic.wir.wado @@ -45,7 +45,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/wasi/stream-drop-writable" = fn(i32); @@ -188,7 +188,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -207,9 +207,9 @@ fn Person^Greet::greet(self) { let __local_1: ref String; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(24), used: 0 }; - String::append(__local_1, String { repr: array.new_data("Hello, "), used: 7 }); - String::append(__local_1, self); - String::append(__local_1, String { repr: array.new_data("!"), used: 1 }); + String::push_str(__local_1, String { repr: array.new_data("Hello, "), used: 7 }); + String::push_str(__local_1, self); + String::push_str(__local_1, String { repr: array.new_data("!"), used: 1 }); break __tmpl: __local_1; }; } diff --git a/wado-compiler/tests/fixtures.golden/trait_bound_1.wir.wado b/wado-compiler/tests/fixtures.golden/trait_bound_1.wir.wado index db3d08692..b8d2e334d 100644 --- a/wado-compiler/tests/fixtures.golden/trait_bound_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_bound_1.wir.wado @@ -94,13 +94,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Pair^Ord::cmp" = fn(ref Pair, ref Pair) -> enum:Ordering; -type "functype/Array::append" = fn(ref Array>, ref "core:internal/Box"); +type "functype/Array::push" = fn(ref Array>, ref "core:internal/Box"); type "functype/Array::grow" = fn(ref Array>); @@ -432,7 +432,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -447,7 +447,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -483,7 +483,7 @@ fn Pair^Ord::cmp(self, other) { return c; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -536,7 +536,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -570,20 +570,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -593,10 +593,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -606,10 +606,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -617,10 +617,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_bound_2.wir.wado b/wado-compiler/tests/fixtures.golden/trait_bound_2.wir.wado index 3782907e8..352369d41 100644 --- a/wado-compiler/tests/fixtures.golden/trait_bound_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_bound_2.wir.wado @@ -72,11 +72,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -402,7 +402,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -460,7 +460,7 @@ fn String^Ord::cmp(self, other) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -498,7 +498,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l36; }; @@ -532,20 +532,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -555,10 +555,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -568,10 +568,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -579,10 +579,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_bound_3.wir.wado b/wado-compiler/tests/fixtures.golden/trait_bound_3.wir.wado index 87ab2b385..2cb9f0b1d 100644 --- a/wado-compiler/tests/fixtures.golden/trait_bound_3.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_bound_3.wir.wado @@ -73,9 +73,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -159,9 +159,9 @@ fn describe(x) { let __local_2: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_1, x.player_name); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push_str(__local_1, x.player_name); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(x.player_score, __local_2); break __tmpl: __local_1; @@ -354,7 +354,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -369,7 +369,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -407,7 +407,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -441,20 +441,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -464,10 +464,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -477,10 +477,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -488,10 +488,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_bound_4.wir.wado b/wado-compiler/tests/fixtures.golden/trait_bound_4.wir.wado index 2c600b6a8..599d8337a 100644 --- a/wado-compiler/tests/fixtures.golden/trait_bound_4.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_bound_4.wir.wado @@ -91,9 +91,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Point^Describe::describe" = fn(ref Point) -> ref String; @@ -101,11 +101,11 @@ type "functype/Array>^Eq::eq" = fn(ref Array>, ref Array^Eq::eq" = fn(ref Array, ref Array) -> bool; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array>::append" = fn(ref Array>, ref Array); +type "functype/Array>::push" = fn(ref Array>, ref Array); type "functype/Array>::grow" = fn(ref Array>); @@ -145,15 +145,15 @@ fn trait_bound_multi_satisfied() with Stdout { "core:cli/println"(Button^Drawable::draw(__sroa_w_item.label)); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_2, 99); - String::append_char(__local_2, 108); - String::append_char(__local_2, 105); - String::append_char(__local_2, 99); - String::append_char(__local_2, 107); - String::append_char(__local_2, 101); - String::append_char(__local_2, 100); - String::append_char(__local_2, 32); - String::append(__local_2, __sroa_w_item.label); + String::push(__local_2, 99); + String::push(__local_2, 108); + String::push(__local_2, 105); + String::push(__local_2, 99); + String::push(__local_2, 107); + String::push(__local_2, 101); + String::push(__local_2, 100); + String::push(__local_2, 32); + String::push_str(__local_2, __sroa_w_item.label); break __tmpl: __local_2; }); } @@ -407,7 +407,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -422,7 +422,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -456,16 +456,16 @@ fn Point^Describe::describe(self) { let __local_11: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(36), used: 0 }; - String::append_char(__local_1, 40); + String::push(__local_1, 40); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_6 = __local_2; i32::fmt_decimal(self.x, __local_6); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_11 = __local_2; i32::fmt_decimal(self.y, __local_11); - String::append_char(__local_1, 41); + String::push(__local_1, 41); break __tmpl: __local_1; }; } @@ -475,10 +475,10 @@ fn i32^Describe::describe(self) { let __local_2: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_1, 105); - String::append_char(__local_1, 110); - String::append_char(__local_1, 116); - String::append_char(__local_1, 58); + String::push(__local_1, 105); + String::push(__local_1, 110); + String::push(__local_1, 116); + String::push(__local_1, 58); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(self, __local_2); break __tmpl: __local_1; @@ -489,9 +489,9 @@ fn Button^Drawable::draw(self) { let __local_1: ref String; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_1, 91); - String::append(__local_1, self); - String::append_char(__local_1, 93); + String::push(__local_1, 91); + String::push_str(__local_1, self); + String::push(__local_1, 93); break __tmpl: __local_1; }; } @@ -504,7 +504,7 @@ fn Array>^Eq::eq(self, other) { if self.used != other.used { return 0; }; - __for_3: block { + __for_9: block { i = 0; _licm_used_3 = self.used; _licm_repr_4 = self.repr; @@ -512,7 +512,7 @@ fn Array>^Eq::eq(self, other) { block { l25: loop { if (i < _licm_used_3) == 0 { - break __for_3; + break __for_9; }; if Array^Eq::eq(builtin::array_get>(_licm_repr_4, i), builtin::array_get>(_licm_repr_5, i)) == 0 { return 0; @@ -533,7 +533,7 @@ fn Array^Eq::eq(self, other) { if self.used != other.used { return 0; }; - __for_3: block { + __for_9: block { i = 0; _licm_used_3 = self.used; _licm_repr_4 = self.repr; @@ -541,7 +541,7 @@ fn Array^Eq::eq(self, other) { block { l30: loop { if (i < _licm_used_3) == 0 { - break __for_3; + break __for_9; }; if (builtin::array_get(_licm_repr_4, i) == builtin::array_get(_licm_repr_5, i)) == 0 { return 0; @@ -554,7 +554,7 @@ fn Array^Eq::eq(self, other) { return 1; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -596,7 +596,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -649,7 +649,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l42; }; @@ -683,20 +683,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -706,10 +706,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -719,10 +719,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -730,10 +730,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_bound_5.wir.wado b/wado-compiler/tests/fixtures.golden/trait_bound_5.wir.wado index 6e5141243..8c084e8cd 100644 --- a/wado-compiler/tests/fixtures.golden/trait_bound_5.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_bound_5.wir.wado @@ -82,9 +82,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -358,7 +358,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -373,7 +373,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -442,15 +442,15 @@ fn Wrapper^Describable::describe(self) { let __local_5: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(25), used: 0 }; - String::append_char(__local_1, 87); - String::append_char(__local_1, 114); - String::append_char(__local_1, 97); - String::append_char(__local_1, 112); - String::append_char(__local_1, 112); - String::append_char(__local_1, 101); - String::append_char(__local_1, 114); - String::append_char(__local_1, 40); - String::append(__local_1, __inline_i32_Describable__describe_1: block -> ref String { + String::push(__local_1, 87); + String::push(__local_1, 114); + String::push(__local_1, 97); + String::push(__local_1, 112); + String::push(__local_1, 112); + String::push(__local_1, 101); + String::push(__local_1, 114); + String::push(__local_1, 40); + String::push_str(__local_1, __inline_i32_Describable__describe_1: block -> ref String { __tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(16), used: 0 }; __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; @@ -459,7 +459,7 @@ fn Wrapper^Describable::describe(self) { }; break __inline_i32_Describable__describe_1; }); - String::append_char(__local_1, 41); + String::push(__local_1, 41); break __tmpl: __local_1; }; } @@ -475,7 +475,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l33; }; @@ -509,20 +509,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -532,10 +532,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -545,10 +545,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -556,10 +556,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_bound_6.wir.wado b/wado-compiler/tests/fixtures.golden/trait_bound_6.wir.wado index 1504a0b9e..9eefe9542 100644 --- a/wado-compiler/tests/fixtures.golden/trait_bound_6.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_bound_6.wir.wado @@ -74,9 +74,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -320,7 +320,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -335,7 +335,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -373,7 +373,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -407,20 +407,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -430,10 +430,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -443,10 +443,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -454,10 +454,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_bound_7.wir.wado b/wado-compiler/tests/fixtures.golden/trait_bound_7.wir.wado index 210047ad3..6b60f73a0 100644 --- a/wado-compiler/tests/fixtures.golden/trait_bound_7.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_bound_7.wir.wado @@ -102,15 +102,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -442,7 +442,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -486,7 +486,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -557,7 +557,7 @@ fn Holder::min(self) { return m; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -656,7 +656,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l49; }; @@ -690,20 +690,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -713,10 +713,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -726,10 +726,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -737,10 +737,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_bound_add_generic.wir.wado b/wado-compiler/tests/fixtures.golden/trait_bound_add_generic.wir.wado index 871554717..2948a48ca 100644 --- a/wado-compiler/tests/fixtures.golden/trait_bound_add_generic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_bound_add_generic.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -120,8 +120,8 @@ fn run() with Stdout { __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_11 = __local_2; i32::fmt_decimal(result.x, __local_11); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); + String::push(__local_1, 44); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; __local_16 = __local_2; i32::fmt_decimal(result.y, __local_16); @@ -324,7 +324,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -339,7 +339,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -377,7 +377,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -411,20 +411,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -434,10 +434,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -458,10 +458,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_bound_crossmod.wir.wado b/wado-compiler/tests/fixtures.golden/trait_bound_crossmod.wir.wado index 03a3fc1c0..f88040231 100644 --- a/wado-compiler/tests/fixtures.golden/trait_bound_crossmod.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_bound_crossmod.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -324,7 +324,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -339,7 +339,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -377,7 +377,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -411,20 +411,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -434,10 +434,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -458,10 +458,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_bound_method_on_type_param_builtin.wir.wado b/wado-compiler/tests/fixtures.golden/trait_bound_method_on_type_param_builtin.wir.wado index 0181dea27..71f081c61 100644 --- a/wado-compiler/tests/fixtures.golden/trait_bound_method_on_type_param_builtin.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_bound_method_on_type_param_builtin.wir.wado @@ -66,9 +66,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -331,7 +331,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -346,7 +346,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -384,7 +384,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -418,20 +418,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -441,10 +441,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -454,10 +454,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -465,10 +465,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_default.wir.wado b/wado-compiler/tests/fixtures.golden/trait_default.wir.wado index 41b1bb926..f150223c2 100644 --- a/wado-compiler/tests/fixtures.golden/trait_default.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_default.wir.wado @@ -98,15 +98,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Article^Summary::summary" = fn(ref Article) -> ref String; type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref Option; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -151,8 +151,8 @@ fn trait_default_calls_default() with Stdout { "core:cli/println"(Item^Describable::short_desc(__sroa_item_name)); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Description: "), used: 13 }); - String::append(__local_3, Item^Describable::short_desc(__sroa_item_name)); + String::push_str(__local_3, String { repr: array.new_data("Description: "), used: 13 }); + String::push_str(__local_3, Item^Describable::short_desc(__sroa_item_name)); break __tmpl: __local_3; }); } @@ -204,14 +204,14 @@ fn trait_default_override() with Stdout { __sroa_t_text = String { repr: array.new_data("Hello world"), used: 11 }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_3, 84); - String::append_char(__local_3, 105); - String::append_char(__local_3, 116); - String::append_char(__local_3, 108); - String::append_char(__local_3, 101); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); - String::append(__local_3, __sroa_t_text); + String::push(__local_3, 84); + String::push(__local_3, 105); + String::push(__local_3, 116); + String::push(__local_3, 108); + String::push(__local_3, 101); + String::push(__local_3, 58); + String::push(__local_3, 32); + String::push_str(__local_3, __sroa_t_text); break __tmpl: __local_3; }); } @@ -423,7 +423,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -438,7 +438,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -469,12 +469,12 @@ fn Person^Greet::greet(self) { let __local_1: ref String; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_1, 72); - String::append_char(__local_1, 105); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); - String::append(__local_1, self); - String::append_char(__local_1, 33); + String::push(__local_1, 72); + String::push(__local_1, 105); + String::push(__local_1, 44); + String::push(__local_1, 32); + String::push_str(__local_1, self); + String::push(__local_1, 33); break __tmpl: __local_1; }; } @@ -484,12 +484,12 @@ fn Robot^Greet::name(self) { let __local_2: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_1, 82); - String::append_char(__local_1, 111); - String::append_char(__local_1, 98); - String::append_char(__local_1, 111); - String::append_char(__local_1, 116); - String::append_char(__local_1, 45); + String::push(__local_1, 82); + String::push(__local_1, 111); + String::push(__local_1, 98); + String::push(__local_1, 111); + String::push(__local_1, 116); + String::push(__local_1, 45); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(self, __local_2); break __tmpl: __local_1; @@ -500,15 +500,15 @@ fn Robot^Greet::greet(self) { let __local_1: ref String; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_1, 72); - String::append_char(__local_1, 101); - String::append_char(__local_1, 108); - String::append_char(__local_1, 108); - String::append_char(__local_1, 111); - String::append_char(__local_1, 44); - String::append_char(__local_1, 32); - String::append(__local_1, Robot^Greet::name(self)); - String::append_char(__local_1, 33); + String::push(__local_1, 72); + String::push(__local_1, 101); + String::push(__local_1, 108); + String::push(__local_1, 108); + String::push(__local_1, 111); + String::push(__local_1, 44); + String::push(__local_1, 32); + String::push_str(__local_1, Robot^Greet::name(self)); + String::push(__local_1, 33); break __tmpl: __local_1; }; } @@ -517,9 +517,9 @@ fn Item^Describable::short_desc(self) { let __local_1: ref String; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_1, 91); - String::append(__local_1, self); - String::append_char(__local_1, 93); + String::push(__local_1, 91); + String::push_str(__local_1, self); + String::push(__local_1, 93); break __tmpl: __local_1; }; } @@ -528,11 +528,11 @@ fn Article^Summary::summary(self) { let __local_1: ref String; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_1, self.headline); - String::append_char(__local_1, 32); - String::append_char(__local_1, 45); - String::append_char(__local_1, 32); - String::append(__local_1, self.content); + String::push_str(__local_1, self.headline); + String::push(__local_1, 32); + String::push(__local_1, 45); + String::push(__local_1, 32); + String::push_str(__local_1, self.content); break __tmpl: __local_1; }; } @@ -547,7 +547,7 @@ fn ArrayIter^Iterator::next(self) { return Option::Some { discriminant: 0, payload_0: item }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -600,7 +600,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -634,20 +634,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -657,10 +657,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -670,10 +670,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -681,10 +681,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_generic_option_return.wir.wado b/wado-compiler/tests/fixtures.golden/trait_generic_option_return.wir.wado index f767ae7e5..15f51be57 100644 --- a/wado-compiler/tests/fixtures.golden/trait_generic_option_return.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_generic_option_return.wir.wado @@ -74,9 +74,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -113,11 +113,11 @@ fn run() with Stdout { v = ref.cast Option::Some(result).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_3, 71); - String::append_char(__local_3, 111); - String::append_char(__local_3, 116); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 71); + String::push(__local_3, 111); + String::push(__local_3, 116); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(v, __local_4); break __tmpl: __local_3; @@ -322,7 +322,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -337,7 +337,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -375,7 +375,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -409,20 +409,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -432,10 +432,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -445,10 +445,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -456,10 +456,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_inherent_priority.wir.wado b/wado-compiler/tests/fixtures.golden/trait_inherent_priority.wir.wado index 3a9a6c003..96d7105e8 100644 --- a/wado-compiler/tests/fixtures.golden/trait_inherent_priority.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_inherent_priority.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -294,7 +294,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -309,7 +309,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -341,7 +341,7 @@ fn Robot::greet(self) { let __local_2: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(39), used: 0 }; - String::append(__local_1, String { repr: array.new_data("Beep boop, I am Robot #"), used: 23 }); + String::push_str(__local_1, String { repr: array.new_data("Beep boop, I am Robot #"), used: 23 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(self, __local_2); break __tmpl: __local_1; @@ -359,7 +359,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -393,20 +393,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -416,10 +416,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -440,10 +440,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_method_calls_method.wir.wado b/wado-compiler/tests/fixtures.golden/trait_method_calls_method.wir.wado index 1cf583fc4..8c1de47d8 100644 --- a/wado-compiler/tests/fixtures.golden/trait_method_calls_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_method_calls_method.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Point^Describable::describe" = fn(ref Point) -> ref String; @@ -303,7 +303,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -318,7 +318,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -355,26 +355,26 @@ fn Point^Describable::describe(self) { s = self.x + self.y; return __tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(62), used: 0 }; - String::append_char(__local_2, 80); - String::append_char(__local_2, 111); - String::append_char(__local_2, 105); - String::append_char(__local_2, 110); - String::append_char(__local_2, 116); - String::append_char(__local_2, 40); + String::push(__local_2, 80); + String::push(__local_2, 111); + String::push(__local_2, 105); + String::push(__local_2, 110); + String::push(__local_2, 116); + String::push(__local_2, 40); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_8 = __local_3; i32::fmt_decimal(self.x, __local_8); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_13 = __local_3; i32::fmt_decimal(self.y, __local_13); - String::append_char(__local_2, 41); - String::append_char(__local_2, 32); - String::append_char(__local_2, 115); - String::append_char(__local_2, 117); - String::append_char(__local_2, 109); - String::append_char(__local_2, 61); + String::push(__local_2, 41); + String::push(__local_2, 32); + String::push(__local_2, 115); + String::push(__local_2, 117); + String::push(__local_2, 109); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_18 = __local_3; i32::fmt_decimal(s, __local_18); @@ -393,7 +393,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -427,20 +427,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -450,10 +450,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -463,10 +463,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -474,10 +474,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_method_generic_return_on_assoc_type.wir.wado b/wado-compiler/tests/fixtures.golden/trait_method_generic_return_on_assoc_type.wir.wado index 1c43bf39a..3c1389643 100644 --- a/wado-compiler/tests/fixtures.golden/trait_method_generic_return_on_assoc_type.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_method_generic_return_on_assoc_type.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -305,7 +305,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -320,7 +320,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -358,7 +358,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -392,20 +392,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -415,10 +415,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -428,10 +428,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -439,10 +439,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_multiple.wir.wado b/wado-compiler/tests/fixtures.golden/trait_multiple.wir.wado index 39d32289e..bfb90b5d0 100644 --- a/wado-compiler/tests/fixtures.golden/trait_multiple.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_multiple.wir.wado @@ -93,7 +93,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -101,7 +101,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -154,14 +154,14 @@ fn trait_multiple_methods() with Stdout { "core:cli/println"(String { repr: array.new_data("Rectangle"), used: 9 }); "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(22), used: 0 }; - String::append(__local_1, String { repr: array.new_data("Area: "), used: 6 }); + String::push_str(__local_1, String { repr: array.new_data("Area: "), used: 6 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; f64::fmt_into(12, __local_2); break __tmpl: __local_1; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Perimeter: "), used: 11 }); + String::push_str(__local_3, String { repr: array.new_data("Perimeter: "), used: 11 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; f64::fmt_into(14, __local_4); break __tmpl: __local_3; @@ -184,14 +184,14 @@ fn run() with Stdout { __sroa_dog_name = String { repr: array.new_data("Buddy"), used: 5 }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_3, String { repr: array.new_data("A cat named "), used: 12 }); - String::append(__local_3, __sroa_cat_name); + String::push_str(__local_3, String { repr: array.new_data("A cat named "), used: 12 }); + String::push_str(__local_3, __sroa_cat_name); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_5, String { repr: array.new_data("A dog named "), used: 12 }); - String::append(__local_5, __sroa_dog_name); + String::push_str(__local_5, String { repr: array.new_data("A dog named "), used: 12 }); + String::push_str(__local_5, __sroa_dog_name); break __tmpl: __local_5; }); trait_multiple_methods(); @@ -217,14 +217,14 @@ fn __cm_export__run() { __sroa_dog_name = String { repr: array.new_data("Buddy"), used: 5 }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_3, String { repr: array.new_data("A cat named "), used: 12 }); - String::append(__local_3, __sroa_cat_name); + String::push_str(__local_3, String { repr: array.new_data("A cat named "), used: 12 }); + String::push_str(__local_3, __sroa_cat_name); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_5, String { repr: array.new_data("A dog named "), used: 12 }); - String::append(__local_5, __sroa_dog_name); + String::push_str(__local_5, String { repr: array.new_data("A dog named "), used: 12 }); + String::push_str(__local_5, __sroa_dog_name); break __tmpl: __local_5; }); trait_multiple_methods(); @@ -983,7 +983,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1038,7 +1038,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1070,7 +1070,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1152,25 +1152,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1271,9 +1271,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1327,13 +1327,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1368,9 +1368,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1411,7 +1411,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/trait_multiple_traits.wir.wado b/wado-compiler/tests/fixtures.golden/trait_multiple_traits.wir.wado index 310067c41..76ac52d20 100644 --- a/wado-compiler/tests/fixtures.golden/trait_multiple_traits.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_multiple_traits.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -104,30 +104,30 @@ fn run() with Stdout { __sroa_p_city = String { repr: array.new_data("Tokyo"), used: 5 }; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_1, 78); - String::append_char(__local_1, 97); - String::append_char(__local_1, 109); - String::append_char(__local_1, 101); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); - String::append(__local_1, __sroa_p_name); + String::push(__local_1, 78); + String::push(__local_1, 97); + String::push(__local_1, 109); + String::push(__local_1, 101); + String::push(__local_1, 58); + String::push(__local_1, 32); + String::push_str(__local_1, __sroa_p_name); break __tmpl: __local_1; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_2, 65); - String::append_char(__local_2, 103); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 65); + String::push(__local_2, 103); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(30, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(26), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Location: "), used: 10 }); - String::append(__local_4, __sroa_p_city); + String::push_str(__local_4, String { repr: array.new_data("Location: "), used: 10 }); + String::push_str(__local_4, __sroa_p_city); break __tmpl: __local_4; }); } @@ -327,7 +327,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -342,7 +342,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -380,7 +380,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -414,20 +414,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -437,10 +437,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -450,10 +450,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -461,10 +461,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_mut_self.wir.wado b/wado-compiler/tests/fixtures.golden/trait_mut_self.wir.wado index 72bc5d8c3..43107f535 100644 --- a/wado-compiler/tests/fixtures.golden/trait_mut_self.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_mut_self.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,27 +100,27 @@ fn run() with Stdout { let __local_4: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(24), used: 0 }; - String::append_char(__local_1, 66); - String::append_char(__local_1, 101); - String::append_char(__local_1, 102); - String::append_char(__local_1, 111); - String::append_char(__local_1, 114); - String::append_char(__local_1, 101); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 66); + String::push(__local_1, 101); + String::push(__local_1, 102); + String::push(__local_1, 111); + String::push(__local_1, 114); + String::push(__local_1, 101); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(42, __local_2); break __tmpl: __local_1; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_3, 65); - String::append_char(__local_3, 102); - String::append_char(__local_3, 116); - String::append_char(__local_3, 101); - String::append_char(__local_3, 114); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 65); + String::push(__local_3, 102); + String::push(__local_3, 116); + String::push(__local_3, 101); + String::push(__local_3, 114); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(0, __local_4); break __tmpl: __local_3; @@ -322,7 +322,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -337,7 +337,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -375,7 +375,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -409,20 +409,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -432,10 +432,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -445,10 +445,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -456,10 +456,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_option_return.wir.wado b/wado-compiler/tests/fixtures.golden/trait_option_return.wir.wado index 3d67d0d51..3acf15d1d 100644 --- a/wado-compiler/tests/fixtures.golden/trait_option_return.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_option_return.wir.wado @@ -74,9 +74,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -113,11 +113,11 @@ fn run() with Stdout { v = ref.cast Option::Some(result).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_3, 71); - String::append_char(__local_3, 111); - String::append_char(__local_3, 116); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 71); + String::push(__local_3, 111); + String::push(__local_3, 116); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(v, __local_4); break __tmpl: __local_3; @@ -322,7 +322,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -337,7 +337,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -375,7 +375,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -409,20 +409,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -432,10 +432,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -445,10 +445,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -456,10 +456,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/trait_unit_return.wir.wado b/wado-compiler/tests/fixtures.golden/trait_unit_return.wir.wado index 65ae88958..637c30918 100644 --- a/wado-compiler/tests/fixtures.golden/trait_unit_return.wir.wado +++ b/wado-compiler/tests/fixtures.golden/trait_unit_return.wir.wado @@ -45,7 +45,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/wasi/stream-drop-writable" = fn(i32); @@ -72,8 +72,8 @@ fn run() with Stdout { __sroa_m_text = String { repr: array.new_data("Hello, World!"), used: 13 }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Message: "), used: 9 }); - String::append(__local_3, __sroa_m_text); + String::push_str(__local_3, String { repr: array.new_data("Message: "), used: 9 }); + String::push_str(__local_3, __sroa_m_text); break __tmpl: __local_3; }); } @@ -88,8 +88,8 @@ fn __cm_export__run() { __sroa_m_text = String { repr: array.new_data("Hello, World!"), used: 13 }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Message: "), used: 9 }); - String::append(__local_3, __sroa_m_text); + String::push_str(__local_3, String { repr: array.new_data("Message: "), used: 9 }); + String::push_str(__local_3, __sroa_m_text); break __tmpl: __local_3; }); "wasi/task-return"(0); @@ -202,7 +202,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/treemap-literal-basic.wir.wado b/wado-compiler/tests/fixtures.golden/treemap-literal-basic.wir.wado index 8d5088e8c..4aceef4ff 100644 --- a/wado-compiler/tests/fixtures.golden/treemap-literal-basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/treemap-literal-basic.wir.wado @@ -113,7 +113,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -121,7 +121,7 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/TreeMap^IndexValue::index_value" = fn(ref "core:allocator/TreeMap", ref String) -> i32; @@ -135,7 +135,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -223,27 +223,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-basic.wado"), used: 55 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-basic.wado"), used: 55 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_36 = __local_13; i32::fmt_decimal(8, __local_36); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: m.len() == 2 "), used: 25 }); - String::append(__local_12, String { repr: array.new_data("m.len(): "), used: 9 }); + String::push_str(__local_12, String { repr: array.new_data("m.len(): "), used: 9 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_41 = __local_13; i32::fmt_decimal(__v0_2, __local_41); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -255,23 +255,23 @@ condition: m.len() == 2 if __v0_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(151), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-basic.wado"), used: 55 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-basic.wado"), used: 55 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_49 = __local_15; i32::fmt_decimal(9, __local_49); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: m.contains_key(\"width\") "), used: 36 }); - String::append(__local_14, String { repr: array.new_data("m.contains_key(\"width\"): "), used: 25 }); + String::push_str(__local_14, String { repr: array.new_data("m.contains_key(\"width\"): "), used: 25 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_54 = __local_15; Formatter::pad(__local_54, if __v0_4 -> ref String { @@ -279,7 +279,7 @@ condition: m.contains_key(\"width\") } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -291,23 +291,23 @@ condition: m.contains_key(\"width\") if __v0_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(153), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-basic.wado"), used: 55 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-basic.wado"), used: 55 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_62 = __local_17; i32::fmt_decimal(10, __local_62); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: m.contains_key(\"height\") "), used: 37 }); - String::append(__local_16, String { repr: array.new_data("m.contains_key(\"height\"): "), used: 26 }); + String::push_str(__local_16, String { repr: array.new_data("m.contains_key(\"height\"): "), used: 26 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_67 = __local_17; Formatter::pad(__local_67, if __v0_6 -> ref String { @@ -315,7 +315,7 @@ condition: m.contains_key(\"height\") } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -325,27 +325,27 @@ condition: m.contains_key(\"height\") if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_18, 114); - String::append_char(__local_18, 117); - String::append_char(__local_18, 110); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-basic.wado"), used: 55 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_18, 114); + String::push(__local_18, 117); + String::push(__local_18, 110); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-basic.wado"), used: 55 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_73 = __local_19; i32::fmt_decimal(12, __local_73); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: m[\"width\"] == 1920 "), used: 31 }); - String::append(__local_18, String { repr: array.new_data("m[\"width\"]: "), used: 12 }); + String::push_str(__local_18, String { repr: array.new_data("m[\"width\"]: "), used: 12 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_78 = __local_19; i32::fmt_decimal(__v0_8, __local_78); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -355,27 +355,27 @@ condition: m[\"width\"] == 1920 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_20, 114); - String::append_char(__local_20, 117); - String::append_char(__local_20, 110); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-basic.wado"), used: 55 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_20, 114); + String::push(__local_20, 117); + String::push(__local_20, 110); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-basic.wado"), used: 55 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_84 = __local_21; i32::fmt_decimal(13, __local_84); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: m[\"height\"] == 1080 "), used: 32 }); - String::append(__local_20, String { repr: array.new_data("m[\"height\"]: "), used: 13 }); + String::push_str(__local_20, String { repr: array.new_data("m[\"height\"]: "), used: 13 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; __local_89 = __local_21; i32::fmt_decimal(__v0_10, __local_89); - String::append_char(__local_20, 10); + String::push(__local_20, 10); break __tmpl: __local_20; }); unreachable; @@ -615,7 +615,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -746,7 +746,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -782,7 +782,7 @@ fn TreeMap^IndexValue::index_value(self, key) { if index < 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -868,7 +868,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_i32____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -942,7 +942,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -995,7 +995,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l72; }; @@ -1015,7 +1015,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1023,17 +1023,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1063,20 +1063,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1086,10 +1086,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1099,10 +1099,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1110,10 +1110,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1125,7 +1125,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1142,22 +1142,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b95; @@ -1165,7 +1165,7 @@ fn String^Inspect::inspect(self, f) { continue l96; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/treemap-literal-cast.wir.wado b/wado-compiler/tests/fixtures.golden/treemap-literal-cast.wir.wado index ec046882d..10cc1301b 100644 --- a/wado-compiler/tests/fixtures.golden/treemap-literal-cast.wir.wado +++ b/wado-compiler/tests/fixtures.golden/treemap-literal-cast.wir.wado @@ -113,7 +113,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -121,7 +121,7 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/TreeMap^IndexValue::index_value" = fn(ref "core:allocator/TreeMap", ref String) -> i32; @@ -135,7 +135,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -212,27 +212,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-cast.wado"), used: 54 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-cast.wado"), used: 54 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_31 = __local_9; i32::fmt_decimal(8, __local_31); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: m.len() == 3 "), used: 25 }); - String::append(__local_8, String { repr: array.new_data("m.len(): "), used: 9 }); + String::push_str(__local_8, String { repr: array.new_data("m.len(): "), used: 9 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_36 = __local_9; i32::fmt_decimal(__v0_2, __local_36); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -242,34 +242,34 @@ condition: m.len() == 3 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-cast.wado"), used: 54 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-cast.wado"), used: 54 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_42 = __local_11; i32::fmt_decimal(10, __local_42); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: m[\"a\"] == 1 "), used: 24 }); - String::append_char(__local_10, 109); - String::append_char(__local_10, 91); - String::append_char(__local_10, 34); - String::append_char(__local_10, 97); - String::append_char(__local_10, 34); - String::append_char(__local_10, 93); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 109); + String::push(__local_10, 91); + String::push(__local_10, 34); + String::push(__local_10, 97); + String::push(__local_10, 34); + String::push(__local_10, 93); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_47 = __local_11; i32::fmt_decimal(__v0_4, __local_47); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -279,34 +279,34 @@ condition: m[\"a\"] == 1 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-cast.wado"), used: 54 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-cast.wado"), used: 54 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_53 = __local_13; i32::fmt_decimal(11, __local_53); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: m[\"c\"] == 3 "), used: 24 }); - String::append_char(__local_12, 109); - String::append_char(__local_12, 91); - String::append_char(__local_12, 34); - String::append_char(__local_12, 99); - String::append_char(__local_12, 34); - String::append_char(__local_12, 93); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 109); + String::push(__local_12, 91); + String::push(__local_12, 34); + String::push(__local_12, 99); + String::push(__local_12, 34); + String::push(__local_12, 93); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_58 = __local_13; i32::fmt_decimal(__v0_6, __local_58); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -546,7 +546,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -677,7 +677,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -713,7 +713,7 @@ fn TreeMap^IndexValue::index_value(self, key) { if index < 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -799,7 +799,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_i32____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -873,7 +873,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -926,7 +926,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l68; }; @@ -960,20 +960,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -983,10 +983,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -996,10 +996,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1007,10 +1007,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1022,7 +1022,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1039,22 +1039,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b87; @@ -1062,7 +1062,7 @@ fn String^Inspect::inspect(self, f) { continue l88; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/treemap-literal-empty.wir.wado b/wado-compiler/tests/fixtures.golden/treemap-literal-empty.wir.wado index a0b8f1be7..cb490aa55 100644 --- a/wado-compiler/tests/fixtures.golden/treemap-literal-empty.wir.wado +++ b/wado-compiler/tests/fixtures.golden/treemap-literal-empty.wir.wado @@ -100,9 +100,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -158,27 +158,27 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-empty.wado"), used: 55 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-empty.wado"), used: 55 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_18 = __local_7; i32::fmt_decimal(8, __local_18); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: m.len() == 0 "), used: 25 }); - String::append(__local_6, String { repr: array.new_data("m.len(): "), used: 9 }); + String::push_str(__local_6, String { repr: array.new_data("m.len(): "), used: 9 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_23 = __local_7; i32::fmt_decimal(__v0_2, __local_23); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -187,23 +187,23 @@ condition: m.len() == 0 if __v0_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-empty.wado"), used: 55 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-empty.wado"), used: 55 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_30 = __local_9; i32::fmt_decimal(9, __local_30); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: m.is_empty() "), used: 25 }); - String::append(__local_8, String { repr: array.new_data("m.is_empty(): "), used: 14 }); + String::push_str(__local_8, String { repr: array.new_data("m.is_empty(): "), used: 14 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_35 = __local_9; Formatter::pad(__local_35, if __v0_4 -> ref String { @@ -211,7 +211,7 @@ condition: m.is_empty() } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -451,7 +451,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -466,7 +466,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -504,7 +504,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -524,7 +524,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -532,17 +532,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -572,20 +572,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -595,10 +595,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -608,10 +608,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -619,10 +619,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/treemap-literal-fn-arg.wir.wado b/wado-compiler/tests/fixtures.golden/treemap-literal-fn-arg.wir.wado index 943719b1f..6f1d3918a 100644 --- a/wado-compiler/tests/fixtures.golden/treemap-literal-fn-arg.wir.wado +++ b/wado-compiler/tests/fixtures.golden/treemap-literal-fn-arg.wir.wado @@ -133,7 +133,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -141,7 +141,7 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/TreeMap::insert" = fn(ref "core:allocator/TreeMap", ref String, i32); @@ -151,7 +151,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -161,7 +161,7 @@ type "functype/ArrayIter>^Iterator::next" = fn(ref "core:alloc type "functype/TreeMap::entries" = fn(ref "core:allocator/TreeMap") -> ref Array>; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, i32]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, i32]"); type "functype/Array>::grow" = fn(ref Array>); @@ -248,33 +248,33 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-fn-arg.wado"), used: 56 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-fn-arg.wado"), used: 56 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_22 = __local_5; i32::fmt_decimal(15, __local_22); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: total == 60 "), used: 24 }); - String::append_char(__local_4, 116); - String::append_char(__local_4, 111); - String::append_char(__local_4, 116); - String::append_char(__local_4, 97); - String::append_char(__local_4, 108); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 116); + String::push(__local_4, 111); + String::push(__local_4, 116); + String::push(__local_4, 97); + String::push(__local_4, 108); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_27 = __local_5; i32::fmt_decimal(total, __local_27); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -514,7 +514,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -601,7 +601,7 @@ fn String^Ord::cmp(self, other) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -651,7 +651,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_i32____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -725,7 +725,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -844,7 +844,7 @@ fn TreeMap::entries(self) { if ref.is_null(__pattern_temp_0) == 0 { entry = value_copy "core:allocator/TreeMapEntry"(ref.as_non_null(__pattern_temp_0)); if entry.deleted == 0 { - Array>::append(result, "tuple/[String, i32]" { 0: entry.key, 1: entry.value }); + Array>::push(result, "tuple/[String, i32]" { 0: entry.key, 1: entry.value }); }; } else { break b63; @@ -855,7 +855,7 @@ fn TreeMap::entries(self) { return result; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -918,7 +918,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l73; }; @@ -952,20 +952,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -975,10 +975,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -988,10 +988,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -999,10 +999,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/treemap-literal-mutable.wir.wado b/wado-compiler/tests/fixtures.golden/treemap-literal-mutable.wir.wado index f6eec796d..bfb348921 100644 --- a/wado-compiler/tests/fixtures.golden/treemap-literal-mutable.wir.wado +++ b/wado-compiler/tests/fixtures.golden/treemap-literal-mutable.wir.wado @@ -113,7 +113,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -121,7 +121,7 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/TreeMap^IndexValue::index_value" = fn(ref "core:allocator/TreeMap", ref String) -> i32; @@ -135,7 +135,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -211,27 +211,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-mutable.wado"), used: 57 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-mutable.wado"), used: 57 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_28 = __local_9; i32::fmt_decimal(8, __local_28); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: m.len() == 2 "), used: 25 }); - String::append(__local_8, String { repr: array.new_data("m.len(): "), used: 9 }); + String::push_str(__local_8, String { repr: array.new_data("m.len(): "), used: 9 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_33 = __local_9; i32::fmt_decimal(__v0_2, __local_33); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -243,27 +243,27 @@ condition: m.len() == 2 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-mutable.wado"), used: 57 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-mutable.wado"), used: 57 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_43 = __local_11; i32::fmt_decimal(12, __local_43); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: m.len() == 3 "), used: 25 }); - String::append(__local_10, String { repr: array.new_data("m.len(): "), used: 9 }); + String::push_str(__local_10, String { repr: array.new_data("m.len(): "), used: 9 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_48 = __local_11; i32::fmt_decimal(__v0_4, __local_48); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -275,34 +275,34 @@ condition: m.len() == 3 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-mutable.wado"), used: 57 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-mutable.wado"), used: 57 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_57 = __local_13; i32::fmt_decimal(16, __local_57); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: m[\"x\"] == 100 "), used: 26 }); - String::append_char(__local_12, 109); - String::append_char(__local_12, 91); - String::append_char(__local_12, 34); - String::append_char(__local_12, 120); - String::append_char(__local_12, 34); - String::append_char(__local_12, 93); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 109); + String::push(__local_12, 91); + String::push(__local_12, 34); + String::push(__local_12, 120); + String::push(__local_12, 34); + String::push(__local_12, 93); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_62 = __local_13; i32::fmt_decimal(__v0_6, __local_62); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -542,7 +542,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -673,7 +673,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -709,7 +709,7 @@ fn TreeMap^IndexValue::index_value(self, key) { if index < 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -795,7 +795,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_i32____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -869,7 +869,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -922,7 +922,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l68; }; @@ -956,20 +956,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -979,10 +979,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -992,10 +992,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1003,10 +1003,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1018,7 +1018,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1035,22 +1035,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b87; @@ -1058,7 +1058,7 @@ fn String^Inspect::inspect(self, f) { continue l88; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/treemap-literal-string-values.wir.wado b/wado-compiler/tests/fixtures.golden/treemap-literal-string-values.wir.wado index c5e8501eb..33cb55d07 100644 --- a/wado-compiler/tests/fixtures.golden/treemap-literal-string-values.wir.wado +++ b/wado-compiler/tests/fixtures.golden/treemap-literal-string-values.wir.wado @@ -113,7 +113,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -121,7 +121,7 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/TreeMap^IndexValue::index_value" = fn(ref "core:allocator/TreeMap", ref String) -> ref String; @@ -135,7 +135,7 @@ type "functype/TreeMap::split" = fn(ref "core:allocator/TreeMap::skew" = fn(ref "core:allocator/TreeMap", ref null "core:allocator/TreeMapNode") -> ref null "core:allocator/TreeMapNode"; -type "functype/Array>::append" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); +type "functype/Array>::push" = fn(ref Array>, ref "core:allocator/TreeMapEntry"); type "functype/Array>::grow" = fn(ref Array>); @@ -221,27 +221,27 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-string-values.wado"), used: 63 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-string-values.wado"), used: 63 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_35 = __local_11; i32::fmt_decimal(12, __local_35); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: colors.len() == 3 "), used: 30 }); - String::append(__local_10, String { repr: array.new_data("colors.len(): "), used: 14 }); + String::push_str(__local_10, String { repr: array.new_data("colors.len(): "), used: 14 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_40 = __local_11; i32::fmt_decimal(__v0_2, __local_40); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -251,26 +251,26 @@ condition: colors.len() == 3 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(144), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-string-values.wado"), used: 63 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-string-values.wado"), used: 63 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_46 = __local_13; i32::fmt_decimal(14, __local_46); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: colors[\"red\"] == \"#FF0000\" "), used: 39 }); - String::append(__local_12, String { repr: array.new_data("colors[\"red\"]: "), used: 15 }); + String::push_str(__local_12, String { repr: array.new_data("colors[\"red\"]: "), used: 15 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_4, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -280,26 +280,26 @@ condition: colors[\"red\"] == \"#FF0000\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-string-values.wado"), used: 63 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-string-values.wado"), used: 63 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_53 = __local_15; i32::fmt_decimal(15, __local_53); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: colors[\"green\"] == \"#00FF00\" "), used: 41 }); - String::append(__local_14, String { repr: array.new_data("colors[\"green\"]: "), used: 17 }); + String::push_str(__local_14, String { repr: array.new_data("colors[\"green\"]: "), used: 17 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; String^Inspect::inspect(__v0_6, __local_15); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -309,26 +309,26 @@ condition: colors[\"green\"] == \"#00FF00\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(146), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_16, 114); - String::append_char(__local_16, 117); - String::append_char(__local_16, 110); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-string-values.wado"), used: 63 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_16, 114); + String::push(__local_16, 117); + String::push(__local_16, 110); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/treemap-literal-string-values.wado"), used: 63 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_60 = __local_17; i32::fmt_decimal(16, __local_60); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: colors[\"blue\"] == \"#0000FF\" "), used: 40 }); - String::append(__local_16, String { repr: array.new_data("colors[\"blue\"]: "), used: 16 }); + String::push_str(__local_16, String { repr: array.new_data("colors[\"blue\"]: "), used: 16 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_8, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -568,7 +568,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -699,7 +699,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -735,7 +735,7 @@ fn TreeMap^IndexValue::index_value(self, key) { if index < 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -821,7 +821,7 @@ fn TreeMap::insert(self, key, value) { break __inline_Array_TreeMapEntry_String_String____len_1: __local_8.used; }; entry = "core:allocator/TreeMapEntry" { key: key, value: value, deleted: 0 }; - Array>::append(self.entries, entry); + Array>::push(self.entries, entry); self.root = TreeMap::insert_node(self, self.root, key, new_index); self.size = self.size + 1; } @@ -895,7 +895,7 @@ fn TreeMap::skew(self, node) { return ref.null none; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -948,7 +948,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l69; }; @@ -982,20 +982,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1005,10 +1005,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1018,10 +1018,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1029,10 +1029,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1044,7 +1044,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1061,22 +1061,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b88; @@ -1084,7 +1084,7 @@ fn String^Inspect::inspect(self, f) { continue l89; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/treemap_btree.wir.wado b/wado-compiler/tests/fixtures.golden/treemap_btree.wir.wado index e443f0056..d65ca560e 100644 --- a/wado-compiler/tests/fixtures.golden/treemap_btree.wir.wado +++ b/wado-compiler/tests/fixtures.golden/treemap_btree.wir.wado @@ -150,7 +150,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -158,19 +158,19 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); type "functype/BTreeNode::compact" = fn(ref BTreeNode); -type "functype/Array::append" = fn(ref Array, bool); +type "functype/Array::push" = fn(ref Array, bool); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -182,7 +182,7 @@ type "functype/TreeMap::iter" = fn(ref TreeMap) -> ref A type "functype/TreeMap::collect_entries" = fn(ref TreeMap, ref BTreeNode, ref Array>); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, i32]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, i32]"); type "functype/Array>::grow" = fn(ref Array>); @@ -198,7 +198,7 @@ type "functype/TreeMap::sort_node_entries" = fn(ref TreeMap::split_child" = fn(ref TreeMap, ref BTreeNode, i32); -type "functype/Array>::append" = fn(ref Array>, ref BTreeNode); +type "functype/Array>::push" = fn(ref Array>, ref BTreeNode); type "functype/Array>::grow" = fn(ref Array>); @@ -304,12 +304,12 @@ fn run() with Stdout { "core:cli/println"(String { repr: array.new_data("=== After insertion ==="), used: 23 }); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_14, 83); - String::append_char(__local_14, 105); - String::append_char(__local_14, 122); - String::append_char(__local_14, 101); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 83); + String::push(__local_14, 105); + String::push(__local_14, 122); + String::push(__local_14, 101); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(map.size, __local_15); break __tmpl: __local_14; @@ -328,7 +328,7 @@ fn run() with Stdout { val = ref.cast Option::Some(__pattern_temp_0_32).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_16, String { repr: array.new_data("banana = "), used: 9 }); + String::push_str(__local_16, String { repr: array.new_data("banana = "), used: 9 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(val, __local_17); break __tmpl: __local_16; @@ -348,13 +348,13 @@ fn run() with Stdout { val2 = ref.cast Option::Some(__pattern_temp_1).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_18, 100); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 101); - String::append_char(__local_18, 32); - String::append_char(__local_18, 61); - String::append_char(__local_18, 32); + String::push(__local_18, 100); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 101); + String::push(__local_18, 32); + String::push(__local_18, 61); + String::push(__local_18, 32); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(val2, __local_19); break __tmpl: __local_18; @@ -375,7 +375,7 @@ fn run() with Stdout { val3 = ref.cast Option::Some(__pattern_temp_2).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_20, String { repr: array.new_data("banana (updated) = "), used: 19 }); + String::push_str(__local_20, String { repr: array.new_data("banana (updated) = "), used: 19 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(val3, __local_21); break __tmpl: __local_20; @@ -395,12 +395,12 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_22, 83); - String::append_char(__local_22, 105); - String::append_char(__local_22, 122); - String::append_char(__local_22, 101); - String::append_char(__local_22, 58); - String::append_char(__local_22, 32); + String::push(__local_22, 83); + String::push(__local_22, 105); + String::push(__local_22, 122); + String::push(__local_22, 101); + String::push(__local_22, 58); + String::push(__local_22, 32); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i32::fmt_decimal(map.size, __local_23); break __tmpl: __local_22; @@ -431,10 +431,10 @@ fn run() with Stdout { value_8 = entry_6.1; "core:cli/println"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_24, key_7); - String::append_char(__local_24, 32); - String::append_char(__local_24, 61); - String::append_char(__local_24, 32); + String::push_str(__local_24, key_7); + String::push(__local_24, 32); + String::push(__local_24, 61); + String::push(__local_24, 32); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i32::fmt_decimal(value_8, __local_25); break __tmpl: __local_24; @@ -458,19 +458,19 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_26, 83); - String::append_char(__local_26, 105); - String::append_char(__local_26, 122); - String::append_char(__local_26, 101); - String::append_char(__local_26, 58); - String::append_char(__local_26, 32); + String::push(__local_26, 83); + String::push(__local_26, 105); + String::push(__local_26, 122); + String::push(__local_26, 101); + String::push(__local_26, 58); + String::push(__local_26, 32); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; i32::fmt_decimal(map.size, __local_27); break __tmpl: __local_26; }); "core:cli/println"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Deleted count: "), used: 15 }); + String::push_str(__local_28, String { repr: array.new_data("Deleted count: "), used: 15 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; i32::fmt_decimal(map.deleted_count, __local_29); break __tmpl: __local_28; @@ -488,10 +488,10 @@ fn run() with Stdout { value_13 = entry_11.1; "core:cli/println"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_30, key_12); - String::append_char(__local_30, 32); - String::append_char(__local_30, 61); - String::append_char(__local_30, 32); + String::push_str(__local_30, key_12); + String::push(__local_30, 32); + String::push(__local_30, 61); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; i32::fmt_decimal(value_13, __local_31); break __tmpl: __local_30; @@ -736,7 +736,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -823,7 +823,7 @@ fn String^Ord::cmp(self, other) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -850,7 +850,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -953,11 +953,11 @@ fn BTreeNode::compact(self) { }; break __inline_Array_bool__IndexValue__index_value_10: builtin::array_get(_licm_repr_33, __local_20); } == 0 { - Array::append(new_keys, __inline_Array_String__IndexValue__index_value_11: block -> ref String { + Array::push(new_keys, __inline_Array_String__IndexValue__index_value_11: block -> ref String { __local_22 = i_7; break __inline_Array_String__IndexValue__index_value_11: builtin::array_get(_licm_repr_34, __local_22); }); - Array::append(new_values, __inline_Array_i32__IndexValue__index_value_12: block -> i32 { + Array::push(new_values, __inline_Array_i32__IndexValue__index_value_12: block -> i32 { __local_24 = i_7; if __local_24 >= _licm_used_35 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -965,7 +965,7 @@ fn BTreeNode::compact(self) { }; break __inline_Array_i32__IndexValue__index_value_12: builtin::array_get(_licm_repr_36, __local_24); }); - Array::append(new_deleted, 0); + Array::push(new_deleted, 0); }; i_7 = i_7 + 1; continue l57; @@ -998,7 +998,7 @@ fn BTreeNode::compact(self) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1040,7 +1040,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1180,7 +1180,7 @@ fn TreeMap::collect_entries(self, node, result) { }; break __inline_Array_bool__IndexValue__index_value_3: builtin::array_get(_licm_repr_26, __local_9); } == 0 { - Array>::append(result, "tuple/[String, i32]" { 0: ref.as_non_null(__inline_Array_String__IndexValue__index_value_4: block -> ref String { + Array>::push(result, "tuple/[String, i32]" { 0: ref.as_non_null(__inline_Array_String__IndexValue__index_value_4: block -> ref String { __local_11 = i; break __inline_Array_String__IndexValue__index_value_4: builtin::array_get(_licm_repr_27, __local_11); }), 1: __inline_Array_i32__IndexValue__index_value_5: block -> i32 { @@ -1216,7 +1216,7 @@ fn TreeMap::collect_entries(self, node, result) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1450,9 +1450,9 @@ fn TreeMap::insert(self, key, value) { __pattern_temp_0 = self.root; if ref.is_null(__pattern_temp_0) { new_root_3 = BTreeNode::new_leaf(); - Array::append(new_root_3.keys, key); - Array::append(new_root_3.values, value); - Array::append(new_root_3.deleted, 0); + Array::push(new_root_3.keys, key); + Array::push(new_root_3.values, value); + Array::push(new_root_3.deleted, 0); self.root = new_root_3; self.size = 1; return; @@ -1462,7 +1462,7 @@ fn TreeMap::insert(self, key, value) { root = ref.as_non_null(__pattern_temp_1); if BTreeNode::is_full(root, (2 * self.t) - 1) { new_root_5 = BTreeNode::new_internal(); - Array>::append(new_root_5.children, root); + Array>::push(new_root_5.children, root); TreeMap::split_child(self, new_root_5, 0); self.root = new_root_5; }; @@ -1568,9 +1568,9 @@ fn TreeMap::insert_non_full(self, node, key, value) { }; return; }; - Array::append(node.keys, key); - Array::append(node.values, value); - Array::append(node.deleted, 0); + Array::push(node.keys, key); + Array::push(node.values, value); + Array::push(node.deleted, 0); TreeMap::sort_node_entries(self, node); self.size = self.size + 1; } else { @@ -1852,11 +1852,11 @@ fn TreeMap::split_child(self, parent, child_index) { if (i_6 < _licm_used_35) == 0 { break __for_3; }; - Array::append(_licm_keys_30, __inline_Array_String__IndexValue__index_value_2: block -> ref String { + Array::push(_licm_keys_30, __inline_Array_String__IndexValue__index_value_2: block -> ref String { __local_15 = i_6; break __inline_Array_String__IndexValue__index_value_2: builtin::array_get(_licm_repr_36, __local_15); }); - Array::append(_licm_values_31, __inline_Array_i32__IndexValue__index_value_3: block -> i32 { + Array::push(_licm_values_31, __inline_Array_i32__IndexValue__index_value_3: block -> i32 { __local_17 = i_6; if __local_17 >= _licm_used_37 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -1864,7 +1864,7 @@ fn TreeMap::split_child(self, parent, child_index) { }; break __inline_Array_i32__IndexValue__index_value_3: builtin::array_get(_licm_repr_38, __local_17); }); - Array::append(_licm_deleted_33, __inline_Array_bool__IndexValue__index_value_4: block -> bool { + Array::push(_licm_deleted_33, __inline_Array_bool__IndexValue__index_value_4: block -> bool { __local_19 = i_6; if __local_19 >= _licm_used_39 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -1889,7 +1889,7 @@ fn TreeMap::split_child(self, parent, child_index) { if (i_7 < _licm_used_43) == 0 { break __for_4; }; - Array>::append(_licm_children_42, __inline_Array_BTreeNode_String_i32___IndexValue__index_value_6: block -> ref BTreeNode { + Array>::push(_licm_children_42, __inline_Array_BTreeNode_String_i32___IndexValue__index_value_6: block -> ref BTreeNode { __local_22 = i_7; break __inline_Array_BTreeNode_String_i32___IndexValue__index_value_6: builtin::array_get>(_licm_repr_44, __local_22); }); @@ -1923,14 +1923,14 @@ fn TreeMap::split_child(self, parent, child_index) { }; break __inline_Array_bool__IndexValue__index_value_9: builtin::array_get(__local_27.repr, mid); }; - Array::append(parent.keys, promoted_key); - Array::append(parent.values, promoted_value); - Array::append(parent.deleted, promoted_deleted); - Array>::append(parent.children, new_sibling); + Array::push(parent.keys, promoted_key); + Array::push(parent.values, promoted_value); + Array::push(parent.deleted, promoted_deleted); + Array>::push(parent.children, new_sibling); TreeMap::sort_node_entries(self, parent); } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2063,7 +2063,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l188; }; @@ -2097,20 +2097,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2120,10 +2120,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2133,10 +2133,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2144,10 +2144,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/treemap_btree2.wir.wado b/wado-compiler/tests/fixtures.golden/treemap_btree2.wir.wado index 7a1e0a204..21fb56da3 100644 --- a/wado-compiler/tests/fixtures.golden/treemap_btree2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/treemap_btree2.wir.wado @@ -160,7 +160,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; @@ -168,19 +168,19 @@ type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> b type "functype/String^Ord::cmp" = fn(ref String, ref String) -> enum:Ordering; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); type "functype/BTreeNode::compact" = fn(ref BTreeNode); -type "functype/Array::append" = fn(ref Array, bool); +type "functype/Array::push" = fn(ref Array, bool); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -192,7 +192,7 @@ type "functype/TreeMap::iter" = fn(ref TreeMap) -> ref A type "functype/TreeMap::collect_entries" = fn(ref TreeMap, ref BTreeNode, ref Array>); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, i32]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, i32]"); type "functype/Array>::grow" = fn(ref Array>); @@ -210,7 +210,7 @@ type "functype/TreeMap::sort_node_entries" = fn(ref TreeMap::split_child" = fn(ref TreeMap, ref BTreeNode, i32); -type "functype/Array>::append" = fn(ref Array>, ref BTreeNode); +type "functype/Array>::push" = fn(ref Array>, ref BTreeNode); type "functype/Array>::grow" = fn(ref Array>); @@ -308,32 +308,32 @@ fn run() with Stdout { "core:cli/println"(String { repr: array.new_data("=== After insertion ==="), used: 23 }); "core:cli/println"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_11, 83); - String::append_char(__local_11, 105); - String::append_char(__local_11, 122); - String::append_char(__local_11, 101); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 83); + String::push(__local_11, 105); + String::push(__local_11, 122); + String::push(__local_11, 101); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; i32::fmt_decimal(map.size, __local_12); break __tmpl: __local_11; }); "core:cli/println"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_13, String { repr: array.new_data("banana = "), used: 9 }); + String::push_str(__local_13, String { repr: array.new_data("banana = "), used: 9 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(TreeMap^Index::index(map, String { repr: array.new_data("banana"), used: 6 }).value, __local_14); break __tmpl: __local_13; }); "core:cli/println"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_15, 100); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 101); - String::append_char(__local_15, 32); - String::append_char(__local_15, 61); - String::append_char(__local_15, 32); + String::push(__local_15, 100); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 101); + String::push(__local_15, 32); + String::push(__local_15, 61); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; i32::fmt_decimal(TreeMap^Index::index(map, String { repr: array.new_data("date"), used: 4 }).value, __local_16); break __tmpl: __local_15; @@ -342,7 +342,7 @@ fn run() with Stdout { TreeMap::insert(map, key_68, 20); "core:cli/println"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_17, String { repr: array.new_data("banana (updated) = "), used: 19 }); + String::push_str(__local_17, String { repr: array.new_data("banana (updated) = "), used: 19 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; i32::fmt_decimal(TreeMap^Index::index(map, String { repr: array.new_data("banana"), used: 6 }).value, __local_18); break __tmpl: __local_17; @@ -361,12 +361,12 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_19, 83); - String::append_char(__local_19, 105); - String::append_char(__local_19, 122); - String::append_char(__local_19, 101); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 83); + String::push(__local_19, 105); + String::push(__local_19, 122); + String::push(__local_19, 101); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; i32::fmt_decimal(map.size, __local_20); break __tmpl: __local_19; @@ -384,10 +384,10 @@ fn run() with Stdout { value_5 = entry_3.1; "core:cli/println"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_21, key_4); - String::append_char(__local_21, 32); - String::append_char(__local_21, 61); - String::append_char(__local_21, 32); + String::push_str(__local_21, key_4); + String::push(__local_21, 32); + String::push(__local_21, 61); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; i32::fmt_decimal(value_5, __local_22); break __tmpl: __local_21; @@ -411,19 +411,19 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_23, 83); - String::append_char(__local_23, 105); - String::append_char(__local_23, 122); - String::append_char(__local_23, 101); - String::append_char(__local_23, 58); - String::append_char(__local_23, 32); + String::push(__local_23, 83); + String::push(__local_23, 105); + String::push(__local_23, 122); + String::push(__local_23, 101); + String::push(__local_23, 58); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; i32::fmt_decimal(map.size, __local_24); break __tmpl: __local_23; }); "core:cli/println"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Deleted count: "), used: 15 }); + String::push_str(__local_25, String { repr: array.new_data("Deleted count: "), used: 15 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; i32::fmt_decimal(map.deleted_count, __local_26); break __tmpl: __local_25; @@ -441,10 +441,10 @@ fn run() with Stdout { value_10 = entry_8.1; "core:cli/println"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_27, key_9); - String::append_char(__local_27, 32); - String::append_char(__local_27, 61); - String::append_char(__local_27, 32); + String::push_str(__local_27, key_9); + String::push(__local_27, 32); + String::push(__local_27, 61); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; i32::fmt_decimal(value_10, __local_28); break __tmpl: __local_27; @@ -689,7 +689,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -820,7 +820,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -847,7 +847,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -950,11 +950,11 @@ fn BTreeNode::compact(self) { }; break __inline_Array_bool__IndexValue__index_value_10: builtin::array_get(_licm_repr_33, __local_20); } == 0 { - Array::append(new_keys, __inline_Array_String__IndexValue__index_value_11: block -> ref String { + Array::push(new_keys, __inline_Array_String__IndexValue__index_value_11: block -> ref String { __local_22 = i_7; break __inline_Array_String__IndexValue__index_value_11: builtin::array_get(_licm_repr_34, __local_22); }); - Array::append(new_values, __inline_Array_i32__IndexValue__index_value_12: block -> i32 { + Array::push(new_values, __inline_Array_i32__IndexValue__index_value_12: block -> i32 { __local_24 = i_7; if __local_24 >= _licm_used_35 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -962,7 +962,7 @@ fn BTreeNode::compact(self) { }; break __inline_Array_i32__IndexValue__index_value_12: builtin::array_get(_licm_repr_36, __local_24); }); - Array::append(new_deleted, 0); + Array::push(new_deleted, 0); }; i_7 = i_7 + 1; continue l53; @@ -995,7 +995,7 @@ fn BTreeNode::compact(self) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1037,7 +1037,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1177,7 +1177,7 @@ fn TreeMap::collect_entries(self, node, result) { }; break __inline_Array_bool__IndexValue__index_value_3: builtin::array_get(_licm_repr_26, __local_9); } == 0 { - Array>::append(result, "tuple/[String, i32]" { 0: ref.as_non_null(__inline_Array_String__IndexValue__index_value_4: block -> ref String { + Array>::push(result, "tuple/[String, i32]" { 0: ref.as_non_null(__inline_Array_String__IndexValue__index_value_4: block -> ref String { __local_11 = i; break __inline_Array_String__IndexValue__index_value_4: builtin::array_get(_licm_repr_27, __local_11); }), 1: __inline_Array_i32__IndexValue__index_value_5: block -> i32 { @@ -1213,7 +1213,7 @@ fn TreeMap::collect_entries(self, node, result) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1367,7 +1367,7 @@ fn TreeMap^Index::index(self, key) { }; "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); + String::push_str(__local_3, String { repr: array.new_data("key not found: "), used: 15 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; String^Inspect::inspect(key, __local_4); break __tmpl: __local_3; @@ -1476,9 +1476,9 @@ fn TreeMap::insert(self, key, value) { __pattern_temp_0 = self.root; if ref.is_null(__pattern_temp_0) { new_root_3 = BTreeNode::new_leaf(); - Array::append(new_root_3.keys, key); - Array::append(new_root_3.values, value); - Array::append(new_root_3.deleted, 0); + Array::push(new_root_3.keys, key); + Array::push(new_root_3.values, value); + Array::push(new_root_3.deleted, 0); self.root = new_root_3; self.size = 1; return; @@ -1488,7 +1488,7 @@ fn TreeMap::insert(self, key, value) { root = ref.as_non_null(__pattern_temp_1); if BTreeNode::is_full(root, (2 * self.t) - 1) { new_root_5 = BTreeNode::new_internal(); - Array>::append(new_root_5.children, root); + Array>::push(new_root_5.children, root); TreeMap::split_child(self, new_root_5, 0); self.root = new_root_5; }; @@ -1594,9 +1594,9 @@ fn TreeMap::insert_non_full(self, node, key, value) { }; return; }; - Array::append(node.keys, key); - Array::append(node.values, value); - Array::append(node.deleted, 0); + Array::push(node.keys, key); + Array::push(node.values, value); + Array::push(node.deleted, 0); TreeMap::sort_node_entries(self, node); self.size = self.size + 1; } else { @@ -1878,11 +1878,11 @@ fn TreeMap::split_child(self, parent, child_index) { if (i_6 < _licm_used_35) == 0 { break __for_3; }; - Array::append(_licm_keys_30, __inline_Array_String__IndexValue__index_value_2: block -> ref String { + Array::push(_licm_keys_30, __inline_Array_String__IndexValue__index_value_2: block -> ref String { __local_15 = i_6; break __inline_Array_String__IndexValue__index_value_2: builtin::array_get(_licm_repr_36, __local_15); }); - Array::append(_licm_values_31, __inline_Array_i32__IndexValue__index_value_3: block -> i32 { + Array::push(_licm_values_31, __inline_Array_i32__IndexValue__index_value_3: block -> i32 { __local_17 = i_6; if __local_17 >= _licm_used_37 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -1890,7 +1890,7 @@ fn TreeMap::split_child(self, parent, child_index) { }; break __inline_Array_i32__IndexValue__index_value_3: builtin::array_get(_licm_repr_38, __local_17); }); - Array::append(_licm_deleted_33, __inline_Array_bool__IndexValue__index_value_4: block -> bool { + Array::push(_licm_deleted_33, __inline_Array_bool__IndexValue__index_value_4: block -> bool { __local_19 = i_6; if __local_19 >= _licm_used_39 { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -1915,7 +1915,7 @@ fn TreeMap::split_child(self, parent, child_index) { if (i_7 < _licm_used_43) == 0 { break __for_4; }; - Array>::append(_licm_children_42, __inline_Array_BTreeNode_String_i32___IndexValue__index_value_6: block -> ref BTreeNode { + Array>::push(_licm_children_42, __inline_Array_BTreeNode_String_i32___IndexValue__index_value_6: block -> ref BTreeNode { __local_22 = i_7; break __inline_Array_BTreeNode_String_i32___IndexValue__index_value_6: builtin::array_get>(_licm_repr_44, __local_22); }); @@ -1949,14 +1949,14 @@ fn TreeMap::split_child(self, parent, child_index) { }; break __inline_Array_bool__IndexValue__index_value_9: builtin::array_get(__local_27.repr, mid); }; - Array::append(parent.keys, promoted_key); - Array::append(parent.values, promoted_value); - Array::append(parent.deleted, promoted_deleted); - Array>::append(parent.children, new_sibling); + Array::push(parent.keys, promoted_key); + Array::push(parent.values, promoted_value); + Array::push(parent.deleted, promoted_deleted); + Array>::push(parent.children, new_sibling); TreeMap::sort_node_entries(self, parent); } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2089,7 +2089,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l186; }; @@ -2123,20 +2123,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2146,10 +2146,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2159,10 +2159,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2170,10 +2170,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -2185,7 +2185,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -2202,22 +2202,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b205; @@ -2225,7 +2225,7 @@ fn String^Inspect::inspect(self, f) { continue l206; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/try_merged.wir.wado b/wado-compiler/tests/fixtures.golden/try_merged.wir.wado index adfd9c097..c752283d9 100644 --- a/wado-compiler/tests/fixtures.golden/try_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/try_merged.wir.wado @@ -234,15 +234,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -323,27 +323,27 @@ fn test_try_from_narrowing() with Stdout { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_24, String { repr: array.new_data("test_try_from_narrowing"), used: 23 }); - String::append_char(__local_24, 32); - String::append_char(__local_24, 97); - String::append_char(__local_24, 116); - String::append_char(__local_24, 32); - String::append(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_24, 58); + String::push_str(__local_24, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_24, String { repr: array.new_data("test_try_from_narrowing"), used: 23 }); + String::push(__local_24, 32); + String::push(__local_24, 97); + String::push(__local_24, 116); + String::push(__local_24, 32); + String::push_str(__local_24, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_24, 58); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_41 = __local_25; i32::fmt_decimal(7, __local_41); - String::append(__local_24, String { repr: array.new_data(" + String::push_str(__local_24, String { repr: array.new_data(" condition: n == 42 "), used: 20 }); - String::append_char(__local_24, 110); - String::append_char(__local_24, 58); - String::append_char(__local_24, 32); + String::push(__local_24, 110); + String::push(__local_24, 58); + String::push(__local_24, 32); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; __local_46 = __local_25; i32::fmt_decimal(n_2, __local_46); - String::append_char(__local_24, 10); + String::push(__local_24, 10); break __tmpl: __local_24; }); unreachable; @@ -363,24 +363,24 @@ condition: n == 42 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(164), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_26, String { repr: array.new_data("test_try_from_narrowing"), used: 23 }); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_26, String { repr: array.new_data("test_try_from_narrowing"), used: 23 }); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_52 = __local_27; i32::fmt_decimal(14, __local_52); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: msg.message == \"3000000000 out of range for i32\" "), used: 61 }); - String::append(__local_26, String { repr: array.new_data("msg.message: "), used: 13 }); + String::push_str(__local_26, String { repr: array.new_data("msg.message: "), used: 13 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; String^Inspect::inspect(__v0, __local_27); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -408,27 +408,27 @@ condition: msg.message == \"3000000000 out of range for i32\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("test_try_from_narrowing"), used: 23 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("test_try_from_narrowing"), used: 23 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_59 = __local_29; i32::fmt_decimal(27, __local_59); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: n == 100 as u32 "), used: 28 }); - String::append_char(__local_28, 110); - String::append_char(__local_28, 58); - String::append_char(__local_28, 32); + String::push(__local_28, 110); + String::push(__local_28, 58); + String::push(__local_28, 32); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_64 = __local_29; u32::fmt_decimal(n_14, __local_64); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -447,27 +447,27 @@ condition: n == 100 as u32 if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_30, String { repr: array.new_data("test_try_from_narrowing"), used: 23 }); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_30, String { repr: array.new_data("test_try_from_narrowing"), used: 23 }); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_70 = __local_31; i32::fmt_decimal(34, __local_70); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: n == 200 as u8 "), used: 27 }); - String::append_char(__local_30, 110); - String::append_char(__local_30, 58); - String::append_char(__local_30, 32); + String::push(__local_30, 110); + String::push(__local_30, 58); + String::push(__local_30, 32); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_75 = __local_31; i32::fmt_decimal(n_19, __local_75); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -590,17 +590,17 @@ fn test_try_op_chained() with Stdout { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_try_op_chained"), used: 19 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_try_op_chained"), used: 19 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(76, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: pipeline(5) matches { Ok(n) && n == 11 } "), used: 53 }); break __tmpl: __local_6; @@ -620,17 +620,17 @@ condition: pipeline(5) matches { Ok(n) && n == 11 } if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(143), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("test_try_op_chained"), used: 19 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("test_try_op_chained"), used: 19 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(77, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: pipeline(-1) matches { Err(e) && e == \"step1: negative\" } "), used: 70 }); break __tmpl: __local_8; @@ -650,17 +650,17 @@ condition: pipeline(-1) matches { Err(e) && e == \"step1: negative\" } if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(145), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("test_try_op_chained"), used: 19 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("test_try_op_chained"), used: 19 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(78, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: pipeline(100) matches { Err(e) && e == \"step2: too large\" } "), used: 72 }); break __tmpl: __local_10; @@ -748,17 +748,17 @@ fn test_try_op_option_basic() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(163), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("test_try_op_option_basic"), used: 24 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("test_try_op_option_basic"), used: 24 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(99, __local_6); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: first_positive_doubled([1, 2, 3] as Array) matches { Some(n) && n == 2 } "), used: 90 }); break __tmpl: __local_5; @@ -794,17 +794,17 @@ condition: first_positive_doubled([1, 2, 3] as Array) matches { Some(n) && if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(149), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("test_try_op_option_basic"), used: 24 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("test_try_op_option_basic"), used: 24 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(100, __local_8); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: first_positive_doubled([-1, -2] as Array) matches { None } "), used: 76 }); break __tmpl: __local_7; @@ -860,17 +860,17 @@ fn test_try_op_result_basic() with Stdout { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_try_op_result_basic"), used: 24 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_try_op_result_basic"), used: 24 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(117, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: compute_div(10, 2) matches { Ok(n) && n == 10 } "), used: 60 }); break __tmpl: __local_4; @@ -911,17 +911,17 @@ condition: compute_div(10, 2) matches { Ok(n) && n == 10 } if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(154), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_try_op_result_basic"), used: 24 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_try_op_result_basic"), used: 24 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(118, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: compute_div(10, 0) matches { Err(msg) && msg == \"division by zero\" } "), used: 81 }); break __tmpl: __local_6; @@ -982,17 +982,17 @@ fn test_try_op_result_from() with Stdout { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("test_try_op_result_from"), used: 23 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("test_try_op_result_from"), used: 23 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(146, __local_8); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: high_op(false) matches { Ok(n) && n == 101 } "), used: 57 }); break __tmpl: __local_7; @@ -1030,25 +1030,25 @@ condition: high_op(false) matches { Ok(n) && n == 101 } if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("test_try_op_result_from"), used: 23 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("test_try_op_result_from"), used: 23 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_32 = __local_10; i32::fmt_decimal(150, __local_32); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: inner.code == 42 "), used: 29 }); - String::append(__local_9, String { repr: array.new_data("inner.code: "), used: 12 }); + String::push_str(__local_9, String { repr: array.new_data("inner.code: "), used: 12 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_37 = __local_10; i32::fmt_decimal(__v0, __local_37); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1181,27 +1181,27 @@ fn test_try_op_variant_from() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("test_try_op_variant_from"), used: 24 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("test_try_op_variant_from"), used: 24 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_28 = __local_15; i32::fmt_decimal(216, __local_28); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: n == 42 "), used: 20 }); - String::append_char(__local_14, 110); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 110); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_33 = __local_15; i32::fmt_decimal(n, __local_33); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -1223,24 +1223,24 @@ condition: n == 42 if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("test_try_op_variant_from"), used: 24 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("test_try_op_variant_from"), used: 24 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_39 = __local_17; i32::fmt_decimal(223, __local_39); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: inner.message == \"disk error\" "), used: 42 }); - String::append(__local_16, String { repr: array.new_data("inner.message: "), used: 15 }); + String::push_str(__local_16, String { repr: array.new_data("inner.message: "), used: 15 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_7, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -1266,24 +1266,24 @@ condition: inner.message == \"disk error\" if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("test_try_op_variant_from"), used: 24 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("test_try_op_variant_from"), used: 24 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/try_merged.wado"), used: 44 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_46 = __local_19; i32::fmt_decimal(233, __local_46); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: inner.input == \"bad\" "), used: 33 }); - String::append(__local_18, String { repr: array.new_data("inner.input: "), used: 13 }); + String::push_str(__local_18, String { repr: array.new_data("inner.input: "), used: 13 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; String^Inspect::inspect(__v0_12, __local_19); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -1594,7 +1594,7 @@ fn i32^TryFrom::try_from(value) { __local_1 = String { repr: builtin::array_new(37), used: 0 }; __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i64::fmt_decimal(value, __local_2); - String::append(__local_1, String { repr: array.new_data(" out of range for i32"), used: 21 }); + String::push_str(__local_1, String { repr: array.new_data(" out of range for i32"), used: 21 }); break __tmpl: __local_1; }; break __inline_ConvertError__new_4: ConvertError { message: __local_9 }; @@ -1613,7 +1613,7 @@ fn u32^TryFrom::try_from(value) { __local_1 = String { repr: builtin::array_new(37), used: 0 }; __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(value, __local_2); - String::append(__local_1, String { repr: array.new_data(" out of range for u32"), used: 21 }); + String::push_str(__local_1, String { repr: array.new_data(" out of range for u32"), used: 21 }); break __tmpl: __local_1; }; break __inline_ConvertError__new_4: ConvertError { message: __local_9 }; @@ -1632,7 +1632,7 @@ fn u8^TryFrom::try_from(value) { __local_1 = String { repr: builtin::array_new(36), used: 0 }; __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; u32::fmt_decimal(value, __local_2); - String::append(__local_1, String { repr: array.new_data(" out of range for u8"), used: 20 }); + String::push_str(__local_1, String { repr: array.new_data(" out of range for u8"), used: 20 }); break __tmpl: __local_1; }; break __inline_ConvertError__new_4: ConvertError { message: __local_9 }; @@ -1675,7 +1675,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1763,7 +1763,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1790,7 +1790,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1843,7 +1843,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l119; }; @@ -1877,20 +1877,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1900,10 +1900,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1913,10 +1913,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1924,10 +1924,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1939,7 +1939,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1956,22 +1956,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b138; @@ -1979,7 +1979,7 @@ fn String^Inspect::inspect(self, f) { continue l139; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/tuple_1.wir.wado b/wado-compiler/tests/fixtures.golden/tuple_1.wir.wado index e17ca8f4c..dfe08c218 100644 --- a/wado-compiler/tests/fixtures.golden/tuple_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tuple_1.wir.wado @@ -127,13 +127,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -173,12 +173,12 @@ fn make_labeled(x) { let __local_2: ref Formatter; return ref.as_non_null(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(22), used: 0 }; - String::append_char(__local_1, 118); - String::append_char(__local_1, 97); - String::append_char(__local_1, 108); - String::append_char(__local_1, 117); - String::append_char(__local_1, 101); - String::append_char(__local_1, 61); + String::push(__local_1, 118); + String::push(__local_1, 97); + String::push(__local_1, 108); + String::push(__local_1, 117); + String::push(__local_1, 101); + String::push(__local_1, 61); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(x, __local_2); break __tmpl: __local_1; @@ -207,28 +207,28 @@ fn __test_3_heterogeneous() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_3_heterogeneous"), used: 22 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_3_heterogeneous"), used: 22 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_28 = __local_10; i32::fmt_decimal(39, __local_28); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: t.1 == \"hello\" "), used: 27 }); - String::append_char(__local_9, 116); - String::append_char(__local_9, 46); - String::append_char(__local_9, 49); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 116); + String::push(__local_9, 46); + String::push(__local_9, 49); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -257,28 +257,28 @@ fn __test_7_type_annotation() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_7_type_annotation"), used: 24 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_7_type_annotation"), used: 24 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_28 = __local_10; i32::fmt_decimal(65, __local_28); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: t.1 == \"hello\" "), used: 27 }); - String::append_char(__local_9, 116); - String::append_char(__local_9, 46); - String::append_char(__local_9, 49); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 116); + String::push(__local_9, 46); + String::push(__local_9, 49); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -309,25 +309,25 @@ fn __test_10_param() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(147), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_10_param"), used: 15 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_10_param"), used: 15 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_9 = __local_3; i32::fmt_decimal(86, __local_9); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: sum_pair([10, 20]) == 30 "), used: 37 }); - String::append(__local_2, String { repr: array.new_data("sum_pair([10, 20]): "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("sum_pair([10, 20]): "), used: 20 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_14 = __local_3; i32::fmt_decimal(__v0, __local_14); - String::append_char(__local_2, 10); + String::push(__local_2, 10); break __tmpl: __local_2; }); unreachable; @@ -386,26 +386,26 @@ fn __test_12_struct_field_in_tuple() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_35 = __local_18; i32::fmt_decimal(97, __local_35); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: s == \"value=42\" "), used: 28 }); - String::append_char(__local_17, 115); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 115); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; String^Inspect::inspect(__v0_2, __local_18); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -414,27 +414,27 @@ condition: s == \"value=42\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_42 = __local_20; i32::fmt_decimal(98, __local_42); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: n == 42 "), used: 20 }); - String::append_char(__local_19, 110); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 110); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_47 = __local_20; i32::fmt_decimal(n, __local_47); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -451,26 +451,26 @@ condition: n == 42 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_55 = __local_22; i32::fmt_decimal(100, __local_55); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: a == \"world\" "), used: 25 }); - String::append_char(__local_21, 97); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; String^Inspect::inspect(__v0_8, __local_22); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -480,26 +480,26 @@ condition: a == \"world\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_62 = __local_24; i32::fmt_decimal(101, __local_62); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: b == \"hello\" "), used: 25 }); - String::append_char(__local_23, 98); - String::append_char(__local_23, 58); - String::append_char(__local_23, 32); + String::push(__local_23, 98); + String::push(__local_23, 58); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; String^Inspect::inspect(__v0_10, __local_24); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -512,24 +512,24 @@ condition: b == \"hello\" if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_69 = __local_26; i32::fmt_decimal(103, __local_69); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: result.0 == \"value=99\" "), used: 35 }); - String::append(__local_25, String { repr: array.new_data("result.0: "), used: 10 }); + String::push_str(__local_25, String { repr: array.new_data("result.0: "), used: 10 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; String^Inspect::inspect(__v0_13, __local_26); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -539,25 +539,25 @@ condition: result.0 == \"value=99\" if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("__test_12_struct_field_in_tuple"), used: 31 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_76 = __local_28; i32::fmt_decimal(104, __local_76); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: result.1 == 99 "), used: 27 }); - String::append(__local_27, String { repr: array.new_data("result.1: "), used: 10 }); + String::push_str(__local_27, String { repr: array.new_data("result.1: "), used: 10 }); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_81 = __local_28; i32::fmt_decimal(__v0_15, __local_81); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -632,29 +632,29 @@ fn __test_13_elision_multivalue() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_32, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_32, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_56 = __local_33; i32::fmt_decimal(109, __local_56); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: lo1 == 150 as i64 "), used: 30 }); - String::append_char(__local_32, 108); - String::append_char(__local_32, 111); - String::append_char(__local_32, 49); - String::append_char(__local_32, 58); - String::append_char(__local_32, 32); + String::push(__local_32, 108); + String::push(__local_32, 111); + String::push(__local_32, 49); + String::push(__local_32, 58); + String::push(__local_32, 32); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_61 = __local_33; i64::fmt_decimal(__local_0, __local_61); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -663,29 +663,29 @@ condition: lo1 == 150 as i64 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_34, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_34, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_67 = __local_35; i32::fmt_decimal(110, __local_67); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: hi1 == 225 as i64 "), used: 30 }); - String::append_char(__local_34, 104); - String::append_char(__local_34, 105); - String::append_char(__local_34, 49); - String::append_char(__local_34, 58); - String::append_char(__local_34, 32); + String::push(__local_34, 104); + String::push(__local_34, 105); + String::push(__local_34, 49); + String::push(__local_34, 58); + String::push(__local_34, 32); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_72 = __local_35; i64::fmt_decimal(__local_1, __local_72); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -695,29 +695,29 @@ condition: hi1 == 225 as i64 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_36, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_36, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_78 = __local_37; i32::fmt_decimal(113, __local_78); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: lo2 == 100 as i64 "), used: 30 }); - String::append_char(__local_36, 108); - String::append_char(__local_36, 111); - String::append_char(__local_36, 50); - String::append_char(__local_36, 58); - String::append_char(__local_36, 32); + String::push(__local_36, 108); + String::push(__local_36, 111); + String::push(__local_36, 50); + String::push(__local_36, 58); + String::push(__local_36, 32); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_83 = __local_37; i64::fmt_decimal(__local_6, __local_83); - String::append_char(__local_36, 10); + String::push(__local_36, 10); break __tmpl: __local_36; }); unreachable; @@ -726,29 +726,29 @@ condition: lo2 == 100 as i64 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_38, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_38, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_89 = __local_39; i32::fmt_decimal(114, __local_89); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: hi2 == 200 as i64 "), used: 30 }); - String::append_char(__local_38, 104); - String::append_char(__local_38, 105); - String::append_char(__local_38, 50); - String::append_char(__local_38, 58); - String::append_char(__local_38, 32); + String::push(__local_38, 104); + String::push(__local_38, 105); + String::push(__local_38, 50); + String::push(__local_38, 58); + String::push(__local_38, 32); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_94 = __local_39; i64::fmt_decimal(__local_7, __local_94); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; @@ -758,29 +758,29 @@ condition: hi2 == 200 as i64 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(125), used: 0 }; - String::append(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_40, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); - String::append_char(__local_40, 32); - String::append_char(__local_40, 97); - String::append_char(__local_40, 116); - String::append_char(__local_40, 32); - String::append(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_40, 58); + String::push_str(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_40, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); + String::push(__local_40, 32); + String::push(__local_40, 97); + String::push(__local_40, 116); + String::push(__local_40, 32); + String::push_str(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_40, 58); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_100 = __local_41; i32::fmt_decimal(117, __local_100); - String::append(__local_40, String { repr: array.new_data(" + String::push_str(__local_40, String { repr: array.new_data(" condition: lo3 == 200 as i64 "), used: 30 }); - String::append_char(__local_40, 108); - String::append_char(__local_40, 111); - String::append_char(__local_40, 51); - String::append_char(__local_40, 58); - String::append_char(__local_40, 32); + String::push(__local_40, 108); + String::push(__local_40, 111); + String::push(__local_40, 51); + String::push(__local_40, 58); + String::push(__local_40, 32); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_105 = __local_41; i64::fmt_decimal(__local_12, __local_105); - String::append_char(__local_40, 10); + String::push(__local_40, 10); break __tmpl: __local_40; }); unreachable; @@ -789,29 +789,29 @@ condition: lo3 == 200 as i64 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_42, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); - String::append_char(__local_42, 32); - String::append_char(__local_42, 97); - String::append_char(__local_42, 116); - String::append_char(__local_42, 32); - String::append(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_42, 58); + String::push_str(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_42, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); + String::push(__local_42, 32); + String::push(__local_42, 97); + String::push(__local_42, 116); + String::push(__local_42, 32); + String::push_str(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_42, 58); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_111 = __local_43; i32::fmt_decimal(118, __local_111); - String::append(__local_42, String { repr: array.new_data(" + String::push_str(__local_42, String { repr: array.new_data(" condition: hi3 == 0 as i64 "), used: 28 }); - String::append_char(__local_42, 104); - String::append_char(__local_42, 105); - String::append_char(__local_42, 51); - String::append_char(__local_42, 58); - String::append_char(__local_42, 32); + String::push(__local_42, 104); + String::push(__local_42, 105); + String::push(__local_42, 51); + String::push(__local_42, 58); + String::push(__local_42, 32); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_116 = __local_43; i64::fmt_decimal(__local_13, __local_116); - String::append_char(__local_42, 10); + String::push(__local_42, 10); break __tmpl: __local_42; }); unreachable; @@ -821,34 +821,34 @@ condition: hi3 == 0 as i64 if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(162), used: 0 }; - String::append(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_44, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); - String::append_char(__local_44, 32); - String::append_char(__local_44, 97); - String::append_char(__local_44, 116); - String::append_char(__local_44, 32); - String::append(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_44, 58); + String::push_str(__local_44, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_44, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); + String::push(__local_44, 32); + String::push(__local_44, 97); + String::push(__local_44, 116); + String::push(__local_44, 32); + String::push_str(__local_44, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_44, 58); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_122 = __local_45; i32::fmt_decimal(121, __local_122); - String::append(__local_44, String { repr: array.new_data(" + String::push_str(__local_44, String { repr: array.new_data(" condition: lo4 == 0 as i64 - 200 "), used: 34 }); - String::append_char(__local_44, 108); - String::append_char(__local_44, 111); - String::append_char(__local_44, 52); - String::append_char(__local_44, 58); - String::append_char(__local_44, 32); + String::push(__local_44, 108); + String::push(__local_44, 111); + String::push(__local_44, 52); + String::push(__local_44, 58); + String::push(__local_44, 32); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_127 = __local_45; i64::fmt_decimal(__local_18, __local_127); - String::append_char(__local_44, 10); - String::append(__local_44, String { repr: array.new_data("0 as i64 - 200: "), used: 16 }); + String::push(__local_44, 10); + String::push_str(__local_44, String { repr: array.new_data("0 as i64 - 200: "), used: 16 }); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; __local_132 = __local_45; i64::fmt_decimal(-200_i64, __local_132); - String::append_char(__local_44, 10); + String::push(__local_44, 10); break __tmpl: __local_44; }); unreachable; @@ -857,34 +857,34 @@ condition: lo4 == 0 as i64 - 200 if __cond_25 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_46 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_46, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); - String::append_char(__local_46, 32); - String::append_char(__local_46, 97); - String::append_char(__local_46, 116); - String::append_char(__local_46, 32); - String::append(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_46, 58); + String::push_str(__local_46, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_46, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); + String::push(__local_46, 32); + String::push(__local_46, 97); + String::push(__local_46, 116); + String::push(__local_46, 32); + String::push_str(__local_46, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_46, 58); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_138 = __local_47; i32::fmt_decimal(122, __local_138); - String::append(__local_46, String { repr: array.new_data(" + String::push_str(__local_46, String { repr: array.new_data(" condition: hi4 == 0 as i64 - 1 "), used: 32 }); - String::append_char(__local_46, 104); - String::append_char(__local_46, 105); - String::append_char(__local_46, 52); - String::append_char(__local_46, 58); - String::append_char(__local_46, 32); + String::push(__local_46, 104); + String::push(__local_46, 105); + String::push(__local_46, 52); + String::push(__local_46, 58); + String::push(__local_46, 32); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_143 = __local_47; i64::fmt_decimal(__local_19, __local_143); - String::append_char(__local_46, 10); - String::append(__local_46, String { repr: array.new_data("0 as i64 - 1: "), used: 14 }); + String::push(__local_46, 10); + String::push_str(__local_46, String { repr: array.new_data("0 as i64 - 1: "), used: 14 }); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; __local_148 = __local_47; i64::fmt_decimal(-1_i64, __local_148); - String::append_char(__local_46, 10); + String::push(__local_46, 10); break __tmpl: __local_46; }); unreachable; @@ -894,29 +894,29 @@ condition: hi4 == 0 as i64 - 1 if __cond_28 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_48 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_48, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); - String::append_char(__local_48, 32); - String::append_char(__local_48, 97); - String::append_char(__local_48, 116); - String::append_char(__local_48, 32); - String::append(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_48, 58); + String::push_str(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_48, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); + String::push(__local_48, 32); + String::push(__local_48, 97); + String::push(__local_48, 116); + String::push(__local_48, 32); + String::push_str(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_48, 58); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_154 = __local_49; i32::fmt_decimal(125, __local_154); - String::append(__local_48, String { repr: array.new_data(" + String::push_str(__local_48, String { repr: array.new_data(" condition: lo5 == 10000 as i64 "), used: 32 }); - String::append_char(__local_48, 108); - String::append_char(__local_48, 111); - String::append_char(__local_48, 53); - String::append_char(__local_48, 58); - String::append_char(__local_48, 32); + String::push(__local_48, 108); + String::push(__local_48, 111); + String::push(__local_48, 53); + String::push(__local_48, 58); + String::push(__local_48, 32); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_159 = __local_49; i64::fmt_decimal(__local_26, __local_159); - String::append_char(__local_48, 10); + String::push(__local_48, 10); break __tmpl: __local_48; }); unreachable; @@ -926,29 +926,29 @@ condition: lo5 == 10000 as i64 if __cond_31 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_50 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_50, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); - String::append_char(__local_50, 32); - String::append_char(__local_50, 97); - String::append_char(__local_50, 116); - String::append_char(__local_50, 32); - String::append(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); - String::append_char(__local_50, 58); + String::push_str(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_50, String { repr: array.new_data("__test_13_elision_multivalue"), used: 28 }); + String::push(__local_50, 32); + String::push(__local_50, 97); + String::push(__local_50, 116); + String::push(__local_50, 32); + String::push_str(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_1.wado"), used: 41 }); + String::push(__local_50, 58); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_165 = __local_51; i32::fmt_decimal(128, __local_165); - String::append(__local_50, String { repr: array.new_data(" + String::push_str(__local_50, String { repr: array.new_data(" condition: hi6 == 1 as i64 "), used: 28 }); - String::append_char(__local_50, 104); - String::append_char(__local_50, 105); - String::append_char(__local_50, 54); - String::append_char(__local_50, 58); - String::append_char(__local_50, 32); + String::push(__local_50, 104); + String::push(__local_50, 105); + String::push(__local_50, 54); + String::push(__local_50, 58); + String::push(__local_50, 32); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_170 = __local_51; i64::fmt_decimal(__local_29, __local_170); - String::append_char(__local_50, 10); + String::push(__local_50, 10); break __tmpl: __local_50; }); unreachable; @@ -1246,7 +1246,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1334,7 +1334,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1372,7 +1372,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l53; }; @@ -1406,20 +1406,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1429,10 +1429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1442,10 +1442,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1453,10 +1453,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1468,7 +1468,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1485,22 +1485,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b72; @@ -1508,7 +1508,7 @@ fn String^Inspect::inspect(self, f) { continue l73; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_basic as "__test_0_basic" diff --git a/wado-compiler/tests/fixtures.golden/tuple_2.wir.wado b/wado-compiler/tests/fixtures.golden/tuple_2.wir.wado index ec225f4fe..4cc813666 100644 --- a/wado-compiler/tests/fixtures.golden/tuple_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tuple_2.wir.wado @@ -25,6 +25,11 @@ struct [i32, i32] { mut 1: i32, } +struct [i32, char] { + mut 0: i32, + mut 1: char, +} + struct [i32, String] { mut 0: i32, mut 1: ref String, @@ -40,11 +45,6 @@ struct [String, bool] { mut 1: bool, } -struct [i32, char] { - mut 0: i32, - mut 1: char, -} - struct [i32, bool] { mut 0: i32, mut 1: bool, @@ -151,17 +151,17 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayIter>^Iterator::next" = fn(ref "core:allocator/ArrayIter>") -> ref null "tuple/[i32, String]"; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[i32, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[i32, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -239,13 +239,13 @@ fn describe(a, b) { __local_3 = ref.cast TupleValue::Bool(__local_16).payload_0; __tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(40), used: 0 }; - String::append_char(__local_8, 98); - String::append_char(__local_8, 111); - String::append_char(__local_8, 111); - String::append_char(__local_8, 108); - String::append_char(__local_8, 115); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 98); + String::push(__local_8, 111); + String::push(__local_8, 111); + String::push(__local_8, 108); + String::push(__local_8, 115); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_44 = __local_2; __local_24 = __local_9; @@ -254,7 +254,7 @@ fn describe(a, b) { } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_8, 32); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_45 = __local_3; __local_29 = __local_9; @@ -278,16 +278,16 @@ fn describe(a, b) { __local_5 = ref.cast TupleValue::Number(__local_18).payload_0; __tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(39), used: 0 }; - String::append_char(__local_10, 110); - String::append_char(__local_10, 117); - String::append_char(__local_10, 109); - String::append_char(__local_10, 115); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 110); + String::push(__local_10, 117); + String::push(__local_10, 109); + String::push(__local_10, 115); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_35 = __local_11; i32::fmt_decimal(__local_4, __local_35); - String::append_char(__local_10, 32); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_40 = __local_11; i32::fmt_decimal(__local_5, __local_40); @@ -306,16 +306,16 @@ fn describe(a, b) { __local_7 = value_copy String(ref.cast TupleValue::Text(__local_20).payload_0); __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(40), used: 0 }; - String::append_char(__local_12, 116); - String::append_char(__local_12, 101); - String::append_char(__local_12, 120); - String::append_char(__local_12, 116); - String::append_char(__local_12, 115); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); - String::append(__local_12, __local_6); - String::append_char(__local_12, 32); - String::append(__local_12, __local_7); + String::push(__local_12, 116); + String::push(__local_12, 101); + String::push(__local_12, 120); + String::push(__local_12, 116); + String::push(__local_12, 115); + String::push(__local_12, 58); + String::push(__local_12, 32); + String::push_str(__local_12, __local_6); + String::push(__local_12, 32); + String::push_str(__local_12, __local_7); break __tmpl: __local_12; }; } else { @@ -332,9 +332,9 @@ fn destruct_basic() with Stdout { __local_2 = String { repr: builtin::array_new(34), used: 0 }; __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(42, __local_3); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); - String::append(__local_2, __sroa___pattern_temp_0_1); + String::push(__local_2, 44); + String::push(__local_2, 32); + String::push_str(__local_2, __sroa___pattern_temp_0_1); break __tmpl: __local_2; }); } @@ -369,9 +369,9 @@ fn destruct_for_of() with Stdout { __local_7 = String { repr: builtin::array_new(34), used: 0 }; __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(num, __local_8); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); - String::append(__local_7, name_4); + String::push(__local_7, 58); + String::push(__local_7, 32); + String::push_str(__local_7, name_4); break __tmpl: __local_7; }); } else { @@ -428,8 +428,8 @@ fn destruct_if_let() with Stdout { __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_22 = __local_8; i32::fmt_decimal(x_1, __local_22); - String::append_char(__local_7, 44); - String::append_char(__local_7, 32); + String::push(__local_7, 44); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_27 = __local_8; i32::fmt_decimal(y_2, __local_27); @@ -446,8 +446,8 @@ fn destruct_if_let() with Stdout { __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_33 = __local_10; i32::fmt_decimal(x_4, __local_33); - String::append_char(__local_9, 44); - String::append_char(__local_9, 32); + String::push(__local_9, 44); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_38 = __local_10; i32::fmt_decimal(y_5, __local_38); @@ -533,19 +533,19 @@ fn destruct_mut() with Stdout { let __local_26: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(42), used: 0 }; - String::append_char(__local_2, 98); - String::append_char(__local_2, 101); - String::append_char(__local_2, 102); - String::append_char(__local_2, 111); - String::append_char(__local_2, 114); - String::append_char(__local_2, 101); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 98); + String::push(__local_2, 101); + String::push(__local_2, 102); + String::push(__local_2, 111); + String::push(__local_2, 114); + String::push(__local_2, 101); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_10 = __local_3; i32::fmt_decimal(10, __local_10); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_15 = __local_3; i32::fmt_decimal(20, __local_15); @@ -553,18 +553,18 @@ fn destruct_mut() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(41), used: 0 }; - String::append_char(__local_4, 97); - String::append_char(__local_4, 102); - String::append_char(__local_4, 116); - String::append_char(__local_4, 101); - String::append_char(__local_4, 114); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 102); + String::push(__local_4, 116); + String::push(__local_4, 101); + String::push(__local_4, 114); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_21 = __local_5; i32::fmt_decimal(100, __local_21); - String::append_char(__local_4, 44); - String::append_char(__local_4, 32); + String::push(__local_4, 44); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_26 = __local_5; i32::fmt_decimal(200, __local_26); @@ -584,14 +584,14 @@ fn destruct_nested() with Stdout { __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_10 = __local_4; i32::fmt_decimal(1, __local_10); - String::append_char(__local_3, 44); - String::append_char(__local_3, 32); + String::push(__local_3, 44); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_15 = __local_4; i32::fmt_decimal(2, __local_15); - String::append_char(__local_3, 44); - String::append_char(__local_3, 32); - String::append(__local_3, __sroa___pattern_temp_0_1); + String::push(__local_3, 44); + String::push(__local_3, 32); + String::push_str(__local_3, __sroa___pattern_temp_0_1); break __tmpl: __local_3; }); } @@ -607,8 +607,8 @@ fn destruct_wildcard() with Stdout { __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_8 = __local_3; i32::fmt_decimal(1, __local_8); - String::append_char(__local_2, 44); - String::append_char(__local_2, 32); + String::push(__local_2, 44); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_13 = __local_3; i32::fmt_decimal(3, __local_13); @@ -655,7 +655,7 @@ fn destruct_literal() with Stdout { __local_26 = __match_scrut_0.1; __tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_16, String { repr: array.new_data("matched int: "), used: 13 }); + String::push_str(__local_16, String { repr: array.new_data("matched int: "), used: 13 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(__local_1, __local_17); break __tmpl: __local_16; @@ -672,8 +672,8 @@ fn destruct_literal() with Stdout { __local_27 = __match_scrut_1.1; __tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_18, String { repr: array.new_data("matched bool: "), used: 14 }); - String::append(__local_18, __local_4); + String::push_str(__local_18, String { repr: array.new_data("matched bool: "), used: 14 }); + String::push_str(__local_18, __local_4); break __tmpl: __local_18; }; __local_5 = __match_scrut_1.0; @@ -683,8 +683,8 @@ fn destruct_literal() with Stdout { __local_28 = __match_scrut_1.1; __tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(29), used: 0 }; - String::append(__local_19, String { repr: array.new_data("not matched: "), used: 13 }); - String::append(__local_19, __local_5); + String::push_str(__local_19, String { repr: array.new_data("not matched: "), used: 13 }); + String::push_str(__local_19, __local_5); break __tmpl: __local_19; }; } else { @@ -699,7 +699,7 @@ fn destruct_literal() with Stdout { __local_29 = __match_scrut_2.1; __tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(30), used: 0 }; - String::append(__local_20, String { repr: array.new_data("matched char: "), used: 14 }); + String::push_str(__local_20, String { repr: array.new_data("matched char: "), used: 14 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(__local_8, __local_21); break __tmpl: __local_20; @@ -716,7 +716,7 @@ fn destruct_literal() with Stdout { __local_30 = __match_scrut_3.1; __tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_22, String { repr: array.new_data("matched string: "), used: 16 }); + String::push_str(__local_22, String { repr: array.new_data("matched string: "), used: 16 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i32::fmt_decimal(__local_11, __local_23); break __tmpl: __local_22; @@ -727,7 +727,7 @@ fn destruct_literal() with Stdout { "core:cli/println"(result5); "core:cli/println"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(28), used: 0 }; - String::append(__local_24, String { repr: array.new_data("if-let int: "), used: 12 }); + String::push_str(__local_24, String { repr: array.new_data("if-let int: "), used: 12 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i32::fmt_decimal(100, __local_25); break __tmpl: __local_24; @@ -789,8 +789,8 @@ fn destruct_match() with Stdout { __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_24 = __local_15; i32::fmt_decimal(__local_5, __local_24); - String::append_char(__local_14, 44); - String::append_char(__local_14, 32); + String::push(__local_14, 44); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_29 = __local_15; i32::fmt_decimal(__local_6, __local_29); @@ -1057,7 +1057,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1101,7 +1101,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1138,7 +1138,7 @@ fn ArrayIter>^Iterator::next(self) { return item; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1191,7 +1191,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l68; }; @@ -1211,7 +1211,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1219,17 +1219,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1259,20 +1259,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1282,10 +1282,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1295,10 +1295,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1306,10 +1306,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tuple_elision_multivalue.wir.wado b/wado-compiler/tests/fixtures.golden/tuple_elision_multivalue.wir.wado index 04f98ae7c..9dd67c6ce 100644 --- a/wado-compiler/tests/fixtures.golden/tuple_elision_multivalue.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tuple_elision_multivalue.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -127,15 +127,15 @@ fn run() with Stdout { multivalue_bind [__local_0, __local_1] = i64.add128(100_i64, 200_i64, 50_i64, 25_i64); "core:cli/println"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(48), used: 0 }; - String::append(__local_10, String { repr: array.new_data("add128: lo="), used: 11 }); + String::push_str(__local_10, String { repr: array.new_data("add128: lo="), used: 11 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_26 = __local_11; i64::fmt_decimal(__local_0, __local_26); - String::append_char(__local_10, 44); - String::append_char(__local_10, 32); - String::append_char(__local_10, 104); - String::append_char(__local_10, 105); - String::append_char(__local_10, 61); + String::push(__local_10, 44); + String::push(__local_10, 32); + String::push(__local_10, 104); + String::push(__local_10, 105); + String::push(__local_10, 61); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_31 = __local_11; i64::fmt_decimal(__local_1, __local_31); @@ -144,15 +144,15 @@ fn run() with Stdout { multivalue_bind [__local_2, __local_3] = i64.sub128(150_i64, 225_i64, 50_i64, 25_i64); "core:cli/println"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(48), used: 0 }; - String::append(__local_12, String { repr: array.new_data("sub128: lo="), used: 11 }); + String::push_str(__local_12, String { repr: array.new_data("sub128: lo="), used: 11 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_37 = __local_13; i64::fmt_decimal(__local_2, __local_37); - String::append_char(__local_12, 44); - String::append_char(__local_12, 32); - String::append_char(__local_12, 104); - String::append_char(__local_12, 105); - String::append_char(__local_12, 61); + String::push(__local_12, 44); + String::push(__local_12, 32); + String::push(__local_12, 104); + String::push(__local_12, 105); + String::push(__local_12, 61); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_42 = __local_13; i64::fmt_decimal(__local_3, __local_42); @@ -161,15 +161,15 @@ fn run() with Stdout { multivalue_bind [__local_4, __local_5] = i64.mul_wide_u(10_i64, 20_i64); "core:cli/println"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(52), used: 0 }; - String::append(__local_14, String { repr: array.new_data("mul_wide_u: lo="), used: 15 }); + String::push_str(__local_14, String { repr: array.new_data("mul_wide_u: lo="), used: 15 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_48 = __local_15; i64::fmt_decimal(__local_4, __local_48); - String::append_char(__local_14, 44); - String::append_char(__local_14, 32); - String::append_char(__local_14, 104); - String::append_char(__local_14, 105); - String::append_char(__local_14, 61); + String::push(__local_14, 44); + String::push(__local_14, 32); + String::push(__local_14, 104); + String::push(__local_14, 105); + String::push(__local_14, 61); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_53 = __local_15; i64::fmt_decimal(__local_5, __local_53); @@ -178,15 +178,15 @@ fn run() with Stdout { multivalue_bind [__local_6, __local_7] = i64.mul_wide_s(-10_i64, 20_i64); "core:cli/println"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(52), used: 0 }; - String::append(__local_16, String { repr: array.new_data("mul_wide_s: lo="), used: 15 }); + String::push_str(__local_16, String { repr: array.new_data("mul_wide_s: lo="), used: 15 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_59 = __local_17; i64::fmt_decimal(__local_6, __local_59); - String::append_char(__local_16, 44); - String::append_char(__local_16, 32); - String::append_char(__local_16, 104); - String::append_char(__local_16, 105); - String::append_char(__local_16, 61); + String::push(__local_16, 44); + String::push(__local_16, 32); + String::push(__local_16, 104); + String::push(__local_16, 105); + String::push(__local_16, 61); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_64 = __local_17; i64::fmt_decimal(__local_7, __local_64); @@ -195,7 +195,7 @@ fn run() with Stdout { multivalue_bind [__local_8, _] = i64.mul_wide_u(100_i64, 100_i64); "core:cli/println"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_18, String { repr: array.new_data("mul_wide_u lo only: "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("mul_wide_u lo only: "), used: 20 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i64::fmt_decimal(__local_8, __local_19); break __tmpl: __local_18; @@ -203,7 +203,7 @@ fn run() with Stdout { multivalue_bind [_, __local_9] = i64.mul_wide_u(-9223372036854775808_i64, 2_i64); "core:cli/println"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_20, String { repr: array.new_data("mul_wide_u hi only: "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("mul_wide_u hi only: "), used: 20 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i64::fmt_decimal(__local_9, __local_21); break __tmpl: __local_20; @@ -424,7 +424,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -439,7 +439,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -477,7 +477,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -511,20 +511,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -534,10 +534,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -547,10 +547,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -558,10 +558,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/tuple_for_of.wir.wado b/wado-compiler/tests/fixtures.golden/tuple_for_of.wir.wado index bb5cb19c0..8153725e0 100644 --- a/wado-compiler/tests/fixtures.golden/tuple_for_of.wir.wado +++ b/wado-compiler/tests/fixtures.golden/tuple_for_of.wir.wado @@ -28,10 +28,10 @@ struct Formatter { array array (mut u64); -array array (mut i32); - array array (mut ref String); +array array (mut i32); + struct Array { // Array with T=u64 mut repr: ref array, mut used: i32, @@ -143,7 +143,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -153,7 +153,7 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String::concat" = fn(ref String, ref String) -> ref String; @@ -161,15 +161,15 @@ type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/String^Describe::describe" = fn(ref String) -> ref String; -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -264,14 +264,14 @@ fn __test_0_basic_heterogeneous() { __local_1 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_1; }; - Array::append(results, __tmpl: block -> ref String { + Array::push(results, __tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(16), used: 0 }; __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; i32::fmt_decimal(42, __local_14); break __tmpl: __local_13; }); - Array::append(results, __sroa_t_1); - Array::append(results, __tmpl: block -> ref String { + Array::push(results, __sroa_t_1); + Array::push(results, __tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(16), used: 0 }; __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; Formatter::pad(__local_16, block -> ref String { @@ -290,24 +290,24 @@ fn __test_0_basic_heterogeneous() { if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_0_basic_heterogeneous"), used: 28 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_0_basic_heterogeneous"), used: 28 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_43 = __local_18; i32::fmt_decimal(30, __local_43); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: results[0] == \"42\" "), used: 31 }); - String::append(__local_17, String { repr: array.new_data("results[0]: "), used: 12 }); + String::push_str(__local_17, String { repr: array.new_data("results[0]: "), used: 12 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; String^Inspect::inspect(__v0_7, __local_18); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -323,24 +323,24 @@ condition: results[0] == \"42\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_0_basic_heterogeneous"), used: 28 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_0_basic_heterogeneous"), used: 28 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_52 = __local_20; i32::fmt_decimal(31, __local_52); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: results[1] == \"hello\" "), used: 34 }); - String::append(__local_19, String { repr: array.new_data("results[1]: "), used: 12 }); + String::push_str(__local_19, String { repr: array.new_data("results[1]: "), used: 12 }); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; String^Inspect::inspect(__v0_9, __local_20); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -356,24 +356,24 @@ condition: results[1] == \"hello\" if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_0_basic_heterogeneous"), used: 28 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_0_basic_heterogeneous"), used: 28 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_61 = __local_22; i32::fmt_decimal(32, __local_61); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: results[2] == \"true\" "), used: 33 }); - String::append(__local_21, String { repr: array.new_data("results[2]: "), used: 12 }); + String::push_str(__local_21, String { repr: array.new_data("results[2]: "), used: 12 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; String^Inspect::inspect(__v0_11, __local_22); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -440,18 +440,18 @@ fn __test_1_enumerate() { __local_3 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_3; }; - Array::append(indices, 0); - Array::append(values, __tmpl: block -> ref String { + Array::push(indices, 0); + Array::push(values, __tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(16), used: 0 }; __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; i32::fmt_decimal(10, __local_25); break __tmpl: __local_24; }); __sroa___pattern_temp_1_1 = __sroa_t_1; - Array::append(indices, 1); - Array::append(values, __sroa___pattern_temp_1_1); - Array::append(indices, 2); - Array::append(values, __tmpl: block -> ref String { + Array::push(indices, 1); + Array::push(values, __sroa___pattern_temp_1_1); + Array::push(indices, 2); + Array::push(values, __tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(16), used: 0 }; __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; Formatter::pad(__local_27, block -> ref String { @@ -470,25 +470,25 @@ fn __test_1_enumerate() { if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_66 = __local_29; i32::fmt_decimal(43, __local_66); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: indices[0] == 0 "), used: 28 }); - String::append(__local_28, String { repr: array.new_data("indices[0]: "), used: 12 }); + String::push_str(__local_28, String { repr: array.new_data("indices[0]: "), used: 12 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_71 = __local_29; i32::fmt_decimal(__v0_12, __local_71); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -504,25 +504,25 @@ condition: indices[0] == 0 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_30, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_30, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_79 = __local_31; i32::fmt_decimal(44, __local_79); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: indices[1] == 1 "), used: 28 }); - String::append(__local_30, String { repr: array.new_data("indices[1]: "), used: 12 }); + String::push_str(__local_30, String { repr: array.new_data("indices[1]: "), used: 12 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_84 = __local_31; i32::fmt_decimal(__v0_14, __local_84); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -538,25 +538,25 @@ condition: indices[1] == 1 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_32, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_32, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_92 = __local_33; i32::fmt_decimal(45, __local_92); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: indices[2] == 2 "), used: 28 }); - String::append(__local_32, String { repr: array.new_data("indices[2]: "), used: 12 }); + String::push_str(__local_32, String { repr: array.new_data("indices[2]: "), used: 12 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_97 = __local_33; i32::fmt_decimal(__v0_16, __local_97); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -572,24 +572,24 @@ condition: indices[2] == 2 if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_34, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_34, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_105 = __local_35; i32::fmt_decimal(46, __local_105); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: values[0] == \"10\" "), used: 30 }); - String::append(__local_34, String { repr: array.new_data("values[0]: "), used: 11 }); + String::push_str(__local_34, String { repr: array.new_data("values[0]: "), used: 11 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; String^Inspect::inspect(__v0_18, __local_35); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -605,24 +605,24 @@ condition: values[0] == \"10\" if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_36, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_36, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_114 = __local_37; i32::fmt_decimal(47, __local_114); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: values[1] == \"world\" "), used: 33 }); - String::append(__local_36, String { repr: array.new_data("values[1]: "), used: 11 }); + String::push_str(__local_36, String { repr: array.new_data("values[1]: "), used: 11 }); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; String^Inspect::inspect(__v0_20, __local_37); - String::append_char(__local_36, 10); + String::push(__local_36, 10); break __tmpl: __local_36; }); unreachable; @@ -638,24 +638,24 @@ condition: values[1] == \"world\" if __cond_23 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_38, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_38, String { repr: array.new_data("__test_1_enumerate"), used: 18 }); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_123 = __local_39; i32::fmt_decimal(48, __local_123); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: values[2] == \"false\" "), used: 33 }); - String::append(__local_38, String { repr: array.new_data("values[2]: "), used: 11 }); + String::push_str(__local_38, String { repr: array.new_data("values[2]: "), used: 11 }); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; String^Inspect::inspect(__v0_22, __local_39); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; @@ -724,10 +724,10 @@ fn __test_5_trait_dispatch_per_element_type() { __local_1 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_1; }; - Array::append(results, i32^Describe::describe(42)); + Array::push(results, i32^Describe::describe(42)); v = __sroa_t_1; - Array::append(results, String^Describe::describe(v)); - Array::append(results, __inline_bool_Describe__describe_4: block -> ref String { + Array::push(results, String^Describe::describe(v)); + Array::push(results, __inline_bool_Describe__describe_4: block -> ref String { block { break __inline_bool_Describe__describe_4: String { repr: array.new_data("yes"), used: 3 }; }; @@ -744,24 +744,24 @@ fn __test_5_trait_dispatch_per_element_type() { if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_5_trait_dispatch_per_element_type"), used: 40 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_5_trait_dispatch_per_element_type"), used: 40 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_28 = __local_14; i32::fmt_decimal(84, __local_28); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: results[0] == \"int(42)\" "), used: 36 }); - String::append(__local_13, String { repr: array.new_data("results[0]: "), used: 12 }); + String::push_str(__local_13, String { repr: array.new_data("results[0]: "), used: 12 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; String^Inspect::inspect(__v0_7, __local_14); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -777,24 +777,24 @@ condition: results[0] == \"int(42)\" if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_5_trait_dispatch_per_element_type"), used: 40 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_5_trait_dispatch_per_element_type"), used: 40 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_37 = __local_16; i32::fmt_decimal(85, __local_37); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: results[1] == \"str(wado)\" "), used: 38 }); - String::append(__local_15, String { repr: array.new_data("results[1]: "), used: 12 }); + String::push_str(__local_15, String { repr: array.new_data("results[1]: "), used: 12 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; String^Inspect::inspect(__v0_9, __local_16); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -810,24 +810,24 @@ condition: results[1] == \"str(wado)\" if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_5_trait_dispatch_per_element_type"), used: 40 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_5_trait_dispatch_per_element_type"), used: 40 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_46 = __local_18; i32::fmt_decimal(86, __local_46); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: results[2] == \"yes\" "), used: 32 }); - String::append(__local_17, String { repr: array.new_data("results[2]: "), used: 12 }); + String::push_str(__local_17, String { repr: array.new_data("results[2]: "), used: 12 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; String^Inspect::inspect(__v0_11, __local_18); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -866,24 +866,24 @@ fn __test_6_enumerate_with_trait_dispatch() { __local_1 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_1; }; - Array::append(results, __tmpl: block -> ref String { + Array::push(results, __tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(34), used: 0 }; __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(0, __local_13); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); - String::append(__local_12, i32^Describe::describe(1)); + String::push(__local_12, 58); + String::push(__local_12, 32); + String::push_str(__local_12, i32^Describe::describe(1)); break __tmpl: __local_12; }); __sroa___pattern_temp_1_1 = __sroa_t_1; v = __sroa___pattern_temp_1_1; - Array::append(results, __tmpl: block -> ref String { + Array::push(results, __tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(34), used: 0 }; __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(1, __local_15); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); - String::append(__local_14, String^Describe::describe(v)); + String::push(__local_14, 58); + String::push(__local_14, 32); + String::push_str(__local_14, String^Describe::describe(v)); break __tmpl: __local_14; }); __v0_8 = __inline_Array_String__IndexValue__index_value_12: block -> ref String { @@ -897,24 +897,24 @@ fn __test_6_enumerate_with_trait_dispatch() { if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(140), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("__test_6_enumerate_with_trait_dispatch"), used: 38 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("__test_6_enumerate_with_trait_dispatch"), used: 38 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_42 = __local_17; i32::fmt_decimal(95, __local_42); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: results[0] == \"0: int(1)\" "), used: 38 }); - String::append(__local_16, String { repr: array.new_data("results[0]: "), used: 12 }); + String::push_str(__local_16, String { repr: array.new_data("results[0]: "), used: 12 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_8, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -930,24 +930,24 @@ condition: results[0] == \"0: int(1)\" if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(142), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("__test_6_enumerate_with_trait_dispatch"), used: 38 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("__test_6_enumerate_with_trait_dispatch"), used: 38 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; __local_51 = __local_19; i32::fmt_decimal(96, __local_51); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: results[1] == \"1: str(two)\" "), used: 40 }); - String::append(__local_18, String { repr: array.new_data("results[1]: "), used: 12 }); + String::push_str(__local_18, String { repr: array.new_data("results[1]: "), used: 12 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; String^Inspect::inspect(__v0_10, __local_19); - String::append_char(__local_18, 10); + String::push(__local_18, 10); break __tmpl: __local_18; }); unreachable; @@ -996,14 +996,14 @@ fn __test_7_nested_tuple_for_of_expansion() { __local_1 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_1; }; - Array::append(results, __tmpl: block -> ref String { + Array::push(results, __tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(16), used: 0 }; __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(1, __local_21); break __tmpl: __local_20; }); - Array::append(results, __sroa___sroa_t_0_1); - Array::append(results, __tmpl: block -> ref String { + Array::push(results, __sroa___sroa_t_0_1); + Array::push(results, __tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(16), used: 0 }; __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; Formatter::pad(__local_23, block -> ref String { @@ -1011,7 +1011,7 @@ fn __test_7_nested_tuple_for_of_expansion() { }); break __tmpl: __local_22; }); - Array::append(results, __tmpl: block -> ref String { + Array::push(results, __tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(16), used: 0 }; __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; f64::fmt_into(3.14, __local_25); @@ -1028,24 +1028,24 @@ fn __test_7_nested_tuple_for_of_expansion() { if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_26 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_26, String { repr: array.new_data("__test_7_nested_tuple_for_of_expansion"), used: 38 }); - String::append_char(__local_26, 32); - String::append_char(__local_26, 97); - String::append_char(__local_26, 116); - String::append_char(__local_26, 32); - String::append(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_26, 58); + String::push_str(__local_26, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_26, String { repr: array.new_data("__test_7_nested_tuple_for_of_expansion"), used: 38 }); + String::push(__local_26, 32); + String::push(__local_26, 97); + String::push(__local_26, 116); + String::push(__local_26, 32); + String::push_str(__local_26, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_26, 58); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; __local_58 = __local_27; i32::fmt_decimal(107, __local_58); - String::append(__local_26, String { repr: array.new_data(" + String::push_str(__local_26, String { repr: array.new_data(" condition: results[0] == \"1\" "), used: 30 }); - String::append(__local_26, String { repr: array.new_data("results[0]: "), used: 12 }); + String::push_str(__local_26, String { repr: array.new_data("results[0]: "), used: 12 }); __local_27 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_26 }; String^Inspect::inspect(__v0_12, __local_27); - String::append_char(__local_26, 10); + String::push(__local_26, 10); break __tmpl: __local_26; }); unreachable; @@ -1061,24 +1061,24 @@ condition: results[0] == \"1\" if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_28 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_28, String { repr: array.new_data("__test_7_nested_tuple_for_of_expansion"), used: 38 }); - String::append_char(__local_28, 32); - String::append_char(__local_28, 97); - String::append_char(__local_28, 116); - String::append_char(__local_28, 32); - String::append(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_28, 58); + String::push_str(__local_28, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_28, String { repr: array.new_data("__test_7_nested_tuple_for_of_expansion"), used: 38 }); + String::push(__local_28, 32); + String::push(__local_28, 97); + String::push(__local_28, 116); + String::push(__local_28, 32); + String::push_str(__local_28, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_28, 58); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; __local_67 = __local_29; i32::fmt_decimal(108, __local_67); - String::append(__local_28, String { repr: array.new_data(" + String::push_str(__local_28, String { repr: array.new_data(" condition: results[1] == \"a\" "), used: 30 }); - String::append(__local_28, String { repr: array.new_data("results[1]: "), used: 12 }); + String::push_str(__local_28, String { repr: array.new_data("results[1]: "), used: 12 }); __local_29 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_28 }; String^Inspect::inspect(__v0_14, __local_29); - String::append_char(__local_28, 10); + String::push(__local_28, 10); break __tmpl: __local_28; }); unreachable; @@ -1094,24 +1094,24 @@ condition: results[1] == \"a\" if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_30, String { repr: array.new_data("__test_7_nested_tuple_for_of_expansion"), used: 38 }); - String::append_char(__local_30, 32); - String::append_char(__local_30, 97); - String::append_char(__local_30, 116); - String::append_char(__local_30, 32); - String::append(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_30, 58); + String::push_str(__local_30, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_30, String { repr: array.new_data("__test_7_nested_tuple_for_of_expansion"), used: 38 }); + String::push(__local_30, 32); + String::push(__local_30, 97); + String::push(__local_30, 116); + String::push(__local_30, 32); + String::push_str(__local_30, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_30, 58); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; __local_76 = __local_31; i32::fmt_decimal(109, __local_76); - String::append(__local_30, String { repr: array.new_data(" + String::push_str(__local_30, String { repr: array.new_data(" condition: results[2] == \"true\" "), used: 33 }); - String::append(__local_30, String { repr: array.new_data("results[2]: "), used: 12 }); + String::push_str(__local_30, String { repr: array.new_data("results[2]: "), used: 12 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; String^Inspect::inspect(__v0_16, __local_31); - String::append_char(__local_30, 10); + String::push(__local_30, 10); break __tmpl: __local_30; }); unreachable; @@ -1127,24 +1127,24 @@ condition: results[2] == \"true\" if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_32, String { repr: array.new_data("__test_7_nested_tuple_for_of_expansion"), used: 38 }); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_32, String { repr: array.new_data("__test_7_nested_tuple_for_of_expansion"), used: 38 }); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_85 = __local_33; i32::fmt_decimal(110, __local_85); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: results[3] == \"3.14\" "), used: 33 }); - String::append(__local_32, String { repr: array.new_data("results[3]: "), used: 12 }); + String::push_str(__local_32, String { repr: array.new_data("results[3]: "), used: 12 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; String^Inspect::inspect(__v0_18, __local_33); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -1183,9 +1183,9 @@ fn __test_8_mutable_binding() { __local_1 = Array { repr: builtin::array_new(0), used: 0 }; break __seq_lit: __local_1; }; - Array::append(results, 11); - Array::append(results, 21); - Array::append(results, 31); + Array::push(results, 11); + Array::push(results, 21); + Array::push(results, 31); __v0_7 = __inline_Array_i32__IndexValue__index_value_4: block -> i32 { if 0 >= results.used { "core:internal/panic"(String { repr: array.new_data("index out of bounds"), used: 19 }); @@ -1197,25 +1197,25 @@ fn __test_8_mutable_binding() { if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_8_mutable_binding"), used: 24 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_8_mutable_binding"), used: 24 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_27 = __local_14; i32::fmt_decimal(120, __local_27); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: results[0] == 11 "), used: 29 }); - String::append(__local_13, String { repr: array.new_data("results[0]: "), used: 12 }); + String::push_str(__local_13, String { repr: array.new_data("results[0]: "), used: 12 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_32 = __local_14; i32::fmt_decimal(__v0_7, __local_32); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -1231,25 +1231,25 @@ condition: results[0] == 11 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_8_mutable_binding"), used: 24 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_8_mutable_binding"), used: 24 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_40 = __local_16; i32::fmt_decimal(121, __local_40); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: results[1] == 21 "), used: 29 }); - String::append(__local_15, String { repr: array.new_data("results[1]: "), used: 12 }); + String::push_str(__local_15, String { repr: array.new_data("results[1]: "), used: 12 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_45 = __local_16; i32::fmt_decimal(__v0_9, __local_45); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -1265,25 +1265,25 @@ condition: results[1] == 21 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(131), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_8_mutable_binding"), used: 24 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_8_mutable_binding"), used: 24 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_53 = __local_18; i32::fmt_decimal(122, __local_53); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: results[2] == 31 "), used: 29 }); - String::append(__local_17, String { repr: array.new_data("results[2]: "), used: 12 }); + String::push_str(__local_17, String { repr: array.new_data("results[2]: "), used: 12 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_58 = __local_18; i32::fmt_decimal(__v0_11, __local_58); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -1371,31 +1371,31 @@ fn __test_9_enumerate_index_as_compile_time_constant() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_9_enumerate_index_as_compile_time_constant"), used: 49 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_9_enumerate_index_as_compile_time_constant"), used: 49 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/tuple_for_of.wado"), used: 46 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_49 = __local_14; i32::fmt_decimal(132, __local_49); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: result == \"a100bhelloc\" "), used: 36 }); - String::append_char(__local_13, 114); - String::append_char(__local_13, 101); - String::append_char(__local_13, 115); - String::append_char(__local_13, 117); - String::append_char(__local_13, 108); - String::append_char(__local_13, 116); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 114); + String::push(__local_13, 101); + String::push(__local_13, 115); + String::push(__local_13, 117); + String::push(__local_13, 108); + String::push(__local_13, 116); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; String^Inspect::inspect(__v0, __local_14); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -2184,8 +2184,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2240,8 +2240,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2273,7 +2273,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -2402,27 +2402,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2543,9 +2543,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -2599,13 +2599,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2640,9 +2640,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2695,7 +2695,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2797,7 +2797,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2829,13 +2829,13 @@ fn i32^Describe::describe(self) { let __local_2: ref Formatter; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_1, 105); - String::append_char(__local_1, 110); - String::append_char(__local_1, 116); - String::append_char(__local_1, 40); + String::push(__local_1, 105); + String::push(__local_1, 110); + String::push(__local_1, 116); + String::push(__local_1, 40); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(self, __local_2); - String::append_char(__local_1, 41); + String::push(__local_1, 41); break __tmpl: __local_1; }; } @@ -2844,17 +2844,17 @@ fn String^Describe::describe(self) { let __local_1: ref String; return __tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_1, 115); - String::append_char(__local_1, 116); - String::append_char(__local_1, 114); - String::append_char(__local_1, 40); - String::append(__local_1, self); - String::append_char(__local_1, 41); + String::push(__local_1, 115); + String::push(__local_1, 116); + String::push(__local_1, 114); + String::push(__local_1, 40); + String::push_str(__local_1, self); + String::push(__local_1, 41); break __tmpl: __local_1; }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2896,7 +2896,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2949,7 +2949,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l230; }; @@ -2969,7 +2969,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2977,17 +2977,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3141,20 +3141,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3164,10 +3164,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3177,10 +3177,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3188,10 +3188,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3203,7 +3203,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3220,22 +3220,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b269; @@ -3243,7 +3243,7 @@ fn String^Inspect::inspect(self, f) { continue l270; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_basic_heterogeneous as "__test_0_basic_heterogeneous" diff --git a/wado-compiler/tests/fixtures.golden/type_cast.wir.wado b/wado-compiler/tests/fixtures.golden/type_cast.wir.wado index df80ce15c..eb46c4be7 100644 --- a/wado-compiler/tests/fixtures.golden/type_cast.wir.wado +++ b/wado-compiler/tests/fixtures.golden/type_cast.wir.wado @@ -151,7 +151,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -161,9 +161,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -227,17 +227,17 @@ fn test_i32_to_f64() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_i32_to_f64"), used: 15 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_i32_to_f64"), used: 15 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(64, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: i as f64 == 42.0 "), used: 29 }); break __tmpl: __local_4; @@ -248,17 +248,17 @@ condition: i as f64 == 42.0 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_i32_to_f64"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_i32_to_f64"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(66, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: neg as f64 == -10.0 "), used: 32 }); break __tmpl: __local_6; @@ -278,17 +278,17 @@ fn test_u32_to_f64() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_u32_to_f64"), used: 15 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_u32_to_f64"), used: 15 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(72, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: small as f64 == 100.0 "), used: 34 }); break __tmpl: __local_4; @@ -299,17 +299,17 @@ condition: small as f64 == 100.0 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_u32_to_f64"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_u32_to_f64"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(75, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: large as f64 == 3000000000.0 "), used: 41 }); break __tmpl: __local_6; @@ -329,17 +329,17 @@ fn test_i64_to_f64() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_i64_to_f64"), used: 15 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_i64_to_f64"), used: 15 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(81, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: i as f64 == 1000000.0 "), used: 34 }); break __tmpl: __local_4; @@ -350,17 +350,17 @@ condition: i as f64 == 1000000.0 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_i64_to_f64"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_i64_to_f64"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(83, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: neg as f64 == -42.0 "), used: 32 }); break __tmpl: __local_6; @@ -380,17 +380,17 @@ fn test_u64_to_f64() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_u64_to_f64"), used: 15 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_u64_to_f64"), used: 15 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(89, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: u as f64 == 1000000.0 "), used: 34 }); break __tmpl: __local_4; @@ -401,17 +401,17 @@ condition: u as f64 == 1000000.0 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_u64_to_f64"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_u64_to_f64"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(92, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: large as f64 == 10000000000000000000.0 "), used: 51 }); break __tmpl: __local_6; @@ -434,17 +434,17 @@ fn test_i32_to_f32() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_i32_to_f32"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_i32_to_f32"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(99, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: f as f64 == 42.0 "), used: 29 }); break __tmpl: __local_6; @@ -456,17 +456,17 @@ condition: f as f64 == 42.0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("test_i32_to_f32"), used: 15 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("test_i32_to_f32"), used: 15 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(103, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: f2 as f64 == -10.0 "), used: 31 }); break __tmpl: __local_8; @@ -485,17 +485,17 @@ fn test_u32_to_f32() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(103), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("test_u32_to_f32"), used: 15 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("test_u32_to_f32"), used: 15 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(110, __local_4); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: f as f64 == 100.0 "), used: 30 }); break __tmpl: __local_3; @@ -514,17 +514,17 @@ fn test_i64_to_f32() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("test_i64_to_f32"), used: 15 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("test_i64_to_f32"), used: 15 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(117, __local_4); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: f as f64 == 1000.0 "), used: 31 }); break __tmpl: __local_3; @@ -543,17 +543,17 @@ fn test_u64_to_f32() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("test_u64_to_f32"), used: 15 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("test_u64_to_f32"), used: 15 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(124, __local_4); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: f as f64 == 1000.0 "), used: 31 }); break __tmpl: __local_3; @@ -573,17 +573,17 @@ fn test_i8_u8_to_f64() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_i8_u8_to_f64"), used: 17 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_i8_u8_to_f64"), used: 17 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(129, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: a as f64 == -5.0 "), used: 29 }); break __tmpl: __local_4; @@ -594,17 +594,17 @@ condition: a as f64 == -5.0 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(103), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_i8_u8_to_f64"), used: 17 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_i8_u8_to_f64"), used: 17 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(132, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: b as f64 == 200.0 "), used: 30 }); break __tmpl: __local_6; @@ -624,17 +624,17 @@ fn test_i16_u16_to_f64() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_i16_u16_to_f64"), used: 19 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_i16_u16_to_f64"), used: 19 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(137, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: a as f64 == -1000.0 "), used: 32 }); break __tmpl: __local_4; @@ -645,17 +645,17 @@ condition: a as f64 == -1000.0 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_i16_u16_to_f64"), used: 19 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_i16_u16_to_f64"), used: 19 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(140, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: b as f64 == 50000.0 "), used: 32 }); break __tmpl: __local_6; @@ -678,17 +678,17 @@ fn test_i8_u8_to_f32() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(103), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_i8_u8_to_f32"), used: 17 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_i8_u8_to_f32"), used: 17 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(146, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: f as f64 == 100.0 "), used: 30 }); break __tmpl: __local_6; @@ -700,17 +700,17 @@ condition: f as f64 == 100.0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("test_i8_u8_to_f32"), used: 17 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("test_i8_u8_to_f32"), used: 17 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(150, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: f2 as f64 == 200.0 "), used: 31 }); break __tmpl: __local_8; @@ -730,17 +730,17 @@ fn test_f64_to_i32() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(99), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_f64_to_i32"), used: 15 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_f64_to_i32"), used: 15 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(156, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: f as i32 == 3 "), used: 26 }); break __tmpl: __local_4; @@ -751,17 +751,17 @@ condition: f as i32 == 3 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_f64_to_i32"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_f64_to_i32"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(159, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: neg as i32 == -7 "), used: 29 }); break __tmpl: __local_6; @@ -781,17 +781,17 @@ fn test_f64_to_u32() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_f64_to_u32"), used: 15 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_f64_to_u32"), used: 15 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(165, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: small as u32 == 100 as u32 "), used: 39 }); break __tmpl: __local_4; @@ -802,17 +802,17 @@ condition: small as u32 == 100 as u32 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_f64_to_u32"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_f64_to_u32"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(167, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: large as u32 == 3000000000 as u32 "), used: 46 }); break __tmpl: __local_6; @@ -835,17 +835,17 @@ fn test_f64_to_i8_u8() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("test_f64_to_i8_u8"), used: 17 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("test_f64_to_i8_u8"), used: 17 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(172, __local_6); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: f as i8 == 100 as i8 "), used: 33 }); break __tmpl: __local_5; @@ -856,17 +856,17 @@ condition: f as i8 == 100 as i8 if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("test_f64_to_i8_u8"), used: 17 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("test_f64_to_i8_u8"), used: 17 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; i32::fmt_decimal(173, __local_8); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: f as u8 == 100 as u8 "), used: 33 }); break __tmpl: __local_7; @@ -877,17 +877,17 @@ condition: f as u8 == 100 as u8 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("test_f64_to_i8_u8"), used: 17 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("test_f64_to_i8_u8"), used: 17 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; i32::fmt_decimal(176, __local_10); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: neg as i8 == -5 as i8 "), used: 34 }); break __tmpl: __local_9; @@ -907,17 +907,17 @@ fn test_f64_to_i16_u16() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("test_f64_to_i16_u16"), used: 19 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("test_f64_to_i16_u16"), used: 19 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(181, __local_4); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: f as i16 == 1000 as i16 "), used: 36 }); break __tmpl: __local_3; @@ -928,17 +928,17 @@ condition: f as i16 == 1000 as i16 if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("test_f64_to_i16_u16"), used: 19 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("test_f64_to_i16_u16"), used: 19 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(182, __local_6); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: f as u16 == 1000 as u16 "), used: 36 }); break __tmpl: __local_5; @@ -958,17 +958,17 @@ fn test_f64_to_i64() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_f64_to_i64"), used: 15 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_f64_to_i64"), used: 15 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(187, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: f as i64 == 42 as i64 "), used: 34 }); break __tmpl: __local_4; @@ -979,17 +979,17 @@ condition: f as i64 == 42 as i64 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_f64_to_i64"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_f64_to_i64"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(190, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: neg as i64 == -7 as i64 "), used: 36 }); break __tmpl: __local_6; @@ -1009,17 +1009,17 @@ fn test_f64_to_u64() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_f64_to_u64"), used: 15 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_f64_to_u64"), used: 15 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(195, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: f as u64 == 100 as u64 "), used: 35 }); break __tmpl: __local_4; @@ -1030,17 +1030,17 @@ condition: f as u64 == 100 as u64 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_f64_to_u64"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_f64_to_u64"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(198, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: large as u64 == 1000000 as u64 "), used: 43 }); break __tmpl: __local_6; @@ -1059,17 +1059,17 @@ fn test_f32_to_i32() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(99), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("test_f32_to_i32"), used: 15 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("test_f32_to_i32"), used: 15 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(203, __local_3); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: f as i32 == 3 "), used: 26 }); break __tmpl: __local_2; @@ -1092,17 +1092,17 @@ fn test_f32_to_u32() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(108), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_f32_to_u32"), used: 15 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_f32_to_u32"), used: 15 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(208, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: f as u32 == 100 as u32 "), used: 35 }); break __tmpl: __local_4; @@ -1114,17 +1114,17 @@ condition: f as u32 == 100 as u32 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_f32_to_u32"), used: 15 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_f32_to_u32"), used: 15 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(212, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: large as u32 == 3000000000 as u32 "), used: 46 }); break __tmpl: __local_6; @@ -1146,17 +1146,17 @@ fn test_f32_to_i8_u8() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("test_f32_to_i8_u8"), used: 17 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("test_f32_to_i8_u8"), used: 17 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(217, __local_4); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: f as i8 == 50 as i8 "), used: 32 }); break __tmpl: __local_3; @@ -1167,17 +1167,17 @@ condition: f as i8 == 50 as i8 if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(105), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("test_f32_to_i8_u8"), used: 17 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("test_f32_to_i8_u8"), used: 17 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(218, __local_6); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: f as u8 == 50 as u8 "), used: 32 }); break __tmpl: __local_5; @@ -1196,17 +1196,17 @@ fn test_f32_to_i64() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("test_f32_to_i64"), used: 15 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("test_f32_to_i64"), used: 15 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(223, __local_3); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: f as i64 == 1000 as i64 "), used: 36 }); break __tmpl: __local_2; @@ -1225,17 +1225,17 @@ fn test_f32_to_u64() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(109), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("test_f32_to_u64"), used: 15 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("test_f32_to_u64"), used: 15 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(228, __local_3); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: f as u64 == 1000 as u64 "), used: 36 }); break __tmpl: __local_2; @@ -1273,32 +1273,32 @@ fn test_f64_f32_conversion() { if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(224), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("test_f64_f32_conversion"), used: 23 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("test_f64_f32_conversion"), used: 23 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_17 = __local_11; i32::fmt_decimal(237, __local_17); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: check > 3.13 && check < 3.15 "), used: 41 }); - String::append_char(__local_10, 99); - String::append_char(__local_10, 104); - String::append_char(__local_10, 101); - String::append_char(__local_10, 99); - String::append_char(__local_10, 107); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 99); + String::push(__local_10, 104); + String::push(__local_10, 101); + String::push(__local_10, 99); + String::push(__local_10, 107); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_22 = __local_11; f64::inspect_into(check, __local_22); - String::append_char(__local_10, 10); - String::append(__local_10, String { repr: array.new_data("check > 3.13: "), used: 14 }); + String::push(__local_10, 10); + String::push_str(__local_10, String { repr: array.new_data("check > 3.13: "), used: 14 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_25 = __local_11; Formatter::pad(__local_25, if __v1 -> ref String { @@ -1306,19 +1306,19 @@ condition: check > 3.13 && check < 3.15 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_10, 10); - String::append_char(__local_10, 99); - String::append_char(__local_10, 104); - String::append_char(__local_10, 101); - String::append_char(__local_10, 99); - String::append_char(__local_10, 107); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 10); + String::push(__local_10, 99); + String::push(__local_10, 104); + String::push(__local_10, 101); + String::push(__local_10, 99); + String::push(__local_10, 107); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_30 = __local_11; f64::inspect_into(check, __local_30); - String::append_char(__local_10, 10); - String::append(__local_10, String { repr: array.new_data("check < 3.15: "), used: 14 }); + String::push(__local_10, 10); + String::push_str(__local_10, String { repr: array.new_data("check < 3.15: "), used: 14 }); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_33 = __local_11; Formatter::pad(__local_33, if __v3 -> ref String { @@ -1326,7 +1326,7 @@ condition: check > 3.13 && check < 3.15 } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -1336,17 +1336,17 @@ condition: check > 3.13 && check < 3.15 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("test_f64_f32_conversion"), used: 23 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("test_f64_f32_conversion"), used: 23 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(241, __local_13); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: f2 as f64 == 1.5 "), used: 29 }); break __tmpl: __local_12; @@ -1369,17 +1369,17 @@ fn test_chained_casts() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(107), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("test_chained_casts"), used: 18 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("test_chained_casts"), used: 18 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(247, __local_5); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: x as f64 as i32 == 10 "), used: 34 }); break __tmpl: __local_4; @@ -1390,17 +1390,17 @@ condition: x as f64 as i32 == 10 if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("test_chained_casts"), used: 18 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("test_chained_casts"), used: 18 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(250, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: x as f64 as f32 as i32 == 10 "), used: 41 }); break __tmpl: __local_6; @@ -1411,17 +1411,17 @@ condition: x as f64 as f32 as i32 == 10 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(114), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("test_chained_casts"), used: 18 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("test_chained_casts"), used: 18 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(253, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: x as i64 as f64 as i32 == 10 "), used: 41 }); break __tmpl: __local_8; @@ -1457,17 +1457,17 @@ fn test_bool_casts() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(99), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("test_bool_casts"), used: 15 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("test_bool_casts"), used: 15 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(261, __local_11); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: t as i32 == 1 "), used: 26 }); break __tmpl: __local_10; @@ -1478,17 +1478,17 @@ condition: t as i32 == 1 if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(99), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("test_bool_casts"), used: 15 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("test_bool_casts"), used: 15 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; i32::fmt_decimal(262, __local_13); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: f as i32 == 0 "), used: 26 }); break __tmpl: __local_12; @@ -1499,17 +1499,17 @@ condition: f as i32 == 0 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("test_bool_casts"), used: 15 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("test_bool_casts"), used: 15 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; i32::fmt_decimal(265, __local_15); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: t as i64 == 1 as i64 "), used: 33 }); break __tmpl: __local_14; @@ -1520,17 +1520,17 @@ condition: t as i64 == 1 as i64 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(106), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("test_bool_casts"), used: 15 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("test_bool_casts"), used: 15 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; i32::fmt_decimal(266, __local_17); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: f as i64 == 0 as i64 "), used: 33 }); break __tmpl: __local_16; @@ -1541,17 +1541,17 @@ condition: f as i64 == 0 as i64 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_18, String { repr: array.new_data("test_bool_casts"), used: 15 }); - String::append_char(__local_18, 32); - String::append_char(__local_18, 97); - String::append_char(__local_18, 116); - String::append_char(__local_18, 32); - String::append(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_18, 58); + String::push_str(__local_18, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_18, String { repr: array.new_data("test_bool_casts"), used: 15 }); + String::push(__local_18, 32); + String::push(__local_18, 97); + String::push(__local_18, 116); + String::push(__local_18, 32); + String::push_str(__local_18, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_18, 58); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; i32::fmt_decimal(269, __local_19); - String::append(__local_18, String { repr: array.new_data(" + String::push_str(__local_18, String { repr: array.new_data(" condition: t as f64 == 1.0 "), used: 28 }); break __tmpl: __local_18; @@ -1562,17 +1562,17 @@ condition: t as f64 == 1.0 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(101), used: 0 }; - String::append(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_20, String { repr: array.new_data("test_bool_casts"), used: 15 }); - String::append_char(__local_20, 32); - String::append_char(__local_20, 97); - String::append_char(__local_20, 116); - String::append_char(__local_20, 32); - String::append(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_20, 58); + String::push_str(__local_20, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_20, String { repr: array.new_data("test_bool_casts"), used: 15 }); + String::push(__local_20, 32); + String::push(__local_20, 97); + String::push(__local_20, 116); + String::push(__local_20, 32); + String::push_str(__local_20, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_20, 58); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; i32::fmt_decimal(270, __local_21); - String::append(__local_20, String { repr: array.new_data(" + String::push_str(__local_20, String { repr: array.new_data(" condition: f as f64 == 0.0 "), used: 28 }); break __tmpl: __local_20; @@ -1584,17 +1584,17 @@ condition: f as f64 == 0.0 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(102), used: 0 }; - String::append(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_22, String { repr: array.new_data("test_bool_casts"), used: 15 }); - String::append_char(__local_22, 32); - String::append_char(__local_22, 97); - String::append_char(__local_22, 116); - String::append_char(__local_22, 32); - String::append(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); - String::append_char(__local_22, 58); + String::push_str(__local_22, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_22, String { repr: array.new_data("test_bool_casts"), used: 15 }); + String::push(__local_22, 32); + String::push(__local_22, 97); + String::push(__local_22, 116); + String::push(__local_22, 32); + String::push_str(__local_22, String { repr: array.new_data("wado-compiler/tests/fixtures/type_cast.wado"), used: 43 }); + String::push(__local_22, 58); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i32::fmt_decimal(274, __local_23); - String::append(__local_22, String { repr: array.new_data(" + String::push_str(__local_22, String { repr: array.new_data(" condition: tf as f64 == 1.0 "), used: 29 }); break __tmpl: __local_22; @@ -2438,8 +2438,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2494,13 +2494,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -2508,25 +2508,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -2534,7 +2534,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -2576,8 +2576,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2609,7 +2609,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -2738,27 +2738,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2881,9 +2881,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2893,8 +2893,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2949,13 +2949,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2990,9 +2990,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -3045,7 +3045,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -3060,7 +3060,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -3098,7 +3098,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l221; }; @@ -3118,7 +3118,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -3126,17 +3126,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3290,20 +3290,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3313,10 +3313,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3326,10 +3326,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3337,10 +3337,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/u64_arithmetic.wir.wado b/wado-compiler/tests/fixtures.golden/u64_arithmetic.wir.wado index 284e49742..0623fb361 100644 --- a/wado-compiler/tests/fixtures.golden/u64_arithmetic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/u64_arithmetic.wir.wado @@ -79,11 +79,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -163,7 +163,7 @@ fn run() with Stdout { if (v >u 0_i64) == 0 { break b0; }; - Array::append(digits, builtin::i32_wrap_i64(v %u 10_i64)); + Array::push(digits, builtin::i32_wrap_i64(v %u 10_i64)); v = v /u 10_i64; continue l1; }; @@ -173,27 +173,27 @@ fn run() with Stdout { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_32, 114); - String::append_char(__local_32, 117); - String::append_char(__local_32, 110); - String::append_char(__local_32, 32); - String::append_char(__local_32, 97); - String::append_char(__local_32, 116); - String::append_char(__local_32, 32); - String::append(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); - String::append_char(__local_32, 58); + String::push_str(__local_32, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_32, 114); + String::push(__local_32, 117); + String::push(__local_32, 110); + String::push(__local_32, 32); + String::push(__local_32, 97); + String::push(__local_32, 116); + String::push(__local_32, 32); + String::push_str(__local_32, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); + String::push(__local_32, 58); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_60 = __local_33; i32::fmt_decimal(17, __local_60); - String::append(__local_32, String { repr: array.new_data(" + String::push_str(__local_32, String { repr: array.new_data(" condition: digits.len() == 5 "), used: 30 }); - String::append(__local_32, String { repr: array.new_data("digits.len(): "), used: 14 }); + String::push_str(__local_32, String { repr: array.new_data("digits.len(): "), used: 14 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; __local_65 = __local_33; i32::fmt_decimal(__v0_4, __local_65); - String::append_char(__local_32, 10); + String::push(__local_32, 10); break __tmpl: __local_32; }); unreachable; @@ -209,27 +209,27 @@ condition: digits.len() == 5 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_34, 114); - String::append_char(__local_34, 117); - String::append_char(__local_34, 110); - String::append_char(__local_34, 32); - String::append_char(__local_34, 97); - String::append_char(__local_34, 116); - String::append_char(__local_34, 32); - String::append(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); - String::append_char(__local_34, 58); + String::push_str(__local_34, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_34, 114); + String::push(__local_34, 117); + String::push(__local_34, 110); + String::push(__local_34, 32); + String::push(__local_34, 97); + String::push(__local_34, 116); + String::push(__local_34, 32); + String::push_str(__local_34, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); + String::push(__local_34, 58); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_73 = __local_35; i32::fmt_decimal(18, __local_73); - String::append(__local_34, String { repr: array.new_data(" + String::push_str(__local_34, String { repr: array.new_data(" condition: digits[0] == 5 "), used: 27 }); - String::append(__local_34, String { repr: array.new_data("digits[0]: "), used: 11 }); + String::push_str(__local_34, String { repr: array.new_data("digits[0]: "), used: 11 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; __local_78 = __local_35; i32::fmt_decimal(__v0_6, __local_78); - String::append_char(__local_34, 10); + String::push(__local_34, 10); break __tmpl: __local_34; }); unreachable; @@ -245,27 +245,27 @@ condition: digits[0] == 5 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_36, 114); - String::append_char(__local_36, 117); - String::append_char(__local_36, 110); - String::append_char(__local_36, 32); - String::append_char(__local_36, 97); - String::append_char(__local_36, 116); - String::append_char(__local_36, 32); - String::append(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); - String::append_char(__local_36, 58); + String::push_str(__local_36, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_36, 114); + String::push(__local_36, 117); + String::push(__local_36, 110); + String::push(__local_36, 32); + String::push(__local_36, 97); + String::push(__local_36, 116); + String::push(__local_36, 32); + String::push_str(__local_36, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); + String::push(__local_36, 58); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_86 = __local_37; i32::fmt_decimal(19, __local_86); - String::append(__local_36, String { repr: array.new_data(" + String::push_str(__local_36, String { repr: array.new_data(" condition: digits[1] == 4 "), used: 27 }); - String::append(__local_36, String { repr: array.new_data("digits[1]: "), used: 11 }); + String::push_str(__local_36, String { repr: array.new_data("digits[1]: "), used: 11 }); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; __local_91 = __local_37; i32::fmt_decimal(__v0_8, __local_91); - String::append_char(__local_36, 10); + String::push(__local_36, 10); break __tmpl: __local_36; }); unreachable; @@ -281,27 +281,27 @@ condition: digits[1] == 4 if __cond_11 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_38, 114); - String::append_char(__local_38, 117); - String::append_char(__local_38, 110); - String::append_char(__local_38, 32); - String::append_char(__local_38, 97); - String::append_char(__local_38, 116); - String::append_char(__local_38, 32); - String::append(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); - String::append_char(__local_38, 58); + String::push_str(__local_38, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_38, 114); + String::push(__local_38, 117); + String::push(__local_38, 110); + String::push(__local_38, 32); + String::push(__local_38, 97); + String::push(__local_38, 116); + String::push(__local_38, 32); + String::push_str(__local_38, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); + String::push(__local_38, 58); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_99 = __local_39; i32::fmt_decimal(20, __local_99); - String::append(__local_38, String { repr: array.new_data(" + String::push_str(__local_38, String { repr: array.new_data(" condition: digits[2] == 3 "), used: 27 }); - String::append(__local_38, String { repr: array.new_data("digits[2]: "), used: 11 }); + String::push_str(__local_38, String { repr: array.new_data("digits[2]: "), used: 11 }); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; __local_104 = __local_39; i32::fmt_decimal(__v0_10, __local_104); - String::append_char(__local_38, 10); + String::push(__local_38, 10); break __tmpl: __local_38; }); unreachable; @@ -317,27 +317,27 @@ condition: digits[2] == 3 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_40, 114); - String::append_char(__local_40, 117); - String::append_char(__local_40, 110); - String::append_char(__local_40, 32); - String::append_char(__local_40, 97); - String::append_char(__local_40, 116); - String::append_char(__local_40, 32); - String::append(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); - String::append_char(__local_40, 58); + String::push_str(__local_40, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_40, 114); + String::push(__local_40, 117); + String::push(__local_40, 110); + String::push(__local_40, 32); + String::push(__local_40, 97); + String::push(__local_40, 116); + String::push(__local_40, 32); + String::push_str(__local_40, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); + String::push(__local_40, 58); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_112 = __local_41; i32::fmt_decimal(21, __local_112); - String::append(__local_40, String { repr: array.new_data(" + String::push_str(__local_40, String { repr: array.new_data(" condition: digits[3] == 2 "), used: 27 }); - String::append(__local_40, String { repr: array.new_data("digits[3]: "), used: 11 }); + String::push_str(__local_40, String { repr: array.new_data("digits[3]: "), used: 11 }); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; __local_117 = __local_41; i32::fmt_decimal(__v0_12, __local_117); - String::append_char(__local_40, 10); + String::push(__local_40, 10); break __tmpl: __local_40; }); unreachable; @@ -353,27 +353,27 @@ condition: digits[3] == 2 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_42, 114); - String::append_char(__local_42, 117); - String::append_char(__local_42, 110); - String::append_char(__local_42, 32); - String::append_char(__local_42, 97); - String::append_char(__local_42, 116); - String::append_char(__local_42, 32); - String::append(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); - String::append_char(__local_42, 58); + String::push_str(__local_42, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_42, 114); + String::push(__local_42, 117); + String::push(__local_42, 110); + String::push(__local_42, 32); + String::push(__local_42, 97); + String::push(__local_42, 116); + String::push(__local_42, 32); + String::push_str(__local_42, String { repr: array.new_data("wado-compiler/tests/fixtures/u64_arithmetic.wado"), used: 48 }); + String::push(__local_42, 58); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_125 = __local_43; i32::fmt_decimal(22, __local_125); - String::append(__local_42, String { repr: array.new_data(" + String::push_str(__local_42, String { repr: array.new_data(" condition: digits[4] == 1 "), used: 27 }); - String::append(__local_42, String { repr: array.new_data("digits[4]: "), used: 11 }); + String::push_str(__local_42, String { repr: array.new_data("digits[4]: "), used: 11 }); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; __local_130 = __local_43; i32::fmt_decimal(__v0_14, __local_130); - String::append_char(__local_42, 10); + String::push(__local_42, 10); break __tmpl: __local_42; }); unreachable; @@ -613,7 +613,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -628,7 +628,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -655,7 +655,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -708,7 +708,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l42; }; @@ -742,20 +742,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -765,10 +765,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -778,10 +778,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -789,10 +789,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/unary_neg_float.wir.wado b/wado-compiler/tests/fixtures.golden/unary_neg_float.wir.wado index 495ba654a..5fde230cd 100644 --- a/wado-compiler/tests/fixtures.golden/unary_neg_float.wir.wado +++ b/wado-compiler/tests/fixtures.golden/unary_neg_float.wir.wado @@ -91,7 +91,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -99,7 +99,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -160,21 +160,21 @@ fn run() with Stdout { }; "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(20), used: 0 }; - String::append(__local_3, String { repr: array.new_data("x = "), used: 4 }); + String::push_str(__local_3, String { repr: array.new_data("x = "), used: 4 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; f64::fmt_into(-2.5, __local_4); break __tmpl: __local_3; }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(20), used: 0 }; - String::append(__local_5, String { repr: array.new_data("y = "), used: 4 }); + String::push_str(__local_5, String { repr: array.new_data("y = "), used: 4 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; f64::fmt_into(2.5, __local_6); break __tmpl: __local_5; }); "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(20), used: 0 }; - String::append(__local_7, String { repr: array.new_data("z = "), used: 4 }); + String::push_str(__local_7, String { repr: array.new_data("z = "), used: 4 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; f64::fmt_into(-6, __local_8); break __tmpl: __local_7; @@ -942,7 +942,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -997,7 +997,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1029,7 +1029,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1111,25 +1111,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1230,9 +1230,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1286,13 +1286,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1327,9 +1327,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1370,7 +1370,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/user_func.wir.wado b/wado-compiler/tests/fixtures.golden/user_func.wir.wado index 3a694a02f..f63e55d7f 100644 --- a/wado-compiler/tests/fixtures.golden/user_func.wir.wado +++ b/wado-compiler/tests/fixtures.golden/user_func.wir.wado @@ -95,7 +95,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -103,7 +103,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -165,7 +165,7 @@ fn user_func_return_f32() with Stdout { result = (a * b) + builtin::f32_demote_f64(1.5); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_3, String { repr: array.new_data("result = "), used: 9 }); + String::push_str(__local_3, String { repr: array.new_data("result = "), used: 9 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; f32::fmt_into(result, __local_4); break __tmpl: __local_3; @@ -177,7 +177,7 @@ fn user_func_return_f64() with Stdout { let __local_2: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(25), used: 0 }; - String::append(__local_1, String { repr: array.new_data("result = "), used: 9 }); + String::push_str(__local_1, String { repr: array.new_data("result = "), used: 9 }); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; f64::fmt_into(7.5, __local_2); break __tmpl: __local_1; @@ -1094,7 +1094,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1149,7 +1149,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1181,7 +1181,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1263,25 +1263,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1384,9 +1384,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1451,9 +1451,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1507,13 +1507,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1548,9 +1548,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1591,7 +1591,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/value_copy_iterator_fresh_elision.wir.wado b/wado-compiler/tests/fixtures.golden/value_copy_iterator_fresh_elision.wir.wado index 009fe125d..e87ee8528 100644 --- a/wado-compiler/tests/fixtures.golden/value_copy_iterator_fresh_elision.wir.wado +++ b/wado-compiler/tests/fixtures.golden/value_copy_iterator_fresh_elision.wir.wado @@ -82,13 +82,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/ArrayIter^Iterator::next" = fn(ref "core:allocator/ArrayIter") -> ref null Point; -type "functype/Array::append" = fn(ref Array, ref Point); +type "functype/Array::push" = fn(ref Array, ref Point); type "functype/Array::grow" = fn(ref Array); @@ -146,7 +146,7 @@ fn run() with Stdout { __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_21 = __local_6; i32::fmt_decimal(x, __local_21); - String::append_char(__local_5, 32); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_26 = __local_6; i32::fmt_decimal(y, __local_26); @@ -355,7 +355,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -370,7 +370,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -407,7 +407,7 @@ fn ArrayIter^Iterator::next(self) { return item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -460,7 +460,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -494,20 +494,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -517,10 +517,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -530,10 +530,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -541,10 +541,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/value_semantics.wir.wado b/wado-compiler/tests/fixtures.golden/value_semantics.wir.wado index 19cafb7d2..1d49be8ec 100644 --- a/wado-compiler/tests/fixtures.golden/value_semantics.wir.wado +++ b/wado-compiler/tests/fixtures.golden/value_semantics.wir.wado @@ -97,11 +97,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -151,11 +151,11 @@ fn value_semantics_array() with Stdout { builtin::array_set(b.repr, 0, 99); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_3, 97); - String::append_char(__local_3, 91); - String::append_char(__local_3, 48); - String::append_char(__local_3, 93); - String::append_char(__local_3, 61); + String::push(__local_3, 97); + String::push(__local_3, 91); + String::push(__local_3, 48); + String::push(__local_3, 93); + String::push(__local_3, 61); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_10: block -> i32 { if 0 >= a.used { @@ -168,11 +168,11 @@ fn value_semantics_array() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_5, 98); - String::append_char(__local_5, 91); - String::append_char(__local_5, 48); - String::append_char(__local_5, 93); - String::append_char(__local_5, 61); + String::push(__local_5, 98); + String::push(__local_5, 91); + String::push(__local_5, 48); + String::push(__local_5, 93); + String::push(__local_5, 61); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(__inline_Array_i32__IndexValue__index_value_15: block -> i32 { if 0 >= b.used { @@ -192,16 +192,16 @@ fn value_semantics_string() with Stdout { a = String { repr: array.new_data("hello"), used: 5 }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_2, 97); - String::append_char(__local_2, 61); - String::append(__local_2, a); + String::push(__local_2, 97); + String::push(__local_2, 61); + String::push_str(__local_2, a); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(18), used: 0 }; - String::append_char(__local_3, 98); - String::append_char(__local_3, 61); - String::append(__local_3, a); + String::push(__local_3, 98); + String::push(__local_3, 61); + String::push_str(__local_3, a); break __tmpl: __local_3; }); } @@ -218,20 +218,20 @@ fn value_semantics_struct() with Stdout { b.x = 99; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_2, 97); - String::append_char(__local_2, 46); - String::append_char(__local_2, 120); - String::append_char(__local_2, 61); + String::push(__local_2, 97); + String::push(__local_2, 46); + String::push(__local_2, 120); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(a.x, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_4, 98); - String::append_char(__local_4, 46); - String::append_char(__local_4, 120); - String::append_char(__local_4, 61); + String::push(__local_4, 98); + String::push(__local_4, 46); + String::push(__local_4, 120); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(b.x, __local_5); break __tmpl: __local_4; @@ -250,20 +250,20 @@ fn value_semantics_tuple() with Stdout { b.0 = 99; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_2, 97); - String::append_char(__local_2, 46); - String::append_char(__local_2, 48); - String::append_char(__local_2, 61); + String::push(__local_2, 97); + String::push(__local_2, 46); + String::push(__local_2, 48); + String::push(__local_2, 61); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(a.0, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_4, 98); - String::append_char(__local_4, 46); - String::append_char(__local_4, 48); - String::append_char(__local_4, 61); + String::push(__local_4, 98); + String::push(__local_4, 46); + String::push(__local_4, 48); + String::push(__local_4, 61); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(b.0, __local_5); break __tmpl: __local_4; @@ -512,7 +512,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -527,7 +527,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -554,7 +554,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -607,7 +607,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l31; }; @@ -641,20 +641,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -664,10 +664,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -677,10 +677,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -688,10 +688,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/var_uninit_valid.wir.wado b/wado-compiler/tests/fixtures.golden/var_uninit_valid.wir.wado index 24a31227d..60c61e905 100644 --- a/wado-compiler/tests/fixtures.golden/var_uninit_valid.wir.wado +++ b/wado-compiler/tests/fixtures.golden/var_uninit_valid.wir.wado @@ -115,7 +115,7 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -123,9 +123,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -207,27 +207,27 @@ fn __test_2_match_all_arms_assign() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_2_match_all_arms_assign"), used: 30 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/var_uninit_valid.wado"), used: 50 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_2_match_all_arms_assign"), used: 30 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/var_uninit_valid.wado"), used: 50 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_10 = __local_6; i32::fmt_decimal(32, __local_10); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: x == 10 "), used: 20 }); - String::append_char(__local_5, 120); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 120); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_15 = __local_6; i32::fmt_decimal(__v0, __local_15); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -287,27 +287,27 @@ fn __test_5_assign_before_loop__use_inside_loop() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_5_assign_before_loop__use_inside_loop"), used: 44 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/var_uninit_valid.wado"), used: 50 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_5_assign_before_loop__use_inside_loop"), used: 44 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/var_uninit_valid.wado"), used: 50 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_9 = __local_5; i32::fmt_decimal(70, __local_9); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: x == 3 "), used: 19 }); - String::append_char(__local_4, 120); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 120); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_14 = __local_5; i32::fmt_decimal(__v0, __local_14); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -353,25 +353,25 @@ fn __test_8_string_uninit_then_assign() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_8_string_uninit_then_assign"), used: 34 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/var_uninit_valid.wado"), used: 50 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_8_string_uninit_then_assign"), used: 34 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/var_uninit_valid.wado"), used: 50 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(95, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: s.len() == 5 "), used: 25 }); - String::append(__local_3, String { repr: array.new_data("s.len(): "), used: 9 }); + String::push_str(__local_3, String { repr: array.new_data("s.len(): "), used: 9 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; i32::fmt_decimal(__v0, __local_14); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -397,25 +397,25 @@ fn __test_9_string_uninit_assigned_in_if_else() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_4, String { repr: array.new_data("__test_9_string_uninit_assigned_in_if_else"), used: 42 }); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/var_uninit_valid.wado"), used: 50 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_4, String { repr: array.new_data("__test_9_string_uninit_assigned_in_if_else"), used: 42 }); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/var_uninit_valid.wado"), used: 50 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(107, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: greeting.len() == 3 "), used: 32 }); - String::append(__local_4, String { repr: array.new_data("greeting.len(): "), used: 16 }); + String::push_str(__local_4, String { repr: array.new_data("greeting.len(): "), used: 16 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(__v0, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -648,7 +648,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -744,7 +744,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -759,7 +759,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -797,7 +797,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l52; }; @@ -831,20 +831,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -854,10 +854,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -867,10 +867,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -878,10 +878,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/variadic_1.wir.wado b/wado-compiler/tests/fixtures.golden/variadic_1.wir.wado index 8217e223f..875d6e260 100644 --- a/wado-compiler/tests/fixtures.golden/variadic_1.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variadic_1.wir.wado @@ -172,15 +172,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); @@ -244,29 +244,29 @@ fn __test_0_identity_mixed_types() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_0_identity_mixed_types"), used: 29 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_0_identity_mixed_types"), used: 29 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_18 = __local_8; i32::fmt_decimal(8, __local_18); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: a.0 == 1 "), used: 21 }); - String::append_char(__local_7, 97); - String::append_char(__local_7, 46); - String::append_char(__local_7, 48); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 46); + String::push(__local_7, 48); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_23 = __local_8; i32::fmt_decimal(__v0_1, __local_23); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -276,28 +276,28 @@ condition: a.0 == 1 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_0_identity_mixed_types"), used: 29 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_0_identity_mixed_types"), used: 29 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_29 = __local_10; i32::fmt_decimal(9, __local_29); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: a.1 == \"hello\" "), used: 27 }); - String::append_char(__local_9, 97); - String::append_char(__local_9, 46); - String::append_char(__local_9, 49); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 46); + String::push(__local_9, 49); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0_3, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -307,25 +307,25 @@ condition: a.1 == \"hello\" if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_0_identity_mixed_types"), used: 29 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_0_identity_mixed_types"), used: 29 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_36 = __local_12; i32::fmt_decimal(10, __local_36); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: a.2 == true "), used: 24 }); - String::append_char(__local_11, 97); - String::append_char(__local_11, 46); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 46); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_41 = __local_12; Formatter::pad(__local_41, if __v0_5 -> ref String { @@ -333,7 +333,7 @@ condition: a.2 == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -357,29 +357,29 @@ fn __test_1_identity_single_element() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_1_identity_single_element"), used: 32 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_1_identity_single_element"), used: 32 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_10 = __local_4; i32::fmt_decimal(15, __local_10); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: b.0 == 42 "), used: 22 }); - String::append_char(__local_3, 98); - String::append_char(__local_3, 46); - String::append_char(__local_3, 48); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 98); + String::push(__local_3, 46); + String::push(__local_3, 48); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_15 = __local_4; i32::fmt_decimal(__v0, __local_15); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -415,29 +415,29 @@ fn __test_2_identity_homogeneous() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_2_identity_homogeneous"), used: 29 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_2_identity_homogeneous"), used: 29 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_18 = __local_8; i32::fmt_decimal(20, __local_18); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: c.0 == 1 "), used: 21 }); - String::append_char(__local_7, 99); - String::append_char(__local_7, 46); - String::append_char(__local_7, 48); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 99); + String::push(__local_7, 46); + String::push(__local_7, 48); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_23 = __local_8; i32::fmt_decimal(__v0_1, __local_23); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -447,29 +447,29 @@ condition: c.0 == 1 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_2_identity_homogeneous"), used: 29 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_2_identity_homogeneous"), used: 29 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_29 = __local_10; i32::fmt_decimal(21, __local_29); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: c.1 == 2 "), used: 21 }); - String::append_char(__local_9, 99); - String::append_char(__local_9, 46); - String::append_char(__local_9, 49); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 99); + String::push(__local_9, 46); + String::push(__local_9, 49); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_34 = __local_10; i32::fmt_decimal(__v0_3, __local_34); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -479,29 +479,29 @@ condition: c.1 == 2 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_2_identity_homogeneous"), used: 29 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_2_identity_homogeneous"), used: 29 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_40 = __local_12; i32::fmt_decimal(22, __local_40); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: c.2 == 3 "), used: 21 }); - String::append_char(__local_11, 99); - String::append_char(__local_11, 46); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 99); + String::push(__local_11, 46); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_45 = __local_12; i32::fmt_decimal(__v0_5, __local_45); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -539,24 +539,24 @@ fn __test_3_append_to_pack() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_3_append_to_pack"), used: 23 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_3_append_to_pack"), used: 23 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_19 = __local_8; i32::fmt_decimal(32, __local_19); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: result.0 == \"hello\" "), used: 32 }); - String::append(__local_7, String { repr: array.new_data("result.0: "), used: 10 }); + String::push_str(__local_7, String { repr: array.new_data("result.0: "), used: 10 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0_1, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -566,21 +566,21 @@ condition: result.0 == \"hello\" if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_3_append_to_pack"), used: 23 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_3_append_to_pack"), used: 23 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_26 = __local_10; i32::fmt_decimal(33, __local_26); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: result.1 == true "), used: 29 }); - String::append(__local_9, String { repr: array.new_data("result.1: "), used: 10 }); + String::push_str(__local_9, String { repr: array.new_data("result.1: "), used: 10 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_31 = __local_10; Formatter::pad(__local_31, if __v0_3 -> ref String { @@ -588,7 +588,7 @@ condition: result.1 == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -598,25 +598,25 @@ condition: result.1 == true if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_3_append_to_pack"), used: 23 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_3_append_to_pack"), used: 23 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_37 = __local_12; i32::fmt_decimal(34, __local_37); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: result.2 == 42 "), used: 27 }); - String::append(__local_11, String { repr: array.new_data("result.2: "), used: 10 }); + String::push_str(__local_11, String { repr: array.new_data("result.2: "), used: 10 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_42 = __local_12; i32::fmt_decimal(__v0_5, __local_42); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -648,25 +648,25 @@ fn __test_4_append_single_element_pack() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_4_append_single_element_pack"), used: 35 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_4_append_single_element_pack"), used: 35 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_15 = __local_6; i32::fmt_decimal(39, __local_15); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: single.0 == 1 "), used: 26 }); - String::append(__local_5, String { repr: array.new_data("single.0: "), used: 10 }); + String::push_str(__local_5, String { repr: array.new_data("single.0: "), used: 10 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_20 = __local_6; i32::fmt_decimal(__v0_1, __local_20); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -676,24 +676,24 @@ condition: single.0 == 1 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_4_append_single_element_pack"), used: 35 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_4_append_single_element_pack"), used: 35 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_26 = __local_8; i32::fmt_decimal(40, __local_26); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: single.1 == \"end\" "), used: 30 }); - String::append(__local_7, String { repr: array.new_data("single.1: "), used: 10 }); + String::push_str(__local_7, String { repr: array.new_data("single.1: "), used: 10 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0_3, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -714,28 +714,28 @@ fn __test_5_wrap_in_option() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_5_wrap_in_option"), used: 23 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_5_wrap_in_option"), used: 23 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_27 = __local_9; i32::fmt_decimal(52, __local_27); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: t.1 == \"hello\" "), used: 27 }); - String::append_char(__local_8, 116); - String::append_char(__local_8, 46); - String::append_char(__local_8, 49); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 116); + String::push(__local_8, 46); + String::push(__local_8, 49); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -775,25 +775,25 @@ fn __test_6_prepend_mixed_params() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_6_prepend_mixed_params"), used: 29 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_6_prepend_mixed_params"), used: 29 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_19 = __local_8; i32::fmt_decimal(63, __local_19); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: result.0 == 42 "), used: 27 }); - String::append(__local_7, String { repr: array.new_data("result.0: "), used: 10 }); + String::push_str(__local_7, String { repr: array.new_data("result.0: "), used: 10 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_24 = __local_8; i32::fmt_decimal(__v0_1, __local_24); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -803,24 +803,24 @@ condition: result.0 == 42 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_6_prepend_mixed_params"), used: 29 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_6_prepend_mixed_params"), used: 29 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_30 = __local_10; i32::fmt_decimal(64, __local_30); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: result.1 == \"hello\" "), used: 32 }); - String::append(__local_9, String { repr: array.new_data("result.1: "), used: 10 }); + String::push_str(__local_9, String { repr: array.new_data("result.1: "), used: 10 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0_3, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -830,21 +830,21 @@ condition: result.1 == \"hello\" if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_6_prepend_mixed_params"), used: 29 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_6_prepend_mixed_params"), used: 29 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_37 = __local_12; i32::fmt_decimal(65, __local_37); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: result.2 == true "), used: 29 }); - String::append(__local_11, String { repr: array.new_data("result.2: "), used: 10 }); + String::push_str(__local_11, String { repr: array.new_data("result.2: "), used: 10 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_42 = __local_12; Formatter::pad(__local_42, if __v0_5 -> ref String { @@ -852,7 +852,7 @@ condition: result.2 == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -907,25 +907,25 @@ fn __test_9_surround_with_middle() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_9_surround_with_middle"), used: 29 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_9_surround_with_middle"), used: 29 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_24 = __local_10; i32::fmt_decimal(85, __local_24); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: result.0 == 1 "), used: 26 }); - String::append(__local_9, String { repr: array.new_data("result.0: "), used: 10 }); + String::push_str(__local_9, String { repr: array.new_data("result.0: "), used: 10 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_29 = __local_10; i32::fmt_decimal(__v0_1, __local_29); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -935,24 +935,24 @@ condition: result.0 == 1 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_9_surround_with_middle"), used: 29 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_9_surround_with_middle"), used: 29 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_35 = __local_12; i32::fmt_decimal(86, __local_35); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: result.1 == \"hello\" "), used: 32 }); - String::append(__local_11, String { repr: array.new_data("result.1: "), used: 10 }); + String::push_str(__local_11, String { repr: array.new_data("result.1: "), used: 10 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; String^Inspect::inspect(__v0_3, __local_12); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -962,21 +962,21 @@ condition: result.1 == \"hello\" if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_9_surround_with_middle"), used: 29 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_9_surround_with_middle"), used: 29 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_42 = __local_14; i32::fmt_decimal(87, __local_42); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: result.2 == true "), used: 29 }); - String::append(__local_13, String { repr: array.new_data("result.2: "), used: 10 }); + String::push_str(__local_13, String { repr: array.new_data("result.2: "), used: 10 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_47 = __local_14; Formatter::pad(__local_47, if __v0_5 -> ref String { @@ -984,7 +984,7 @@ condition: result.2 == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -994,25 +994,25 @@ condition: result.2 == true if __cond_8 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_15, String { repr: array.new_data("__test_9_surround_with_middle"), used: 29 }); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_15, String { repr: array.new_data("__test_9_surround_with_middle"), used: 29 }); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_53 = __local_16; i32::fmt_decimal(88, __local_53); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: result.3 == 99 "), used: 27 }); - String::append(__local_15, String { repr: array.new_data("result.3: "), used: 10 }); + String::push_str(__local_15, String { repr: array.new_data("result.3: "), used: 10 }); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_58 = __local_16; i32::fmt_decimal(__v0_7, __local_58); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -1043,24 +1043,24 @@ fn __test_10_surround_empty_middle() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(138), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_10_surround_empty_middle"), used: 31 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_10_surround_empty_middle"), used: 31 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_16 = __local_6; i32::fmt_decimal(93, __local_16); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: empty_mid.0 == \"start\" "), used: 35 }); - String::append(__local_5, String { repr: array.new_data("empty_mid.0: "), used: 13 }); + String::push_str(__local_5, String { repr: array.new_data("empty_mid.0: "), used: 13 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0_1, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -1070,24 +1070,24 @@ condition: empty_mid.0 == \"start\" if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_10_surround_empty_middle"), used: 31 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_10_surround_empty_middle"), used: 31 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_23 = __local_8; i32::fmt_decimal(94, __local_23); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: empty_mid.1 == \"end\" "), used: 33 }); - String::append(__local_7, String { repr: array.new_data("empty_mid.1: "), used: 13 }); + String::push_str(__local_7, String { repr: array.new_data("empty_mid.1: "), used: 13 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0_3, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -1127,29 +1127,29 @@ fn __test_12_nested_call() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_12_nested_call"), used: 21 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_12_nested_call"), used: 21 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_19 = __local_8; i32::fmt_decimal(124, __local_19); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: a.0 == 1 "), used: 21 }); - String::append_char(__local_7, 97); - String::append_char(__local_7, 46); - String::append_char(__local_7, 48); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 46); + String::push(__local_7, 48); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_24 = __local_8; i32::fmt_decimal(__v0_1, __local_24); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -1159,28 +1159,28 @@ condition: a.0 == 1 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_12_nested_call"), used: 21 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_12_nested_call"), used: 21 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_30 = __local_10; i32::fmt_decimal(125, __local_30); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: a.1 == \"hello\" "), used: 27 }); - String::append_char(__local_9, 97); - String::append_char(__local_9, 46); - String::append_char(__local_9, 49); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 46); + String::push(__local_9, 49); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0_3, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1190,25 +1190,25 @@ condition: a.1 == \"hello\" if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_12_nested_call"), used: 21 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_12_nested_call"), used: 21 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_37 = __local_12; i32::fmt_decimal(126, __local_37); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: a.2 == true "), used: 24 }); - String::append_char(__local_11, 97); - String::append_char(__local_11, 46); - String::append_char(__local_11, 50); - String::append_char(__local_11, 58); - String::append_char(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 46); + String::push(__local_11, 50); + String::push(__local_11, 58); + String::push(__local_11, 32); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_42 = __local_12; Formatter::pad(__local_42, if __v0_5 -> ref String { @@ -1216,7 +1216,7 @@ condition: a.2 == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -1240,29 +1240,29 @@ fn __test_13_nested_call_single() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_13_nested_call_single"), used: 28 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_13_nested_call_single"), used: 28 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_11 = __local_4; i32::fmt_decimal(131, __local_11); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: b.0 == 42 "), used: 22 }); - String::append_char(__local_3, 98); - String::append_char(__local_3, 46); - String::append_char(__local_3, 48); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 98); + String::push(__local_3, 46); + String::push(__local_3, 48); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_16 = __local_4; i32::fmt_decimal(__v0, __local_16); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -1376,21 +1376,21 @@ fn collect_for_of>(items) { }; __tuple_3 = items; item_19 = __tuple_3.0; - Array::append(result, __tmpl: block -> ref String { + Array::push(result, __tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(16), used: 0 }; __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(item_19, __local_11); break __tmpl: __local_10; }); item_20 = __tuple_3.1; - Array::append(result, __tmpl: block -> ref String { + Array::push(result, __tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(16), used: 0 }; __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; Formatter::pad(__local_22, item_20); break __tmpl: __local_21; }); item_23 = __tuple_3.2; - Array::append(result, __tmpl: block -> ref String { + Array::push(result, __tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(16), used: 0 }; __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; Formatter::pad(__local_25, if item_23 -> ref String { @@ -1411,24 +1411,24 @@ fn collect_for_of>(items) { if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("collect_for_of"), used: 14 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("collect_for_of"), used: 14 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_50 = __local_13; i32::fmt_decimal(103, __local_50); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: result[0] == \"1\" "), used: 29 }); - String::append(__local_12, String { repr: array.new_data("result[0]: "), used: 11 }); + String::push_str(__local_12, String { repr: array.new_data("result[0]: "), used: 11 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0_4, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -1444,24 +1444,24 @@ condition: result[0] == \"1\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(134), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("collect_for_of"), used: 14 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("collect_for_of"), used: 14 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_59 = __local_15; i32::fmt_decimal(104, __local_59); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: result[1] == \"hello\" "), used: 33 }); - String::append(__local_14, String { repr: array.new_data("result[1]: "), used: 11 }); + String::push_str(__local_14, String { repr: array.new_data("result[1]: "), used: 11 }); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; String^Inspect::inspect(__v0_6, __local_15); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -1477,24 +1477,24 @@ condition: result[1] == \"hello\" if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_16 = String { repr: builtin::array_new(133), used: 0 }; - String::append(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_16, String { repr: array.new_data("collect_for_of"), used: 14 }); - String::append_char(__local_16, 32); - String::append_char(__local_16, 97); - String::append_char(__local_16, 116); - String::append_char(__local_16, 32); - String::append(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); - String::append_char(__local_16, 58); + String::push_str(__local_16, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_16, String { repr: array.new_data("collect_for_of"), used: 14 }); + String::push(__local_16, 32); + String::push(__local_16, 97); + String::push(__local_16, 116); + String::push(__local_16, 32); + String::push_str(__local_16, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_1.wado"), used: 44 }); + String::push(__local_16, 58); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; __local_68 = __local_17; i32::fmt_decimal(105, __local_68); - String::append(__local_16, String { repr: array.new_data(" + String::push_str(__local_16, String { repr: array.new_data(" condition: result[2] == \"true\" "), used: 32 }); - String::append(__local_16, String { repr: array.new_data("result[2]: "), used: 11 }); + String::push_str(__local_16, String { repr: array.new_data("result[2]: "), used: 11 }); __local_17 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_16 }; String^Inspect::inspect(__v0_8, __local_17); - String::append_char(__local_16, 10); + String::push(__local_16, 10); break __tmpl: __local_16; }); unreachable; @@ -1693,7 +1693,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1781,7 +1781,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1808,7 +1808,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1861,7 +1861,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l74; }; @@ -1881,7 +1881,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1889,17 +1889,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1929,20 +1929,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1952,10 +1952,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1965,10 +1965,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1976,10 +1976,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1991,7 +1991,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -2008,22 +2008,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b97; @@ -2031,7 +2031,7 @@ fn String^Inspect::inspect(self, f) { continue l98; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_identity_mixed_types as "__test_0_identity_mixed_types" diff --git a/wado-compiler/tests/fixtures.golden/variadic_2.wir.wado b/wado-compiler/tests/fixtures.golden/variadic_2.wir.wado index ae11be0a2..cb5ce7e10 100644 --- a/wado-compiler/tests/fixtures.golden/variadic_2.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variadic_2.wir.wado @@ -118,7 +118,7 @@ type "functype/count_digits_i64" = fn(i64) -> i32; type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -126,13 +126,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -188,28 +188,28 @@ fn __test_0_spread_append() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_0_spread_append"), used: 22 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_0_spread_append"), used: 22 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_28 = __local_11; i32::fmt_decimal(6, __local_28); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: b.1 == \"hello\" "), used: 27 }); - String::append_char(__local_10, 98); - String::append_char(__local_10, 46); - String::append_char(__local_10, 49); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 98); + String::push(__local_10, 46); + String::push(__local_10, 49); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -238,28 +238,28 @@ fn __test_1_spread_prepend() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_1_spread_prepend"), used: 23 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_1_spread_prepend"), used: 23 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_39 = __local_13; i32::fmt_decimal(15, __local_39); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: c.2 == \"hello\" "), used: 27 }); - String::append_char(__local_12, 99); - String::append_char(__local_12, 46); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 99); + String::push(__local_12, 46); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -328,29 +328,29 @@ fn __test_2_spread_eval_once() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_17, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_17, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_34 = __local_18; i32::fmt_decimal(32, __local_34); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: a.0 == 10 "), used: 22 }); - String::append_char(__local_17, 97); - String::append_char(__local_17, 46); - String::append_char(__local_17, 48); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 46); + String::push(__local_17, 48); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_39 = __local_18; i32::fmt_decimal(__v0_2, __local_39); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -360,29 +360,29 @@ condition: a.0 == 10 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_19, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_19, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_45 = __local_20; i32::fmt_decimal(33, __local_45); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: a.1 == 20 "), used: 22 }); - String::append_char(__local_19, 97); - String::append_char(__local_19, 46); - String::append_char(__local_19, 49); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 46); + String::push(__local_19, 49); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_50 = __local_20; i32::fmt_decimal(__v0_4, __local_50); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -392,28 +392,28 @@ condition: a.1 == 20 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_21, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_21, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_56 = __local_22; i32::fmt_decimal(34, __local_56); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("make_pair() should be called exactly once for concrete spread"), used: 61 }); - String::append(__local_21, String { repr: array.new_data(" + String::push(__local_21, 58); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("make_pair() should be called exactly once for concrete spread"), used: 61 }); + String::push_str(__local_21, String { repr: array.new_data(" condition: call_count == 1 "), used: 28 }); - String::append(__local_21, String { repr: array.new_data("call_count: "), used: 12 }); + String::push_str(__local_21, String { repr: array.new_data("call_count: "), used: 12 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_61 = __local_22; i32::fmt_decimal(__v0_6, __local_61); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -430,29 +430,29 @@ condition: call_count == 1 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_69 = __local_24; i32::fmt_decimal(37, __local_69); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: b.0 == 99 "), used: 22 }); - String::append_char(__local_23, 98); - String::append_char(__local_23, 46); - String::append_char(__local_23, 48); - String::append_char(__local_23, 58); - String::append_char(__local_23, 32); + String::push(__local_23, 98); + String::push(__local_23, 46); + String::push(__local_23, 48); + String::push(__local_23, 58); + String::push(__local_23, 32); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_74 = __local_24; i32::fmt_decimal(__v0_9, __local_74); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -462,29 +462,29 @@ condition: b.0 == 99 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_80 = __local_26; i32::fmt_decimal(38, __local_80); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: b.1 == 10 "), used: 22 }); - String::append_char(__local_25, 98); - String::append_char(__local_25, 46); - String::append_char(__local_25, 49); - String::append_char(__local_25, 58); - String::append_char(__local_25, 32); + String::push(__local_25, 98); + String::push(__local_25, 46); + String::push(__local_25, 49); + String::push(__local_25, 58); + String::push(__local_25, 32); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_85 = __local_26; i32::fmt_decimal(__v0_11, __local_85); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -494,29 +494,29 @@ condition: b.1 == 10 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_91 = __local_28; i32::fmt_decimal(39, __local_91); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: b.2 == 20 "), used: 22 }); - String::append_char(__local_27, 98); - String::append_char(__local_27, 46); - String::append_char(__local_27, 50); - String::append_char(__local_27, 58); - String::append_char(__local_27, 32); + String::push(__local_27, 98); + String::push(__local_27, 46); + String::push(__local_27, 50); + String::push(__local_27, 58); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_96 = __local_28; i32::fmt_decimal(__v0_13, __local_96); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -526,28 +526,28 @@ condition: b.2 == 20 if __cond_16 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(148), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_29, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_29, String { repr: array.new_data("__test_2_spread_eval_once"), used: 25 }); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_102 = __local_30; i32::fmt_decimal(40, __local_102); - String::append_char(__local_29, 58); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("make_pair() should be called exactly once for variadic spread"), used: 61 }); - String::append(__local_29, String { repr: array.new_data(" + String::push(__local_29, 58); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("make_pair() should be called exactly once for variadic spread"), used: 61 }); + String::push_str(__local_29, String { repr: array.new_data(" condition: call_count == 2 "), used: 28 }); - String::append(__local_29, String { repr: array.new_data("call_count: "), used: 12 }); + String::push_str(__local_29, String { repr: array.new_data("call_count: "), used: 12 }); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_107 = __local_30; i32::fmt_decimal(__v0_15, __local_107); - String::append_char(__local_29, 10); + String::push(__local_29, 10); break __tmpl: __local_29; }); unreachable; @@ -576,28 +576,28 @@ fn __test_3_spread_multiple_sources() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_3_spread_multiple_sources"), used: 32 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_3_spread_multiple_sources"), used: 32 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_33 = __local_14; i32::fmt_decimal(49, __local_33); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: c.1 == \"hello\" "), used: 27 }); - String::append_char(__local_13, 99); - String::append_char(__local_13, 46); - String::append_char(__local_13, 49); - String::append_char(__local_13, 58); - String::append_char(__local_13, 32); + String::push(__local_13, 99); + String::push(__local_13, 46); + String::push(__local_13, 49); + String::push(__local_13, 58); + String::push(__local_13, 32); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; String^Inspect::inspect(__v0, __local_14); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -626,28 +626,28 @@ fn __test_4_spread_with_literal_elements_mixed() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_14, String { repr: array.new_data("__test_4_spread_with_literal_elements_mixed"), used: 43 }); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_14, String { repr: array.new_data("__test_4_spread_with_literal_elements_mixed"), used: 43 }); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_43 = __local_15; i32::fmt_decimal(59, __local_43); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: d.2 == \"hello\" "), used: 27 }); - String::append_char(__local_14, 100); - String::append_char(__local_14, 46); - String::append_char(__local_14, 50); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 100); + String::push(__local_14, 46); + String::push(__local_14, 50); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; String^Inspect::inspect(__v0, __local_15); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -690,25 +690,25 @@ fn __test_5_spread_vs_field_access() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_5_spread_vs_field_access"), used: 31 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_5_spread_vs_field_access"), used: 31 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_14 = __local_6; i32::fmt_decimal(70, __local_14); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: result.0 == 10 "), used: 27 }); - String::append(__local_5, String { repr: array.new_data("result.0: "), used: 10 }); + String::push_str(__local_5, String { repr: array.new_data("result.0: "), used: 10 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_19 = __local_6; i32::fmt_decimal(__v0_1, __local_19); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -718,25 +718,25 @@ condition: result.0 == 10 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_5_spread_vs_field_access"), used: 31 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_5_spread_vs_field_access"), used: 31 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_25 = __local_8; i32::fmt_decimal(71, __local_25); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: result.1 == 30 "), used: 27 }); - String::append(__local_7, String { repr: array.new_data("result.1: "), used: 10 }); + String::push_str(__local_7, String { repr: array.new_data("result.1: "), used: 10 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_30 = __local_8; i32::fmt_decimal(__v0_3, __local_30); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -766,17 +766,17 @@ fn __test_6_for_of_try_op() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("__test_6_for_of_try_op"), used: 22 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("__test_6_for_of_try_op"), used: 22 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_2.wado"), used: 44 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(106, __local_3); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: result matches { Ok(_) } "), used: 37 }); break __tmpl: __local_2; @@ -1017,7 +1017,7 @@ fn write_decimal_digits(arr, offset, abs_val, digit_count) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1113,7 +1113,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1201,7 +1201,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1239,7 +1239,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l64; }; @@ -1273,20 +1273,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1296,10 +1296,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1309,10 +1309,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1320,10 +1320,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1335,7 +1335,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1352,22 +1352,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b83; @@ -1375,7 +1375,7 @@ fn String^Inspect::inspect(self, f) { continue l84; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_spread_append as "__test_0_spread_append" diff --git a/wado-compiler/tests/fixtures.golden/variadic_3.wir.wado b/wado-compiler/tests/fixtures.golden/variadic_3.wir.wado index a613a6f6e..dc9abd73d 100644 --- a/wado-compiler/tests/fixtures.golden/variadic_3.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variadic_3.wir.wado @@ -233,7 +233,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -243,13 +243,13 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -333,24 +333,24 @@ fn __test_0_type_pack_expansion() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_0_type_pack_expansion"), used: 28 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_0_type_pack_expansion"), used: 28 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_32 = __local_13; i32::fmt_decimal(31, __local_32); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: result.1 == \"\" "), used: 27 }); - String::append(__local_12, String { repr: array.new_data("result.1: "), used: 10 }); + String::push_str(__local_12, String { repr: array.new_data("result.1: "), used: 10 }); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; String^Inspect::inspect(__v0, __local_13); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -397,24 +397,24 @@ fn __test_3_type_pack_expansion_mixed() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_13 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_13, String { repr: array.new_data("__test_3_type_pack_expansion_mixed"), used: 34 }); - String::append_char(__local_13, 32); - String::append_char(__local_13, 97); - String::append_char(__local_13, 116); - String::append_char(__local_13, 32); - String::append(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_13, 58); + String::push_str(__local_13, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_13, String { repr: array.new_data("__test_3_type_pack_expansion_mixed"), used: 34 }); + String::push(__local_13, 32); + String::push(__local_13, 97); + String::push(__local_13, 116); + String::push(__local_13, 32); + String::push_str(__local_13, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_13, 58); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; __local_42 = __local_14; i32::fmt_decimal(71, __local_42); - String::append(__local_13, String { repr: array.new_data(" + String::push_str(__local_13, String { repr: array.new_data(" condition: result.2 == \"\" "), used: 27 }); - String::append(__local_13, String { repr: array.new_data("result.2: "), used: 10 }); + String::push_str(__local_13, String { repr: array.new_data("result.2: "), used: 10 }); __local_14 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_13 }; String^Inspect::inspect(__v0, __local_14); - String::append_char(__local_13, 10); + String::push(__local_13, 10); break __tmpl: __local_13; }); unreachable; @@ -453,25 +453,25 @@ fn __test_4_type_pack_expansion_method_type_param() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(127), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_4_type_pack_expansion_method_type_param"), used: 46 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_4_type_pack_expansion_method_type_param"), used: 46 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_16 = __local_7; i32::fmt_decimal(118, __local_16); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: result.0 == 42 "), used: 27 }); - String::append(__local_6, String { repr: array.new_data("result.0: "), used: 10 }); + String::push_str(__local_6, String { repr: array.new_data("result.0: "), used: 10 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_21 = __local_7; i32::fmt_decimal(__v0_2, __local_21); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -481,24 +481,24 @@ condition: result.0 == 42 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_4_type_pack_expansion_method_type_param"), used: 46 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_4_type_pack_expansion_method_type_param"), used: 46 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_27 = __local_9; i32::fmt_decimal(119, __local_27); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: result.1 == \"42\" "), used: 29 }); - String::append(__local_8, String { repr: array.new_data("result.1: "), used: 10 }); + String::push_str(__local_8, String { repr: array.new_data("result.1: "), used: 10 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0_4, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -542,29 +542,29 @@ fn __test_5_type_pack_expansion_try_op() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_5_type_pack_expansion_try_op"), used: 35 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_5_type_pack_expansion_try_op"), used: 35 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_18 = __local_9; i32::fmt_decimal(152, __local_18); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: t.0 == 0 "), used: 21 }); - String::append_char(__local_8, 116); - String::append_char(__local_8, 46); - String::append_char(__local_8, 48); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 116); + String::push(__local_8, 46); + String::push(__local_8, 48); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_23 = __local_9; i32::fmt_decimal(__v0_2, __local_23); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -574,28 +574,28 @@ condition: t.0 == 0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_5_type_pack_expansion_try_op"), used: 35 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_5_type_pack_expansion_try_op"), used: 35 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_29 = __local_11; i32::fmt_decimal(153, __local_29); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: t.1 == \"default\" "), used: 29 }); - String::append_char(__local_10, 116); - String::append_char(__local_10, 46); - String::append_char(__local_10, 49); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 116); + String::push(__local_10, 46); + String::push(__local_10, 49); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; String^Inspect::inspect(__v0_4, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -605,25 +605,25 @@ condition: t.1 == \"default\" if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_5_type_pack_expansion_try_op"), used: 35 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_5_type_pack_expansion_try_op"), used: 35 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_36 = __local_13; i32::fmt_decimal(154, __local_36); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: t.2 == false "), used: 25 }); - String::append_char(__local_12, 116); - String::append_char(__local_12, 46); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 116); + String::push(__local_12, 46); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_41 = __local_13; Formatter::pad(__local_41, if __v0_6 -> ref String { @@ -631,7 +631,7 @@ condition: t.2 == false } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -670,17 +670,17 @@ fn __test_6_type_pack_expansion_try_op_err() { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(111), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_6_type_pack_expansion_try_op_err"), used: 39 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_6_type_pack_expansion_try_op_err"), used: 39 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; i32::fmt_decimal(187, __local_6); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: result matches { Err(_) } "), used: 38 }); break __tmpl: __local_5; @@ -694,26 +694,26 @@ condition: result matches { Err(_) } if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_6_type_pack_expansion_try_op_err"), used: 39 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_6_type_pack_expansion_try_op_err"), used: 39 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_19 = __local_8; i32::fmt_decimal(189, __local_19); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: e == \"string failed\" "), used: 33 }); - String::append_char(__local_7, 101); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 101); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; String^Inspect::inspect(__v0, __local_8); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -758,28 +758,28 @@ fn __test_7_type_pack_expansion_try_op_mixed() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_7_type_pack_expansion_try_op_mixed"), used: 41 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_7_type_pack_expansion_try_op_mixed"), used: 41 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_18 = __local_9; i32::fmt_decimal(217, __local_18); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: t.0 == \"header\" "), used: 28 }); - String::append_char(__local_8, 116); - String::append_char(__local_8, 46); - String::append_char(__local_8, 48); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 116); + String::push(__local_8, 46); + String::push(__local_8, 48); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0_2, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -789,29 +789,29 @@ condition: t.0 == \"header\" if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_7_type_pack_expansion_try_op_mixed"), used: 41 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_7_type_pack_expansion_try_op_mixed"), used: 41 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_25 = __local_11; i32::fmt_decimal(218, __local_25); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: t.1 == 10 "), used: 22 }); - String::append_char(__local_10, 116); - String::append_char(__local_10, 46); - String::append_char(__local_10, 49); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 116); + String::push(__local_10, 46); + String::push(__local_10, 49); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_30 = __local_11; i32::fmt_decimal(__v0_4, __local_30); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -821,25 +821,25 @@ condition: t.1 == 10 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_7_type_pack_expansion_try_op_mixed"), used: 41 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_7_type_pack_expansion_try_op_mixed"), used: 41 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_36 = __local_13; i32::fmt_decimal(219, __local_36); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: t.2 == true "), used: 24 }); - String::append_char(__local_12, 116); - String::append_char(__local_12, 46); - String::append_char(__local_12, 50); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 116); + String::push(__local_12, 46); + String::push(__local_12, 50); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_41 = __local_13; Formatter::pad(__local_41, if __v0_6 -> ref String { @@ -847,7 +847,7 @@ condition: t.2 == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -908,29 +908,29 @@ fn __test_8_type_pack_expansion_try_op_option() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_8_type_pack_expansion_try_op_option"), used: 42 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_8_type_pack_expansion_try_op_option"), used: 42 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_16 = __local_7; i32::fmt_decimal(247, __local_16); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: t.0 == 42 "), used: 22 }); - String::append_char(__local_6, 116); - String::append_char(__local_6, 46); - String::append_char(__local_6, 48); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 116); + String::push(__local_6, 46); + String::push(__local_6, 48); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_21 = __local_7; i32::fmt_decimal(__v0_2, __local_21); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -940,28 +940,28 @@ condition: t.0 == 42 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_8_type_pack_expansion_try_op_option"), used: 42 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_8_type_pack_expansion_try_op_option"), used: 42 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_27 = __local_9; i32::fmt_decimal(248, __local_27); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: t.1 == \"hello\" "), used: 27 }); - String::append_char(__local_8, 116); - String::append_char(__local_8, 46); - String::append_char(__local_8, 49); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 116); + String::push(__local_8, 46); + String::push(__local_8, 49); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; String^Inspect::inspect(__v0_4, __local_9); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1001,29 +1001,29 @@ fn __test_9_type_pack_expansion_try_op_two() { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_9_type_pack_expansion_try_op_two"), used: 39 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_9_type_pack_expansion_try_op_two"), used: 39 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_14 = __local_7; i32::fmt_decimal(276, __local_14); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: t.0 == 99 "), used: 22 }); - String::append_char(__local_6, 116); - String::append_char(__local_6, 46); - String::append_char(__local_6, 48); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 116); + String::push(__local_6, 46); + String::push(__local_6, 48); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_19 = __local_7; i32::fmt_decimal(__v0_2, __local_19); - String::append_char(__local_6, 10); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -1033,25 +1033,25 @@ condition: t.0 == 99 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_9_type_pack_expansion_try_op_two"), used: 39 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_9_type_pack_expansion_try_op_two"), used: 39 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_25 = __local_9; i32::fmt_decimal(277, __local_25); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: t.1 == true "), used: 24 }); - String::append_char(__local_8, 116); - String::append_char(__local_8, 46); - String::append_char(__local_8, 49); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); + String::push(__local_8, 116); + String::push(__local_8, 46); + String::push(__local_8, 49); + String::push(__local_8, 58); + String::push(__local_8, 32); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_30 = __local_9; Formatter::pad(__local_30, if __v0_4 -> ref String { @@ -1059,7 +1059,7 @@ condition: t.1 == true } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1101,24 +1101,24 @@ fn __test_10_type_pack_expansion_with_args() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_10_type_pack_expansion_with_args"), used: 39 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_10_type_pack_expansion_with_args"), used: 39 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_33 = __local_10; i32::fmt_decimal(311, __local_33); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: result.1 == \"42\" "), used: 29 }); - String::append(__local_9, String { repr: array.new_data("result.1: "), used: 10 }); + String::push_str(__local_9, String { repr: array.new_data("result.1: "), used: 10 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -1127,25 +1127,25 @@ condition: result.1 == \"42\" if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_11 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_11, String { repr: array.new_data("__test_10_type_pack_expansion_with_args"), used: 39 }); - String::append_char(__local_11, 32); - String::append_char(__local_11, 97); - String::append_char(__local_11, 116); - String::append_char(__local_11, 32); - String::append(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); - String::append_char(__local_11, 58); + String::push_str(__local_11, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_11, String { repr: array.new_data("__test_10_type_pack_expansion_with_args"), used: 39 }); + String::push(__local_11, 32); + String::push(__local_11, 97); + String::push(__local_11, 116); + String::push(__local_11, 32); + String::push_str(__local_11, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_3.wado"), used: 44 }); + String::push(__local_11, 58); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_40 = __local_12; i32::fmt_decimal(312, __local_40); - String::append(__local_11, String { repr: array.new_data(" + String::push_str(__local_11, String { repr: array.new_data(" condition: result.2 == 42.0 "), used: 29 }); - String::append(__local_11, String { repr: array.new_data("result.2: "), used: 10 }); + String::push_str(__local_11, String { repr: array.new_data("result.2: "), used: 10 }); __local_12 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_11 }; __local_45 = __local_12; f64::inspect_into(__sroa_result_2, __local_45); - String::append_char(__local_11, 10); + String::push(__local_11, 10); break __tmpl: __local_11; }); unreachable; @@ -2105,8 +2105,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -2161,13 +2161,13 @@ fn write_exp(buf, d, p, nd, upper) { String::append_byte_filled(buf, 48, 1); write_digits_at(buf, start_8, d, 1); }; - String::append(buf, if upper -> ref String { + String::push_str(buf, if upper -> ref String { String { repr: array.new_data("E"), used: 1 }; } else { String { repr: array.new_data("e"), used: 1 }; }); if exp < 0 { - String::append_char(buf, 45); + String::push(buf, 45); }; abs_exp = if exp < 0 -> i32 { 0 - exp; @@ -2175,25 +2175,25 @@ fn write_exp(buf, d, p, nd, upper) { exp; }; if abs_exp < 10 { - String::append_char(buf, __inline_char__from_u32_unchecked_6: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_6: block -> char { __local_20 = 48 + abs_exp; break __inline_char__from_u32_unchecked_6: __local_20; }); } else if abs_exp < 100 { - String::append_char(buf, __inline_char__from_u32_unchecked_0: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_0: block -> char { __local_26 = 48 + (abs_exp / 10); break __inline_char__from_u32_unchecked_0: __local_26; }); - String::append_char(buf, __inline_char__from_u32_unchecked_1: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_1: block -> char { __local_27 = 48 + (abs_exp % 10); break __inline_char__from_u32_unchecked_1: __local_27; }); } else { - String::append_char(buf, __inline_char__from_u32_unchecked_9: block -> char { + String::push(buf, __inline_char__from_u32_unchecked_9: block -> char { __local_23 = 48 + (abs_exp / 100); break __inline_char__from_u32_unchecked_9: __local_23; }); - String::append_char(buf, __inline_i2a_first_10: block -> char { + String::push(buf, __inline_i2a_first_10: block -> char { __local_24 = abs_exp % 100; __inline_char__from_u32_unchecked_2: block -> char { __local_28 = 48 + (__local_24 / 10); @@ -2201,7 +2201,7 @@ fn write_exp(buf, d, p, nd, upper) { }; break __inline_i2a_first_10; }); - String::append_char(buf, __inline_i2a_second_11: block -> char { + String::push(buf, __inline_i2a_second_11: block -> char { __local_25 = abs_exp % 100; __inline_char__from_u32_unchecked_3: block -> char { __local_29 = 48 + (__local_25 % 10); @@ -2243,8 +2243,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -2276,7 +2276,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -2405,27 +2405,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -2548,9 +2548,9 @@ fn f64::inspect_into(self, f) { break __inline_String__len_5: __local_20.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; if if exp < -4 -> i32 { 1; @@ -2560,8 +2560,8 @@ fn f64::inspect_into(self, f) { write_exp(f.buf, d, p, nd, 0); } else if p >= 0 { write_decimal(f.buf, d, p, nd); - String::append_char(f.buf, 46); - String::append_char(f.buf, 48); + String::push(f.buf, 46); + String::push(f.buf, 48); } else { write_decimal(f.buf, d, p, nd); }; @@ -2616,13 +2616,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -2657,9 +2657,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -2712,7 +2712,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -2800,7 +2800,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -2849,7 +2849,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l233; }; @@ -2869,7 +2869,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2877,17 +2877,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -3041,20 +3041,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -3064,10 +3064,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -3077,10 +3077,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -3088,10 +3088,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -3103,7 +3103,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -3120,22 +3120,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b272; @@ -3143,7 +3143,7 @@ fn String^Inspect::inspect(self, f) { continue l273; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_type_pack_expansion as "__test_0_type_pack_expansion" diff --git a/wado-compiler/tests/fixtures.golden/variadic_deserialize.wir.wado b/wado-compiler/tests/fixtures.golden/variadic_deserialize.wir.wado index ab1e78d57..e8c7b7f16 100644 --- a/wado-compiler/tests/fixtures.golden/variadic_deserialize.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variadic_deserialize.wir.wado @@ -57,6 +57,11 @@ struct Option::Some { payload_0: i32, } +variant Option { + Some(ref String), + None, +} + variant Result { Ok(ref String), Err(ref "core:serde/DeserializeError"), @@ -87,11 +92,6 @@ struct Result::Err { payload_0: ref "core:serde/DeserializeError", } -variant Option { - Some(ref String), - None, -} - variant Result { Ok(ref "core:json/JsonSeqAccess"), Err(ref "core:serde/DeserializeError"), @@ -193,13 +193,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/String^Deserialize::deserialize_next_element_from_seq" = fn(ref "core:json/JsonSeqAccess") -> ref Result; @@ -290,29 +290,29 @@ fn __test_0_tuple_deserialize_via_variadic_impl() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_0_tuple_deserialize_via_variadic_impl"), used: 44 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_deserialize.wado"), used: 54 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_0_tuple_deserialize_via_variadic_impl"), used: 44 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_deserialize.wado"), used: 54 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_16 = __local_8; i32::fmt_decimal(7, __local_16); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: t.0 == 42 "), used: 22 }); - String::append_char(__local_7, 116); - String::append_char(__local_7, 46); - String::append_char(__local_7, 48); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 116); + String::push(__local_7, 46); + String::push(__local_7, 48); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_21 = __local_8; i32::fmt_decimal(__v0_3, __local_21); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -322,28 +322,28 @@ condition: t.0 == 42 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(122), used: 0 }; - String::append(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_9, String { repr: array.new_data("__test_0_tuple_deserialize_via_variadic_impl"), used: 44 }); - String::append_char(__local_9, 32); - String::append_char(__local_9, 97); - String::append_char(__local_9, 116); - String::append_char(__local_9, 32); - String::append(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_deserialize.wado"), used: 54 }); - String::append_char(__local_9, 58); + String::push_str(__local_9, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_9, String { repr: array.new_data("__test_0_tuple_deserialize_via_variadic_impl"), used: 44 }); + String::push(__local_9, 32); + String::push(__local_9, 97); + String::push(__local_9, 116); + String::push(__local_9, 32); + String::push_str(__local_9, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_deserialize.wado"), used: 54 }); + String::push(__local_9, 58); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; __local_27 = __local_10; i32::fmt_decimal(8, __local_27); - String::append(__local_9, String { repr: array.new_data(" + String::push_str(__local_9, String { repr: array.new_data(" condition: t.1 == \"hello\" "), used: 27 }); - String::append_char(__local_9, 116); - String::append_char(__local_9, 46); - String::append_char(__local_9, 49); - String::append_char(__local_9, 58); - String::append_char(__local_9, 32); + String::push(__local_9, 116); + String::push(__local_9, 46); + String::push(__local_9, 49); + String::push(__local_9, 58); + String::push(__local_9, 32); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; String^Inspect::inspect(__v0_5, __local_10); - String::append_char(__local_9, 10); + String::push(__local_9, 10); break __tmpl: __local_9; }); unreachable; @@ -925,10 +925,10 @@ fn char^Display::fmt(self, f) { let c: char; if f.width <= 0 { c = self; - String::append_char(f.buf, c); + String::push(f.buf, c); } else { s = String { repr: builtin::array_new(4), used: 0 }; - String::append_char(s, self); + String::push(s, self); Formatter::pad(f, s); }; } @@ -967,7 +967,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1055,7 +1055,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1381,13 +1381,13 @@ fn "core:json/JsonDeserializer::expect_char"(self, c) { // from core:json return ref.as_non_null(__inline_DeserializeError__malformed_6: block -> ref "core:serde/DeserializeError" { __local_12 = __tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(53), used: 0 }; - String::append(__local_3, String { repr: array.new_data("expected '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("expected '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(c & 255, __local_4); - String::append(__local_3, String { repr: array.new_data("', found '"), used: 10 }); + String::push_str(__local_3, String { repr: array.new_data("', found '"), used: 10 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; char^Display::fmt(b & 255, __local_4); - String::append_char(__local_3, 39); + String::push(__local_3, 39); break __tmpl: __local_3; }; __local_13 = builtin::i64_extend_i32_s(self.pos); @@ -1638,21 +1638,21 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json break __inline_String__get_byte_18: builtin::array_get_u8(__local_68.repr, __local_69); }; if esc == 34 { - String::append_char(result_8, 34); + String::push(result_8, 34); } else if esc == 92 { - String::append_char(result_8, 92); + String::push(result_8, 92); } else if esc == 47 { - String::append_char(result_8, 47); + String::push(result_8, 47); } else if esc == 110 { - String::append_char(result_8, 10); + String::push(result_8, 10); } else if esc == 114 { - String::append_char(result_8, 13); + String::push(result_8, 13); } else if esc == 116 { - String::append_char(result_8, 9); + String::push(result_8, 9); } else if esc == 98 { - String::append_char(result_8, 8); + String::push(result_8, 8); } else if esc == 102 { - String::append_char(result_8, 12); + String::push(result_8, 12); } else if esc == 117 { self.pos = _hfs_pos_98; let __sroa_r_discriminant: i32; @@ -1662,7 +1662,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json _hfs_pos_98 = self.pos; if __sroa_r_discriminant == 0 { c_14 = __sroa_r_case0_payload_0; - String::append_char(result_8, c_14); + String::push(result_8, c_14); }; if __sroa_r_discriminant == 1 { e = __sroa_r_case1_payload_0; @@ -1674,10 +1674,10 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json return 1; ref.null none; ref.as_non_null(__inline_DeserializeError__malformed_21: block -> ref "core:serde/DeserializeError" { __local_72 = __tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); + String::push_str(__local_32, String { repr: array.new_data("invalid escape '\\"), used: 17 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; char^Display::fmt(esc & 255, __local_33); - String::append_char(__local_32, 39); + String::push(__local_32, 39); self.pos = _hfs_pos_98; break __tmpl: __local_32; }; @@ -1702,7 +1702,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json }); }; if seq_len == 1 { - String::append_char(result_8, b & 255); + String::push(result_8, b & 255); } else if seq_len == 2 { b0_17 = b; b1_18 = __inline_String__get_byte_24: block -> u8 { @@ -1717,7 +1717,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_2_discriminant, __sroa___pattern_temp_2_payload_0] = char::from_u32(code_19); if __sroa___pattern_temp_2_discriminant == 0 { c_20 = __sroa___pattern_temp_2_payload_0; - String::append_char(result_8, c_20); + String::push(result_8, c_20); }; } else if seq_len == 3 { b0_21 = b; @@ -1739,7 +1739,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_3_discriminant, __sroa___pattern_temp_3_payload_0] = char::from_u32(code_24); if __sroa___pattern_temp_3_discriminant == 0 { c_25 = __sroa___pattern_temp_3_payload_0; - String::append_char(result_8, c_25); + String::push(result_8, c_25); }; } else { b0_26 = b; @@ -1767,7 +1767,7 @@ fn "core:json/JsonDeserializer::read_json_string"(self) { // from core:json multivalue_bind [__sroa___pattern_temp_4_discriminant, __sroa___pattern_temp_4_payload_0] = char::from_u32(code_30); if __sroa___pattern_temp_4_discriminant == 0 { c_31 = __sroa___pattern_temp_4_payload_0; - String::append_char(result_8, c_31); + String::push(result_8, c_31); }; }; _hfs_pos_98 = _hfs_pos_98 + seq_len; @@ -2145,7 +2145,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l231; }; @@ -2165,7 +2165,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -2173,17 +2173,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -2213,20 +2213,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -2236,10 +2236,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -2249,10 +2249,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -2260,10 +2260,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -2275,7 +2275,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -2292,22 +2292,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b254; @@ -2315,7 +2315,7 @@ fn String^Inspect::inspect(self, f) { continue l255; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_tuple_deserialize_via_variadic_impl as "__test_0_tuple_deserialize_via_variadic_impl" diff --git a/wado-compiler/tests/fixtures.golden/variadic_for_of_generic_method.wir.wado b/wado-compiler/tests/fixtures.golden/variadic_for_of_generic_method.wir.wado index dbea4bf14..1c85a78fd 100644 --- a/wado-compiler/tests/fixtures.golden/variadic_for_of_generic_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variadic_for_of_generic_method.wir.wado @@ -77,9 +77,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Tuple^Addable::value" = fn(ref "tuple/[i32, bool]") -> i32; @@ -123,27 +123,27 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_for_of_generic_method.wado"), used: 64 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_3, 114); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_for_of_generic_method.wado"), used: 64 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(42, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: t.value() == 43 "), used: 28 }); - String::append(__local_3, String { repr: array.new_data("t.value(): "), used: 11 }); + String::push_str(__local_3, String { repr: array.new_data("t.value(): "), used: 11 }); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; i32::fmt_decimal(__v0, __local_14); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -383,7 +383,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -398,7 +398,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -459,7 +459,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l26; }; @@ -493,20 +493,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -516,10 +516,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -529,10 +529,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -540,10 +540,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/variadic_impl_method_type_param.wir.wado b/wado-compiler/tests/fixtures.golden/variadic_impl_method_type_param.wir.wado index bfd1cb8e1..33e730fdc 100644 --- a/wado-compiler/tests/fixtures.golden/variadic_impl_method_type_param.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variadic_impl_method_type_param.wir.wado @@ -85,9 +85,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Tuple^Countable::count" = fn(ref "tuple/[i32, bool]") -> i32; @@ -131,29 +131,29 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(112), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_4, 114); - String::append_char(__local_4, 117); - String::append_char(__local_4, 110); - String::append_char(__local_4, 32); - String::append_char(__local_4, 97); - String::append_char(__local_4, 116); - String::append_char(__local_4, 32); - String::append(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_impl_method_type_param.wado"), used: 65 }); - String::append_char(__local_4, 58); + String::push_str(__local_4, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_4, 114); + String::push(__local_4, 117); + String::push(__local_4, 110); + String::push(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 116); + String::push(__local_4, 32); + String::push_str(__local_4, String { repr: array.new_data("wado-compiler/tests/fixtures/variadic_impl_method_type_param.wado"), used: 65 }); + String::push(__local_4, 58); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(30, __local_10); - String::append(__local_4, String { repr: array.new_data(" + String::push_str(__local_4, String { repr: array.new_data(" condition: c == 3 "), used: 19 }); - String::append_char(__local_4, 99); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 99); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(c, __local_15); - String::append_char(__local_4, 10); + String::push(__local_4, 10); break __tmpl: __local_4; }); unreachable; @@ -393,7 +393,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -408,7 +408,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -468,7 +468,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l25; }; @@ -502,20 +502,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -525,10 +525,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -538,10 +538,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -549,10 +549,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/variant_construct.wir.wado b/wado-compiler/tests/fixtures.golden/variant_construct.wir.wado index d336a7cc1..9694fa1fd 100644 --- a/wado-compiler/tests/fixtures.golden/variant_construct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_construct.wir.wado @@ -113,15 +113,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -237,25 +237,25 @@ fn variant_construct_literal_coercion() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_23, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_23, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_51 = __local_24; i32::fmt_decimal(31, __local_51); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: arr.len() == 0 "), used: 27 }); - String::append(__local_23, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_23, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; __local_56 = __local_24; i32::fmt_decimal(__v0_1, __local_56); - String::append_char(__local_23, 10); + String::push(__local_23, 10); break __tmpl: __local_23; }); unreachable; @@ -272,25 +272,25 @@ condition: arr.len() == 0 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_25 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_25, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); - String::append_char(__local_25, 32); - String::append_char(__local_25, 97); - String::append_char(__local_25, 116); - String::append_char(__local_25, 32); - String::append(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); - String::append_char(__local_25, 58); + String::push_str(__local_25, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_25, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); + String::push(__local_25, 32); + String::push(__local_25, 97); + String::push(__local_25, 116); + String::push(__local_25, 32); + String::push_str(__local_25, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); + String::push(__local_25, 58); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_63 = __local_26; i32::fmt_decimal(38, __local_63); - String::append(__local_25, String { repr: array.new_data(" + String::push_str(__local_25, String { repr: array.new_data(" condition: arr.len() == 3 "), used: 27 }); - String::append(__local_25, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_25, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_26 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_25 }; __local_68 = __local_26; i32::fmt_decimal(__v0_4, __local_68); - String::append_char(__local_25, 10); + String::push(__local_25, 10); break __tmpl: __local_25; }); unreachable; @@ -306,32 +306,32 @@ condition: arr.len() == 3 if __cond_7 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_76 = __local_28; i32::fmt_decimal(39, __local_76); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: arr[0] == 1 as u8 "), used: 30 }); - String::append_char(__local_27, 97); - String::append_char(__local_27, 114); - String::append_char(__local_27, 114); - String::append_char(__local_27, 91); - String::append_char(__local_27, 48); - String::append_char(__local_27, 93); - String::append_char(__local_27, 58); - String::append_char(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 114); + String::push(__local_27, 114); + String::push(__local_27, 91); + String::push(__local_27, 48); + String::push(__local_27, 93); + String::push(__local_27, 58); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_81 = __local_28; i32::fmt_decimal(__v0_6, __local_81); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -351,25 +351,25 @@ condition: arr[0] == 1 as u8 if __cond_10 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_29, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_29, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_88 = __local_30; i32::fmt_decimal(46, __local_88); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: arr.len() == 3 "), used: 27 }); - String::append(__local_29, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_29, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_93 = __local_30; i32::fmt_decimal(__v0_9, __local_93); - String::append_char(__local_29, 10); + String::push(__local_29, 10); break __tmpl: __local_29; }); unreachable; @@ -385,32 +385,32 @@ condition: arr.len() == 3 if __cond_12 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_31, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_31, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_101 = __local_32; i32::fmt_decimal(47, __local_101); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: arr[0] == 10 "), used: 25 }); - String::append_char(__local_31, 97); - String::append_char(__local_31, 114); - String::append_char(__local_31, 114); - String::append_char(__local_31, 91); - String::append_char(__local_31, 48); - String::append_char(__local_31, 93); - String::append_char(__local_31, 58); - String::append_char(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 114); + String::push(__local_31, 114); + String::push(__local_31, 91); + String::push(__local_31, 48); + String::push(__local_31, 93); + String::push(__local_31, 58); + String::push(__local_31, 32); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_106 = __local_32; i32::fmt_decimal(__v0_11, __local_106); - String::append_char(__local_31, 10); + String::push(__local_31, 10); break __tmpl: __local_31; }); unreachable; @@ -430,25 +430,25 @@ condition: arr[0] == 10 if __cond_15 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_33 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_33, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); - String::append_char(__local_33, 32); - String::append_char(__local_33, 97); - String::append_char(__local_33, 116); - String::append_char(__local_33, 32); - String::append(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); - String::append_char(__local_33, 58); + String::push_str(__local_33, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_33, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); + String::push(__local_33, 32); + String::push(__local_33, 97); + String::push(__local_33, 116); + String::push(__local_33, 32); + String::push_str(__local_33, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); + String::push(__local_33, 58); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_117 = __local_34; i32::fmt_decimal(54, __local_117); - String::append(__local_33, String { repr: array.new_data(" + String::push_str(__local_33, String { repr: array.new_data(" condition: arr.len() == 0 "), used: 27 }); - String::append(__local_33, String { repr: array.new_data("arr.len(): "), used: 11 }); + String::push_str(__local_33, String { repr: array.new_data("arr.len(): "), used: 11 }); __local_34 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_33 }; __local_122 = __local_34; i32::fmt_decimal(__v0_14, __local_122); - String::append_char(__local_33, 10); + String::push(__local_33, 10); break __tmpl: __local_33; }); unreachable; @@ -475,17 +475,17 @@ condition: arr.len() == 0 if __cond_20 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_35 = String { repr: builtin::array_new(124), used: 0 }; - String::append(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_35, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); - String::append_char(__local_35, 32); - String::append_char(__local_35, 97); - String::append_char(__local_35, 116); - String::append_char(__local_35, 32); - String::append(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); - String::append_char(__local_35, 58); + String::push_str(__local_35, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_35, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); + String::push(__local_35, 32); + String::push(__local_35, 97); + String::push(__local_35, 116); + String::push(__local_35, 32); + String::push_str(__local_35, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); + String::push(__local_35, 58); __local_36 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_35 }; i32::fmt_decimal(62, __local_36); - String::append(__local_35, String { repr: array.new_data(" + String::push_str(__local_35, String { repr: array.new_data(" condition: opt_i32 matches { Some(n) && n == 42 } "), used: 51 }); break __tmpl: __local_35; @@ -505,17 +505,17 @@ condition: opt_i32 matches { Some(n) && n == 42 } if __cond_22 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_37 = String { repr: builtin::array_new(129), used: 0 }; - String::append(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_37, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); - String::append_char(__local_37, 32); - String::append_char(__local_37, 97); - String::append_char(__local_37, 116); - String::append_char(__local_37, 32); - String::append(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); - String::append_char(__local_37, 58); + String::push_str(__local_37, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_37, String { repr: array.new_data("variant_construct_literal_coercion"), used: 34 }); + String::push(__local_37, 32); + String::push(__local_37, 97); + String::push(__local_37, 116); + String::push(__local_37, 32); + String::push_str(__local_37, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_construct.wado"), used: 51 }); + String::push(__local_37, 58); __local_38 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_37 }; i32::fmt_decimal(63, __local_38); - String::append(__local_37, String { repr: array.new_data(" + String::push_str(__local_37, String { repr: array.new_data(" condition: opt_arr matches { Some(a) && a.len() == 2 } "), used: 56 }); break __tmpl: __local_37; @@ -763,7 +763,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -778,7 +778,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -805,7 +805,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -847,7 +847,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -900,7 +900,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l48; }; @@ -934,20 +934,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -957,10 +957,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -970,10 +970,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -981,10 +981,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/variant_deref_cross_module.wir.wado b/wado-compiler/tests/fixtures.golden/variant_deref_cross_module.wir.wado index 14231c2a9..dd9c1b176 100644 --- a/wado-compiler/tests/fixtures.golden/variant_deref_cross_module.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_deref_cross_module.wir.wado @@ -151,15 +151,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref "./sub/variant_deref_helper.wado/Elem"); +type "functype/Array::push" = fn(ref Array, ref "./sub/variant_deref_helper.wado/Elem"); type "functype/Array::grow" = fn(ref Array); @@ -217,19 +217,19 @@ fn process(elem, out) { __pattern_temp_0 = elem; if ref.test "./sub/variant_deref_helper.wado/Elem::TokenRef"(__pattern_temp_0) { name_2 = value_copy String(ref.cast "./sub/variant_deref_helper.wado/Elem::TokenRef"(__pattern_temp_0).payload_0); - String::append(out, name_2); + String::push_str(out, name_2); return; }; __pattern_temp_1 = elem; if ref.test "./sub/variant_deref_helper.wado/Elem::Literal"(__pattern_temp_1) { text = value_copy String(ref.cast "./sub/variant_deref_helper.wado/Elem::Literal"(__pattern_temp_1).payload_0); - String::append(out, text); + String::push_str(out, text); return; }; __pattern_temp_2 = elem; if ref.test "./sub/variant_deref_helper.wado/Elem::RuleRef"(__pattern_temp_2) { name_4 = value_copy String(ref.cast "./sub/variant_deref_helper.wado/Elem::RuleRef"(__pattern_temp_2).payload_0); - String::append(out, name_4); + String::push_str(out, name_4); return; }; __pattern_temp_3 = elem; @@ -305,28 +305,28 @@ fn __test_0_recursive_variant_deref_from_another_module() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(128), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_recursive_variant_deref_from_another_module"), used: 52 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_deref_cross_module.wado"), used: 60 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_recursive_variant_deref_from_another_module"), used: 52 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_deref_cross_module.wado"), used: 60 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_19 = __local_6; i32::fmt_decimal(50, __local_19); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: out == \"hello world\" "), used: 33 }); - String::append_char(__local_5, 111); - String::append_char(__local_5, 117); - String::append_char(__local_5, 116); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 111); + String::push(__local_5, 117); + String::push(__local_5, 116); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; String^Inspect::inspect(__v0, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -529,7 +529,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -617,7 +617,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -644,7 +644,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -717,7 +717,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l51; }; @@ -751,20 +751,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -774,10 +774,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -787,10 +787,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -798,10 +798,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -813,7 +813,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -830,22 +830,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b70; @@ -853,7 +853,7 @@ fn String^Inspect::inspect(self, f) { continue l71; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export____test_0_recursive_variant_deref_from_another_module as "__test_0_recursive_variant_deref_from_another_module" diff --git a/wado-compiler/tests/fixtures.golden/variant_eq_auto_recursive.wir.wado b/wado-compiler/tests/fixtures.golden/variant_eq_auto_recursive.wir.wado index e01aa4ff7..e0f957231 100644 --- a/wado-compiler/tests/fixtures.golden/variant_eq_auto_recursive.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_eq_auto_recursive.wir.wado @@ -88,9 +88,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/BranchData^Eq::eq" = fn(ref BranchData, ref BranchData) -> bool; @@ -147,32 +147,32 @@ fn __test_0_recursive_variant_eq() { if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_10, String { repr: array.new_data("__test_0_recursive_variant_eq"), used: 29 }); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_eq_auto_recursive.wado"), used: 59 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_10, String { repr: array.new_data("__test_0_recursive_variant_eq"), used: 29 }); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_eq_auto_recursive.wado"), used: 59 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_18 = __local_11; i32::fmt_decimal(20, __local_18); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: a == b "), used: 19 }); - String::append_char(__local_10, 97); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; Node^Inspect::inspect(a, __local_11); - String::append_char(__local_10, 10); - String::append_char(__local_10, 98); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 10); + String::push(__local_10, 98); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; Node^Inspect::inspect(b, __local_11); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -183,40 +183,40 @@ condition: a == b if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(158), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_12, String { repr: array.new_data("__test_0_recursive_variant_eq"), used: 29 }); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_eq_auto_recursive.wado"), used: 59 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_12, String { repr: array.new_data("__test_0_recursive_variant_eq"), used: 29 }); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_eq_auto_recursive.wado"), used: 59 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_26 = __local_13; i32::fmt_decimal(26, __local_26); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: !a == c "), used: 20 }); - String::append_char(__local_12, 97); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; Node^Inspect::inspect(a, __local_13); - String::append_char(__local_12, 10); - String::append_char(__local_12, 99); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 10); + String::push(__local_12, 99); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; Node^Inspect::inspect(c, __local_13); - String::append_char(__local_12, 10); - String::append_char(__local_12, 97); - String::append_char(__local_12, 32); - String::append_char(__local_12, 61); - String::append_char(__local_12, 61); - String::append_char(__local_12, 32); - String::append_char(__local_12, 99); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 10); + String::push(__local_12, 97); + String::push(__local_12, 32); + String::push(__local_12, 61); + String::push(__local_12, 61); + String::push(__local_12, 32); + String::push(__local_12, 99); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_33 = __local_13; Formatter::pad(__local_33, if __v2 -> ref String { @@ -224,7 +224,7 @@ condition: !a == c } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -244,32 +244,32 @@ fn __test_1_recursive_variant_eq_nested() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(132), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_1_recursive_variant_eq_nested"), used: 36 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_eq_auto_recursive.wado"), used: 59 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_1_recursive_variant_eq_nested"), used: 36 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_eq_auto_recursive.wado"), used: 59 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(44, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: a == b "), used: 19 }); - String::append_char(__local_5, 97); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; Node^Inspect::inspect(a, __local_6); - String::append_char(__local_5, 10); - String::append_char(__local_5, 98); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 10); + String::push(__local_5, 98); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; Node^Inspect::inspect(b, __local_6); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -477,7 +477,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -492,7 +492,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -558,17 +558,17 @@ fn BranchData^Inspect::inspect(self, f) { let s_9: ref String; let s_11: ref String; s_3 = String { repr: array.new_data("BranchData { "), used: 13 }; - String::append(f.buf, s_3); + String::push_str(f.buf, s_3); s_5 = String { repr: array.new_data("left: "), used: 6 }; - String::append(f.buf, s_5); + String::push_str(f.buf, s_5); Node^Inspect::inspect(self.left, f); s_7 = String { repr: array.new_data(", "), used: 2 }; - String::append(f.buf, s_7); + String::push_str(f.buf, s_7); s_9 = String { repr: array.new_data("right: "), used: 7 }; - String::append(f.buf, s_9); + String::push_str(f.buf, s_9); Node^Inspect::inspect(self.right, f); s_11 = String { repr: array.new_data(" }"), used: 2 }; - String::append(f.buf, s_11); + String::push_str(f.buf, s_11); } fn Node^Inspect::inspect(self, f) { @@ -578,16 +578,16 @@ fn Node^Inspect::inspect(self, f) { let __local_13: ref String; if ref.test Node::Leaf(self) { __local_3 = String { repr: array.new_data("Node::Leaf("), used: 11 }; - String::append(f.buf, __local_3); + String::push_str(f.buf, __local_3); i32::fmt_decimal(ref.cast Node::Leaf(self).payload_0, f); __local_9 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_9); + String::push_str(f.buf, __local_9); } else if ref.test Node::Branch(self) { __local_11 = String { repr: array.new_data("Node::Branch("), used: 13 }; - String::append(f.buf, __local_11); + String::push_str(f.buf, __local_11); BranchData^Inspect::inspect(ref.cast Node::Branch(self).payload_0, f); __local_13 = String { repr: array.new_data(")"), used: 1 }; - String::append(f.buf, __local_13); + String::push_str(f.buf, __local_13); }; } @@ -602,7 +602,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -622,7 +622,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -630,17 +630,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -670,20 +670,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -693,10 +693,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -706,10 +706,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -717,10 +717,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/variant_if_let_basic.wir.wado b/wado-compiler/tests/fixtures.golden/variant_if_let_basic.wir.wado index d2a4f74fa..8ed4b0fa9 100644 --- a/wado-compiler/tests/fixtures.golden/variant_if_let_basic.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_if_let_basic.wir.wado @@ -101,7 +101,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -109,7 +109,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -175,7 +175,7 @@ fn run() with Stdout { r_1 = ref.cast Shape::Circle(c).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_4, String { repr: array.new_data("Circle with radius "), used: 19 }); + String::push_str(__local_4, String { repr: array.new_data("Circle with radius "), used: 19 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; f64::fmt_into(r_1, __local_5); break __tmpl: __local_4; @@ -188,7 +188,7 @@ fn run() with Stdout { r_3 = ref.cast Shape::Circle(p).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Circle with radius "), used: 19 }); + String::push_str(__local_6, String { repr: array.new_data("Circle with radius "), used: 19 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; f64::fmt_into(r_3, __local_7); break __tmpl: __local_6; @@ -964,7 +964,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1019,7 +1019,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1051,7 +1051,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1133,25 +1133,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1252,9 +1252,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1308,13 +1308,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1349,9 +1349,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1392,7 +1392,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/variant_import_struct.wir.wado b/wado-compiler/tests/fixtures.golden/variant_import_struct.wir.wado index f028995e1..73835ea75 100644 --- a/wado-compiler/tests/fixtures.golden/variant_import_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_import_struct.wir.wado @@ -58,7 +58,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String::concat" = fn(ref String, ref String) -> ref String; @@ -94,27 +94,27 @@ fn run() with Stdout { s1 = "./variant_import_struct_module.wado/format_with_opts"(String { repr: array.new_data("hi"), used: 2 }, opts); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(18), used: 0 }; - String::append(__local_4, String { repr: array.new_data("["), used: 1 }); - String::append(__local_4, s1); - String::append(__local_4, String { repr: array.new_data("]"), used: 1 }); + String::push_str(__local_4, String { repr: array.new_data("["), used: 1 }); + String::push_str(__local_4, s1); + String::push_str(__local_4, String { repr: array.new_data("]"), used: 1 }); break __tmpl: __local_4; }); opts.align = "./variant_import_struct_module.wado/Align" { 0 }; s2 = "./variant_import_struct_module.wado/format_with_opts"(String { repr: array.new_data("hi"), used: 2 }, opts); "core:cli/println"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(18), used: 0 }; - String::append(__local_5, String { repr: array.new_data("["), used: 1 }); - String::append(__local_5, s2); - String::append(__local_5, String { repr: array.new_data("]"), used: 1 }); + String::push_str(__local_5, String { repr: array.new_data("["), used: 1 }); + String::push_str(__local_5, s2); + String::push_str(__local_5, String { repr: array.new_data("]"), used: 1 }); break __tmpl: __local_5; }); opts.align = "./variant_import_struct_module.wado/Align" { 2 }; s3 = "./variant_import_struct_module.wado/format_with_opts"(String { repr: array.new_data("hi"), used: 2 }, opts); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(18), used: 0 }; - String::append(__local_6, String { repr: array.new_data("["), used: 1 }); - String::append(__local_6, s3); - String::append(__local_6, String { repr: array.new_data("]"), used: 1 }); + String::push_str(__local_6, String { repr: array.new_data("["), used: 1 }); + String::push_str(__local_6, s3); + String::push_str(__local_6, String { repr: array.new_data("]"), used: 1 }); break __tmpl: __local_6; }); } @@ -153,7 +153,7 @@ fn "./variant_import_struct_module.wado/format_with_opts"(s, opts) { // from ./ if (i < pad_len) == 0 { break __for_0; }; - String::append(pad, String { repr: array.new_data(" "), used: 1 }); + String::push_str(pad, String { repr: array.new_data(" "), used: 1 }); i = i + 1; continue l3; }; @@ -175,7 +175,7 @@ fn "./variant_import_struct_module.wado/format_with_opts"(s, opts) { // from ./ if (__local_9 < __local_5) == 0 { break __for_0; }; - String::append(__local_7, String { repr: array.new_data(" "), used: 1 }); + String::push_str(__local_7, String { repr: array.new_data(" "), used: 1 }); __local_9 = __local_9 + 1; continue l9; }; @@ -188,7 +188,7 @@ fn "./variant_import_struct_module.wado/format_with_opts"(s, opts) { // from ./ if (__local_10 < __local_6) == 0 { break __for_1; }; - String::append(__local_8, String { repr: array.new_data(" "), used: 1 }); + String::push_str(__local_8, String { repr: array.new_data(" "), used: 1 }); __local_10 = __local_10 + 1; continue l12; }; @@ -307,7 +307,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/variant_import_struct_module.wir.wado b/wado-compiler/tests/fixtures.golden/variant_import_struct_module.wir.wado index 20061a944..b99e5095b 100644 --- a/wado-compiler/tests/fixtures.golden/variant_import_struct_module.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_import_struct_module.wir.wado @@ -58,7 +58,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String::concat" = fn(ref String, ref String) -> ref String; @@ -106,7 +106,7 @@ fn format_with_opts(s, opts) { if (i < pad_len) == 0 { break __for_0; }; - String::append(pad, String { repr: array.new_data(" "), used: 1 }); + String::push_str(pad, String { repr: array.new_data(" "), used: 1 }); i = i + 1; continue l3; }; @@ -128,7 +128,7 @@ fn format_with_opts(s, opts) { if (__local_9 < __local_5) == 0 { break __for_0; }; - String::append(__local_7, String { repr: array.new_data(" "), used: 1 }); + String::push_str(__local_7, String { repr: array.new_data(" "), used: 1 }); __local_9 = __local_9 + 1; continue l9; }; @@ -141,7 +141,7 @@ fn format_with_opts(s, opts) { if (__local_10 < __local_6) == 0 { break __for_1; }; - String::append(__local_8, String { repr: array.new_data(" "), used: 1 }); + String::push_str(__local_8, String { repr: array.new_data(" "), used: 1 }); __local_10 = __local_10 + 1; continue l12; }; @@ -281,7 +281,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/variant_import_struct_simple.wir.wado b/wado-compiler/tests/fixtures.golden/variant_import_struct_simple.wir.wado index e7c04ff58..85668eaa7 100644 --- a/wado-compiler/tests/fixtures.golden/variant_import_struct_simple.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_import_struct_simple.wir.wado @@ -58,7 +58,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String::concat" = fn(ref String, ref String) -> ref String; @@ -127,7 +127,7 @@ fn "./variant_import_struct_module.wado/format_with_opts"(s, opts) { // from ./ if (i < pad_len) == 0 { break __for_0; }; - String::append(pad, String { repr: array.new_data(" "), used: 1 }); + String::push_str(pad, String { repr: array.new_data(" "), used: 1 }); i = i + 1; continue l3; }; @@ -149,7 +149,7 @@ fn "./variant_import_struct_module.wado/format_with_opts"(s, opts) { // from ./ if (__local_9 < __local_5) == 0 { break __for_0; }; - String::append(__local_7, String { repr: array.new_data(" "), used: 1 }); + String::push_str(__local_7, String { repr: array.new_data(" "), used: 1 }); __local_9 = __local_9 + 1; continue l9; }; @@ -162,7 +162,7 @@ fn "./variant_import_struct_module.wado/format_with_opts"(s, opts) { // from ./ if (__local_10 < __local_6) == 0 { break __for_1; }; - String::append(__local_8, String { repr: array.new_data(" "), used: 1 }); + String::push_str(__local_8, String { repr: array.new_data(" "), used: 1 }); __local_10 = __local_10 + 1; continue l12; }; @@ -281,7 +281,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/variant_in_struct_simple.wir.wado b/wado-compiler/tests/fixtures.golden/variant_in_struct_simple.wir.wado index 803b4c7af..26940dad6 100644 --- a/wado-compiler/tests/fixtures.golden/variant_in_struct_simple.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_in_struct_simple.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -299,7 +299,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -314,7 +314,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -352,7 +352,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -386,20 +386,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -409,10 +409,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -422,10 +422,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -433,10 +433,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/variant_in_struct_simple_module.wir.wado b/wado-compiler/tests/fixtures.golden/variant_in_struct_simple_module.wir.wado index 7e17a7986..02c290763 100644 --- a/wado-compiler/tests/fixtures.golden/variant_in_struct_simple_module.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_in_struct_simple_module.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -299,7 +299,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -314,7 +314,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -352,7 +352,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -386,20 +386,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -409,10 +409,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -422,10 +422,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -433,10 +433,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/variant_infer.wir.wado b/wado-compiler/tests/fixtures.golden/variant_infer.wir.wado index 937c83ea5..9def1a3f3 100644 --- a/wado-compiler/tests/fixtures.golden/variant_infer.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_infer.wir.wado @@ -95,13 +95,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -144,17 +144,17 @@ fn variant_infer_option_none() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(104), used: 0 }; - String::append(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_2, String { repr: array.new_data("variant_infer_option_none"), used: 25 }); - String::append_char(__local_2, 32); - String::append_char(__local_2, 97); - String::append_char(__local_2, 116); - String::append_char(__local_2, 32); - String::append(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_infer.wado"), used: 47 }); - String::append_char(__local_2, 58); + String::push_str(__local_2, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_2, String { repr: array.new_data("variant_infer_option_none"), used: 25 }); + String::push(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 116); + String::push(__local_2, 32); + String::push_str(__local_2, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_infer.wado"), used: 47 }); + String::push(__local_2, 58); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(8, __local_3); - String::append(__local_2, String { repr: array.new_data(" + String::push_str(__local_2, String { repr: array.new_data(" condition: a matches { None } "), used: 31 }); break __tmpl: __local_2; @@ -188,17 +188,17 @@ fn variant_infer_option_some() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("variant_infer_option_some"), used: 25 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_infer.wado"), used: 47 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("variant_infer_option_some"), used: 25 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_infer.wado"), used: 47 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(15, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: a matches { Some(s) && s == \"hello\" } "), used: 50 }); break __tmpl: __local_6; @@ -219,17 +219,17 @@ condition: a matches { Some(s) && s == \"hello\" } if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("variant_infer_option_some"), used: 25 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_infer.wado"), used: 47 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("variant_infer_option_some"), used: 25 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_infer.wado"), used: 47 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(19, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: b matches { Some(n) && n == 42 } "), used: 45 }); break __tmpl: __local_8; @@ -263,17 +263,17 @@ fn variant_infer_result_annotated() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("variant_infer_result_annotated"), used: 30 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_infer.wado"), used: 47 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("variant_infer_result_annotated"), used: 30 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_infer.wado"), used: 47 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(26, __local_7); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: a matches { Ok(n) && n == 42 } "), used: 43 }); break __tmpl: __local_6; @@ -294,17 +294,17 @@ condition: a matches { Ok(n) && n == 42 } if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("variant_infer_result_annotated"), used: 30 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_infer.wado"), used: 47 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("variant_infer_result_annotated"), used: 30 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/variant_infer.wado"), used: 47 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(30, __local_9); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: b matches { Err(e) && e == \"fail\" } "), used: 48 }); break __tmpl: __local_8; @@ -517,7 +517,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -561,7 +561,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -599,7 +599,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l38; }; @@ -633,20 +633,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -656,10 +656,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -669,10 +669,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -680,10 +680,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/variant_struct_concat.wir.wado b/wado-compiler/tests/fixtures.golden/variant_struct_concat.wir.wado index 6ddf96834..81460dcf0 100644 --- a/wado-compiler/tests/fixtures.golden/variant_struct_concat.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_struct_concat.wir.wado @@ -58,7 +58,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String::concat" = fn(ref String, ref String) -> ref String; @@ -89,9 +89,9 @@ fn run() with Stdout { s = "./variant_struct_concat_module.wado/format_str"(String { repr: array.new_data("hi"), used: 2 }, opts); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append(__local_2, String { repr: array.new_data("["), used: 1 }); - String::append(__local_2, s); - String::append(__local_2, String { repr: array.new_data("]"), used: 1 }); + String::push_str(__local_2, String { repr: array.new_data("["), used: 1 }); + String::push_str(__local_2, s); + String::push_str(__local_2, String { repr: array.new_data("]"), used: 1 }); break __tmpl: __local_2; }); } @@ -226,7 +226,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/variant_struct_concat_module.wir.wado b/wado-compiler/tests/fixtures.golden/variant_struct_concat_module.wir.wado index 0bba9ec90..7d4ac780e 100644 --- a/wado-compiler/tests/fixtures.golden/variant_struct_concat_module.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_struct_concat_module.wir.wado @@ -58,7 +58,7 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String::concat" = fn(ref String, ref String) -> ref String; @@ -103,9 +103,9 @@ fn run() with Stdout { s = format_str(String { repr: array.new_data("hi"), used: 2 }, opts); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(18), used: 0 }; - String::append(__local_2, String { repr: array.new_data("["), used: 1 }); - String::append(__local_2, s); - String::append(__local_2, String { repr: array.new_data("]"), used: 1 }); + String::push_str(__local_2, String { repr: array.new_data("["), used: 1 }); + String::push_str(__local_2, s); + String::push_str(__local_2, String { repr: array.new_data("]"), used: 1 }); break __tmpl: __local_2; }); } @@ -226,7 +226,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/variant_value_semantics.wir.wado b/wado-compiler/tests/fixtures.golden/variant_value_semantics.wir.wado index 639186cb9..8b7dc6a26 100644 --- a/wado-compiler/tests/fixtures.golden/variant_value_semantics.wir.wado +++ b/wado-compiler/tests/fixtures.golden/variant_value_semantics.wir.wado @@ -101,7 +101,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -109,7 +109,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -175,7 +175,7 @@ fn run() with Stdout { r_2 = ref.cast Shape::Circle(c1).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_6, String { repr: array.new_data("c1 radius: "), used: 11 }); + String::push_str(__local_6, String { repr: array.new_data("c1 radius: "), used: 11 }); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; f64::fmt_into(r_2, __local_7); break __tmpl: __local_6; @@ -185,7 +185,7 @@ fn run() with Stdout { r_3 = ref.cast Shape::Circle(c1).payload_0; "core:cli/println"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(27), used: 0 }; - String::append(__local_8, String { repr: array.new_data("c2 radius: "), used: 11 }); + String::push_str(__local_8, String { repr: array.new_data("c2 radius: "), used: 11 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; f64::fmt_into(r_3, __local_9); break __tmpl: __local_8; @@ -961,7 +961,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1016,7 +1016,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1048,7 +1048,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1130,25 +1130,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1249,9 +1249,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1305,13 +1305,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1346,9 +1346,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1389,7 +1389,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/wasi_cli.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_cli.wir.wado index 8ff96ad28..ec9921cad 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_cli.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_cli.wir.wado @@ -99,15 +99,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, ref String); +type "functype/Array::push" = fn(ref Array, ref String); type "functype/Array::grow" = fn(ref Array); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[String, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[String, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -151,7 +151,7 @@ fn run() with Stdout, Stderr, Environment { arguments = __cm_binding__Environment_get_arguments(); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(57), used: 0 }; - String::append(__local_2, String { repr: array.new_data("test: Environment::get_arguments().len = "), used: 41 }); + String::push_str(__local_2, String { repr: array.new_data("test: Environment::get_arguments().len = "), used: 41 }); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(arguments.used, __local_3); break __tmpl: __local_2; @@ -159,7 +159,7 @@ fn run() with Stdout, Stderr, Environment { env_vars = __cm_binding__Environment_get_environment(); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(59), used: 0 }; - String::append(__local_4, String { repr: array.new_data("test: Environment::get_environment().len = "), used: 43 }); + String::push_str(__local_4, String { repr: array.new_data("test: Environment::get_environment().len = "), used: 43 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(env_vars.used, __local_5); break __tmpl: __local_4; @@ -214,7 +214,7 @@ fn __cm_binding__Environment_get_environment() { __local_16 = "core:internal/memory_to_gc_array"(__local_14, __local_15); break __inline_memory_to_gc_string_3: String { repr: __local_16, used: __local_15 }; }; - Array>::append(__result, "tuple/[String, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[String, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 0), builtin::load_i32((__elem_addr + 0) + 4), 1, 0)); drop("mem/realloc"(builtin::load_i32(__elem_addr + 8), builtin::load_i32((__elem_addr + 8) + 4), 1, 0)); __i = __i + 1; @@ -250,7 +250,7 @@ fn __cm_binding__Environment_get_arguments() { break b4; }; __elem_addr = __base + (__i * 8); - Array::append(__result, __inline_memory_to_gc_string_1: block -> ref String { + Array::push(__result, __inline_memory_to_gc_string_1: block -> ref String { __local_7 = builtin::load_i32(__elem_addr); __local_8 = builtin::load_i32(__elem_addr + 4); __local_9 = "core:internal/memory_to_gc_array"(__local_7, __local_8); @@ -494,7 +494,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -509,7 +509,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -536,7 +536,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -578,7 +578,7 @@ fn Array::grow(self) { self.repr = new_repr; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -631,7 +631,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l42; }; @@ -665,20 +665,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -688,10 +688,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -701,10 +701,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -712,10 +712,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasi_cli_terminal.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_cli_terminal.wir.wado index 6955d3607..faff710bd 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_cli_terminal.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_cli_terminal.wir.wado @@ -104,9 +104,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -161,22 +161,22 @@ fn run() with Stdout, TerminalStdin, TerminalStdout, TerminalStderr { if __cond_1 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_6, 114); - String::append_char(__local_6, 117); - String::append_char(__local_6, 110); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_cli_terminal.wado"), used: 51 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_6, 114); + String::push(__local_6, 117); + String::push(__local_6, 110); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_cli_terminal.wado"), used: 51 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(10, __local_7); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("stdin terminal should be None"), used: 29 }); - String::append(__local_6, String { repr: array.new_data(" + String::push(__local_6, 58); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("stdin terminal should be None"), used: 29 }); + String::push_str(__local_6, String { repr: array.new_data(" condition: stdin_terminal matches { None } "), used: 44 }); break __tmpl: __local_6; @@ -194,22 +194,22 @@ condition: stdin_terminal matches { None } if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_8, 114); - String::append_char(__local_8, 117); - String::append_char(__local_8, 110); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_cli_terminal.wado"), used: 51 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_8, 114); + String::push(__local_8, 117); + String::push(__local_8, 110); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_cli_terminal.wado"), used: 51 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; i32::fmt_decimal(13, __local_9); - String::append_char(__local_8, 58); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("stdout terminal should be None"), used: 30 }); - String::append(__local_8, String { repr: array.new_data(" + String::push(__local_8, 58); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("stdout terminal should be None"), used: 30 }); + String::push_str(__local_8, String { repr: array.new_data(" condition: stdout_terminal matches { None } "), used: 45 }); break __tmpl: __local_8; @@ -227,22 +227,22 @@ condition: stdout_terminal matches { None } if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_cli_terminal.wado"), used: 51 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_cli_terminal.wado"), used: 51 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; i32::fmt_decimal(16, __local_11); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("stderr terminal should be None"), used: 30 }); - String::append(__local_10, String { repr: array.new_data(" + String::push(__local_10, 58); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("stderr terminal should be None"), used: 30 }); + String::push_str(__local_10, String { repr: array.new_data(" condition: stderr_terminal matches { None } "), used: 45 }); break __tmpl: __local_10; @@ -529,7 +529,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -544,7 +544,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -582,7 +582,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l33; }; @@ -616,20 +616,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -639,10 +639,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -652,10 +652,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -663,10 +663,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasi_clocks_full.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_clocks_full.wir.wado index ea9e75d16..48310f139 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_clocks_full.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_clocks_full.wir.wado @@ -127,9 +127,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -190,40 +190,40 @@ fn __test_0_monotonic__now_is_non_decreasing() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_0_monotonic__now_is_non_decreasing"), used: 41 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_0_monotonic__now_is_non_decreasing"), used: 41 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(6, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: t2 >= t1 "), used: 21 }); - String::append_char(__local_5, 116); - String::append_char(__local_5, 50); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 116); + String::push(__local_5, 50); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_16 = __local_6; u64::fmt_decimal(t2, __local_16); __local_22 = String { repr: array.new_data(" as Mark"), used: 8 }; - String::append(__local_16.buf, __local_22); - String::append_char(__local_5, 10); - String::append_char(__local_5, 116); - String::append_char(__local_5, 49); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push_str(__local_16.buf, __local_22); + String::push(__local_5, 10); + String::push(__local_5, 116); + String::push(__local_5, 49); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_25 = __local_6; u64::fmt_decimal(t1, __local_25); __local_31 = String { repr: array.new_data(" as Mark"), used: 8 }; - String::append(__local_25.buf, __local_31); - String::append_char(__local_5, 10); + String::push_str(__local_25.buf, __local_31); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -243,31 +243,31 @@ fn __test_1_monotonic__resolution_is_positive() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_1_monotonic__resolution_is_positive"), used: 42 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_1_monotonic__resolution_is_positive"), used: 42 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(11, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: res > 0 "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 101); - String::append_char(__local_3, 115); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 114); + String::push(__local_3, 101); + String::push(__local_3, 115); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; u64::fmt_decimal(res, __local_14); __local_20 = String { repr: array.new_data(" as Duration"), used: 12 }; - String::append(__local_14.buf, __local_20); - String::append_char(__local_3, 10); + String::push_str(__local_14.buf, __local_20); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -292,47 +292,47 @@ fn __test_2_monotonic__wait_for_advances_clock() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_2_monotonic__wait_for_advances_clock"), used: 43 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_2_monotonic__wait_for_advances_clock"), used: 43 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(18, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: after >= before "), used: 28 }); - String::append_char(__local_5, 97); - String::append_char(__local_5, 102); - String::append_char(__local_5, 116); - String::append_char(__local_5, 101); - String::append_char(__local_5, 114); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 102); + String::push(__local_5, 116); + String::push(__local_5, 101); + String::push(__local_5, 114); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_16 = __local_6; u64::fmt_decimal(after, __local_16); __local_22 = String { repr: array.new_data(" as Mark"), used: 8 }; - String::append(__local_16.buf, __local_22); - String::append_char(__local_5, 10); - String::append_char(__local_5, 98); - String::append_char(__local_5, 101); - String::append_char(__local_5, 102); - String::append_char(__local_5, 111); - String::append_char(__local_5, 114); - String::append_char(__local_5, 101); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push_str(__local_16.buf, __local_22); + String::push(__local_5, 10); + String::push(__local_5, 98); + String::push(__local_5, 101); + String::push(__local_5, 102); + String::push(__local_5, 111); + String::push(__local_5, 114); + String::push(__local_5, 101); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_25 = __local_6; u64::fmt_decimal(before, __local_25); __local_31 = String { repr: array.new_data(" as Mark"), used: 8 }; - String::append(__local_25.buf, __local_31); - String::append_char(__local_5, 10); + String::push_str(__local_25.buf, __local_31); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -359,47 +359,47 @@ fn __test_3_monotonic__wait_until_reaches_target() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_6, String { repr: array.new_data("__test_3_monotonic__wait_until_reaches_target"), used: 45 }); - String::append_char(__local_6, 32); - String::append_char(__local_6, 97); - String::append_char(__local_6, 116); - String::append_char(__local_6, 32); - String::append(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); - String::append_char(__local_6, 58); + String::push_str(__local_6, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_6, String { repr: array.new_data("__test_3_monotonic__wait_until_reaches_target"), used: 45 }); + String::push(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 116); + String::push(__local_6, 32); + String::push_str(__local_6, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); + String::push(__local_6, 58); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_12 = __local_7; i32::fmt_decimal(26, __local_12); - String::append(__local_6, String { repr: array.new_data(" + String::push_str(__local_6, String { repr: array.new_data(" condition: after >= target "), used: 28 }); - String::append_char(__local_6, 97); - String::append_char(__local_6, 102); - String::append_char(__local_6, 116); - String::append_char(__local_6, 101); - String::append_char(__local_6, 114); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 97); + String::push(__local_6, 102); + String::push(__local_6, 116); + String::push(__local_6, 101); + String::push(__local_6, 114); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_17 = __local_7; u64::fmt_decimal(after, __local_17); __local_23 = String { repr: array.new_data(" as Mark"), used: 8 }; - String::append(__local_17.buf, __local_23); - String::append_char(__local_6, 10); - String::append_char(__local_6, 116); - String::append_char(__local_6, 97); - String::append_char(__local_6, 114); - String::append_char(__local_6, 103); - String::append_char(__local_6, 101); - String::append_char(__local_6, 116); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push_str(__local_17.buf, __local_23); + String::push(__local_6, 10); + String::push(__local_6, 116); + String::push(__local_6, 97); + String::push(__local_6, 114); + String::push(__local_6, 103); + String::push(__local_6, 101); + String::push(__local_6, 116); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; __local_26 = __local_7; u64::fmt_decimal(target, __local_26); __local_32 = String { repr: array.new_data(" as Mark"), used: 8 }; - String::append(__local_26.buf, __local_32); - String::append_char(__local_6, 10); + String::push_str(__local_26.buf, __local_32); + String::push(__local_6, 10); break __tmpl: __local_6; }); unreachable; @@ -424,47 +424,47 @@ fn __test_4_monotonic__wait_for_zero_returns_immediately() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(150), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_4_monotonic__wait_for_zero_returns_immediately"), used: 53 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_4_monotonic__wait_for_zero_returns_immediately"), used: 53 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_11 = __local_6; i32::fmt_decimal(33, __local_11); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: after >= before "), used: 28 }); - String::append_char(__local_5, 97); - String::append_char(__local_5, 102); - String::append_char(__local_5, 116); - String::append_char(__local_5, 101); - String::append_char(__local_5, 114); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 102); + String::push(__local_5, 116); + String::push(__local_5, 101); + String::push(__local_5, 114); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_16 = __local_6; u64::fmt_decimal(after, __local_16); __local_22 = String { repr: array.new_data(" as Mark"), used: 8 }; - String::append(__local_16.buf, __local_22); - String::append_char(__local_5, 10); - String::append_char(__local_5, 98); - String::append_char(__local_5, 101); - String::append_char(__local_5, 102); - String::append_char(__local_5, 111); - String::append_char(__local_5, 114); - String::append_char(__local_5, 101); - String::append_char(__local_5, 58); - String::append_char(__local_5, 32); + String::push_str(__local_16.buf, __local_22); + String::push(__local_5, 10); + String::push(__local_5, 98); + String::push(__local_5, 101); + String::push(__local_5, 102); + String::push(__local_5, 111); + String::push(__local_5, 114); + String::push(__local_5, 101); + String::push(__local_5, 58); + String::push(__local_5, 32); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_25 = __local_6; u64::fmt_decimal(before, __local_25); __local_31 = String { repr: array.new_data(" as Mark"), used: 8 }; - String::append(__local_25.buf, __local_31); - String::append_char(__local_5, 10); + String::push_str(__local_25.buf, __local_31); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -485,33 +485,33 @@ fn __test_5_monotonic__wait_until_past_returns_immediately() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_5_monotonic__wait_until_past_returns_immediately"), used: 55 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_5_monotonic__wait_until_past_returns_immediately"), used: 55 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(39, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: after > 0 "), used: 22 }); - String::append_char(__local_3, 97); - String::append_char(__local_3, 102); - String::append_char(__local_3, 116); - String::append_char(__local_3, 101); - String::append_char(__local_3, 114); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 102); + String::push(__local_3, 116); + String::push(__local_3, 101); + String::push(__local_3, 114); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; u64::fmt_decimal(after, __local_14); __local_20 = String { repr: array.new_data(" as Mark"), used: 8 }; - String::append(__local_14.buf, __local_20); - String::append_char(__local_3, 10); + String::push_str(__local_14.buf, __local_20); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -538,25 +538,25 @@ fn __test_6_system_clock__now_returns_valid_instant() { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_5 = String { repr: builtin::array_new(139), used: 0 }; - String::append(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_5, String { repr: array.new_data("__test_6_system_clock__now_returns_valid_instant"), used: 48 }); - String::append_char(__local_5, 32); - String::append_char(__local_5, 97); - String::append_char(__local_5, 116); - String::append_char(__local_5, 32); - String::append(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); - String::append_char(__local_5, 58); + String::push_str(__local_5, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_5, String { repr: array.new_data("__test_6_system_clock__now_returns_valid_instant"), used: 48 }); + String::push(__local_5, 32); + String::push(__local_5, 97); + String::push(__local_5, 116); + String::push(__local_5, 32); + String::push_str(__local_5, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); + String::push(__local_5, 58); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_13 = __local_6; i32::fmt_decimal(44, __local_13); - String::append(__local_5, String { repr: array.new_data(" + String::push_str(__local_5, String { repr: array.new_data(" condition: instant.seconds > 0 "), used: 32 }); - String::append(__local_5, String { repr: array.new_data("instant.seconds: "), used: 17 }); + String::push_str(__local_5, String { repr: array.new_data("instant.seconds: "), used: 17 }); __local_6 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_5 }; __local_18 = __local_6; i64::fmt_decimal(__v0_1, __local_18); - String::append_char(__local_5, 10); + String::push(__local_5, 10); break __tmpl: __local_5; }); unreachable; @@ -566,25 +566,25 @@ condition: instant.seconds > 0 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(166), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_6_system_clock__now_returns_valid_instant"), used: 48 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_6_system_clock__now_returns_valid_instant"), used: 48 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_24 = __local_8; i32::fmt_decimal(45, __local_24); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: instant.nanoseconds < 1_000_000_000 as u32 "), used: 55 }); - String::append(__local_7, String { repr: array.new_data("instant.nanoseconds: "), used: 21 }); + String::push_str(__local_7, String { repr: array.new_data("instant.nanoseconds: "), used: 21 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_29 = __local_8; u32::fmt_decimal(__v0_3, __local_29); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -604,31 +604,31 @@ fn __test_7_system_clock__resolution_is_positive() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(115), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_7_system_clock__resolution_is_positive"), used: 45 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_7_system_clock__resolution_is_positive"), used: 45 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(50, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: res > 0 "), used: 20 }); - String::append_char(__local_3, 114); - String::append_char(__local_3, 101); - String::append_char(__local_3, 115); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 114); + String::push(__local_3, 101); + String::push(__local_3, 115); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; u64::fmt_decimal(res, __local_14); __local_20 = String { repr: array.new_data(" as Duration"), used: 12 }; - String::append(__local_14.buf, __local_20); - String::append_char(__local_3, 10); + String::push_str(__local_14.buf, __local_20); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -656,30 +656,30 @@ fn __test_8_system_clock__two_reads_are_consistent() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_8 = String { repr: builtin::array_new(184), used: 0 }; - String::append(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_8, String { repr: array.new_data("__test_8_system_clock__two_reads_are_consistent"), used: 47 }); - String::append_char(__local_8, 32); - String::append_char(__local_8, 97); - String::append_char(__local_8, 116); - String::append_char(__local_8, 32); - String::append(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); - String::append_char(__local_8, 58); + String::push_str(__local_8, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_8, String { repr: array.new_data("__test_8_system_clock__two_reads_are_consistent"), used: 47 }); + String::push(__local_8, 32); + String::push(__local_8, 97); + String::push(__local_8, 116); + String::push(__local_8, 32); + String::push_str(__local_8, String { repr: array.new_data("wado-compiler/tests/fixtures/wasi_clocks_full.wado"), used: 50 }); + String::push(__local_8, 58); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_20 = __local_9; i32::fmt_decimal(59, __local_20); - String::append(__local_8, String { repr: array.new_data(" + String::push_str(__local_8, String { repr: array.new_data(" condition: t2.nanoseconds >= t1.nanoseconds "), used: 45 }); - String::append(__local_8, String { repr: array.new_data("t2.nanoseconds: "), used: 16 }); + String::push_str(__local_8, String { repr: array.new_data("t2.nanoseconds: "), used: 16 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_25 = __local_9; u32::fmt_decimal(__v0, __local_25); - String::append_char(__local_8, 10); - String::append(__local_8, String { repr: array.new_data("t1.nanoseconds: "), used: 16 }); + String::push(__local_8, 10); + String::push_str(__local_8, String { repr: array.new_data("t1.nanoseconds: "), used: 16 }); __local_9 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_8 }; __local_30 = __local_9; u32::fmt_decimal(__v1, __local_30); - String::append_char(__local_8, 10); + String::push(__local_8, 10); break __tmpl: __local_8; }); unreachable; @@ -1153,7 +1153,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1168,7 +1168,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1206,7 +1206,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l54; }; @@ -1240,20 +1240,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1263,10 +1263,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1276,10 +1276,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1287,10 +1287,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem.wir.wado index 26b606d78..4a5935cc1 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem.wir.wado @@ -90,11 +90,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -136,10 +136,10 @@ fn run() with Stdout, Preopens { dir_count = dirs.used; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(52), used: 0 }; - String::append(__local_4, String { repr: array.new_data("test: preopens returned "), used: 24 }); + String::push_str(__local_4, String { repr: array.new_data("test: preopens returned "), used: 24 }); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(dir_count, __local_5); - String::append(__local_4, String { repr: array.new_data(" directories"), used: 12 }); + String::push_str(__local_4, String { repr: array.new_data(" directories"), used: 12 }); break __tmpl: __local_4; }); if dir_count > 0 { @@ -196,7 +196,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l4; @@ -457,7 +457,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -472,7 +472,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -499,7 +499,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -552,7 +552,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l38; }; @@ -586,20 +586,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -609,10 +609,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -622,10 +622,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -633,10 +633,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_advise_sync.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_advise_sync.wir.wado index 579445727..5b2a67b88 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_advise_sync.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_advise_sync.wir.wado @@ -227,11 +227,11 @@ type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -407,7 +407,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l11; @@ -1440,7 +1440,7 @@ fn "core:internal/cm_waitable_set_wait"(ws) { // from core:internal return code; evt_handle; payload; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1482,7 +1482,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_append_stream.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_append_stream.wir.wado index fcba94c44..9a4153271 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_append_stream.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_append_stream.wir.wado @@ -168,11 +168,11 @@ type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -338,7 +338,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l7; @@ -818,7 +818,7 @@ fn "core:internal/cm_waitable_set_wait"(ws) { // from core:internal return code; evt_handle; payload; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -860,7 +860,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_dir_ops.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_dir_ops.wir.wado index e51f2e521..5e28ef1ba 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_dir_ops.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_dir_ops.wir.wado @@ -197,15 +197,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -383,7 +383,7 @@ fn run() with Stdout, Stderr, Preopens { }; "core:cli/println"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(48), used: 0 }; - String::append(__local_17, String { repr: array.new_data("read_directory: total entries = "), used: 32 }); + String::push_str(__local_17, String { repr: array.new_data("read_directory: total entries = "), used: 32 }); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; i32::fmt_decimal(entry_count, __local_18); break __tmpl: __local_17; @@ -442,7 +442,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l22; @@ -1017,7 +1017,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1061,7 +1061,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1088,7 +1088,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1151,7 +1151,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l142; }; @@ -1185,20 +1185,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1208,10 +1208,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1221,10 +1221,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1232,10 +1232,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_get_type.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_get_type.wir.wado index ef6b62857..ae6a2acb5 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_get_type.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_get_type.wir.wado @@ -195,7 +195,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -362,7 +362,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l14; @@ -981,7 +981,7 @@ fn "core:internal/cm_waitable_set_wait"(ws) { // from core:internal return code; evt_handle; payload; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_metadata_hash.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_metadata_hash.wir.wado index b65a051ae..0e9d565c6 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_metadata_hash.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_metadata_hash.wir.wado @@ -173,7 +173,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -329,7 +329,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l12; @@ -937,7 +937,7 @@ fn "core:internal/cm_waitable_set_wait"(ws) { // from core:internal return code; evt_handle; payload; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_open_at.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_open_at.wir.wado index e93f621f1..8d11e925d 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_open_at.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_open_at.wir.wado @@ -143,9 +143,9 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -204,9 +204,9 @@ fn run() with Stdout, Stderr, Preopens { }.1; "core:cli/println"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(43), used: 0 }; - String::append(__local_7, String { repr: array.new_data("open_at: preopened dir = \""), used: 26 }); - String::append(__local_7, preopen_path); - String::append(__local_7, String { repr: array.new_data("\""), used: 1 }); + String::push_str(__local_7, String { repr: array.new_data("open_at: preopened dir = \""), used: 26 }); + String::push_str(__local_7, preopen_path); + String::push_str(__local_7, String { repr: array.new_data("\""), used: 1 }); break __tmpl: __local_7; }); open_result = __cm_binding__Descriptor_open_at(dir, 0, String { repr: array.new_data("hello.txt"), used: 9 }, 0, 1); @@ -264,7 +264,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l6; @@ -640,7 +640,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -655,7 +655,7 @@ fn String::append(self, other) { self.used = new_used; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_open_flags.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_open_flags.wir.wado index d1418ed18..7ecadf0ca 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_open_flags.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_open_flags.wir.wado @@ -155,7 +155,7 @@ type "functype/core:internal/wait_for_blocked" = fn(i32) -> i32; type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -281,7 +281,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l8; @@ -751,7 +751,7 @@ fn "core:internal/cm_waitable_set_wait"(ws) { // from core:internal return code; evt_handle; payload; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_read_stream.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_read_stream.wir.wado index 83245daf9..e5a97d599 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_read_stream.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_read_stream.wir.wado @@ -152,7 +152,7 @@ type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -287,7 +287,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l7; @@ -675,7 +675,7 @@ fn "core:internal/cm_waitable_set_wait"(ws) { // from core:internal return code; evt_handle; payload; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_read_transform_stream.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_read_transform_stream.wir.wado index ca19929d1..2d6a83beb 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_read_transform_stream.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_read_transform_stream.wir.wado @@ -148,11 +148,11 @@ type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -223,9 +223,9 @@ fn to_upper(data) { } else { 0; } { - Array::append(result, (b - 32) & 255); + Array::push(result, (b - 32) & 255); } else { - Array::append(result, b); + Array::push(result, b); }; i = i + 1; continue l1; @@ -322,7 +322,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l12; @@ -678,7 +678,7 @@ fn "core:internal/cm_waitable_set_wait"(ws) { // from core:internal return code; evt_handle; payload; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -720,7 +720,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_rename_unlink.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_rename_unlink.wir.wado index ef0543e40..6656d2428 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_rename_unlink.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_rename_unlink.wir.wado @@ -236,15 +236,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -376,10 +376,10 @@ fn run() with Stdout, Stderr, Preopens { sz = stat.size; "core:cli/eprintln"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(56), used: 0 }; - String::append(__local_21, String { repr: array.new_data("rename: destination size is "), used: 28 }); + String::push_str(__local_21, String { repr: array.new_data("rename: destination size is "), used: 28 }); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; u64::fmt_decimal(sz, __local_22); - String::append(__local_21, String { repr: array.new_data(", expected 6"), used: 12 }); + String::push_str(__local_21, String { repr: array.new_data(", expected 6"), used: 12 }); break __tmpl: __local_21; }); }; @@ -454,7 +454,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l14; @@ -1394,7 +1394,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1409,7 +1409,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1436,7 +1436,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1478,7 +1478,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1531,7 +1531,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l223; }; @@ -1565,20 +1565,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1588,10 +1588,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1601,10 +1601,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1612,10 +1612,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_set_size.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_set_size.wir.wado index 71fd72b25..a6a01275b 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_set_size.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_set_size.wir.wado @@ -254,15 +254,15 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -367,7 +367,7 @@ fn read_all(file) { multivalue_bind [__sroa___pattern_temp_1_discriminant, __sroa___pattern_temp_1_payload_0] = ArrayIter^Iterator::next(__iter_6); if __sroa___pattern_temp_1_discriminant == 0 { b = __sroa___pattern_temp_1_payload_0; - Array::append(result, b); + Array::push(result, b); } else { break b3; }; @@ -438,10 +438,10 @@ fn run() with Stdout, Stderr, Preopens { sz_8 = s_7.size; "core:cli/eprintln"(__tmpl: block -> ref String { __local_18 = String { repr: builtin::array_new(55), used: 0 }; - String::append(__local_18, String { repr: array.new_data("set_size: initial size is "), used: 26 }); + String::push_str(__local_18, String { repr: array.new_data("set_size: initial size is "), used: 26 }); __local_19 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_18 }; u64::fmt_decimal(sz_8, __local_19); - String::append(__local_18, String { repr: array.new_data(", expected 10"), used: 13 }); + String::push_str(__local_18, String { repr: array.new_data(", expected 10"), used: 13 }); break __tmpl: __local_18; }); }; @@ -462,10 +462,10 @@ fn run() with Stdout, Stderr, Preopens { sz_12 = s_11.size; "core:cli/eprintln"(__tmpl: block -> ref String { __local_20 = String { repr: builtin::array_new(56), used: 0 }; - String::append(__local_20, String { repr: array.new_data("set_size: truncated size is "), used: 28 }); + String::push_str(__local_20, String { repr: array.new_data("set_size: truncated size is "), used: 28 }); __local_21 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_20 }; u64::fmt_decimal(sz_12, __local_21); - String::append(__local_20, String { repr: array.new_data(", expected 5"), used: 12 }); + String::push_str(__local_20, String { repr: array.new_data(", expected 5"), used: 12 }); break __tmpl: __local_20; }); }; @@ -526,7 +526,7 @@ fn run() with Stdout, Stderr, Preopens { } else { "core:cli/eprintln"(__tmpl: block -> ref String { __local_22 = String { repr: builtin::array_new(60), used: 0 }; - String::append(__local_22, String { repr: array.new_data("set_size: truncated content unexpected, len="), used: 44 }); + String::push_str(__local_22, String { repr: array.new_data("set_size: truncated content unexpected, len="), used: 44 }); __local_23 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_22 }; i32::fmt_decimal(content.used, __local_23); break __tmpl: __local_22; @@ -547,10 +547,10 @@ fn run() with Stdout, Stderr, Preopens { sz_17 = s_16.size; "core:cli/eprintln"(__tmpl: block -> ref String { __local_24 = String { repr: builtin::array_new(55), used: 0 }; - String::append(__local_24, String { repr: array.new_data("set_size: extended size is "), used: 27 }); + String::push_str(__local_24, String { repr: array.new_data("set_size: extended size is "), used: 27 }); __local_25 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_24 }; u64::fmt_decimal(sz_17, __local_25); - String::append(__local_24, String { repr: array.new_data(", expected 8"), used: 12 }); + String::push_str(__local_24, String { repr: array.new_data(", expected 8"), used: 12 }); break __tmpl: __local_24; }); }; @@ -617,7 +617,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l29; @@ -1624,7 +1624,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1639,7 +1639,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1666,7 +1666,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1708,7 +1708,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1771,7 +1771,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l249; }; @@ -1805,20 +1805,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1828,10 +1828,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1841,10 +1841,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1852,10 +1852,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_set_times.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_set_times.wir.wado index aa77b7a9f..4ed1c5f44 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_set_times.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_set_times.wir.wado @@ -234,11 +234,11 @@ type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -404,7 +404,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l10; @@ -1362,7 +1362,7 @@ fn "core:internal/cm_waitable_set_wait"(ws) { // from core:internal return code; evt_handle; payload; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1404,7 +1404,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_stat.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_stat.wir.wado index f7a01ce43..2b5f4bbad 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_stat.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_stat.wir.wado @@ -211,11 +211,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -294,7 +294,7 @@ fn run() with Stdout, Stderr, Preopens { size_u64 = stat.size; "core:cli/eprintln"(__tmpl: block -> ref String { __local_9 = String { repr: builtin::array_new(42), used: 0 }; - String::append(__local_9, String { repr: array.new_data("stat_at: unexpected size: "), used: 26 }); + String::push_str(__local_9, String { repr: array.new_data("stat_at: unexpected size: "), used: 26 }); __local_10 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_9 }; u64::fmt_decimal(size_u64, __local_10); break __tmpl: __local_9; @@ -367,7 +367,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l9; @@ -1238,7 +1238,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1253,7 +1253,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1280,7 +1280,7 @@ fn String::append_char(self, c) { }; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1333,7 +1333,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l186; }; @@ -1367,20 +1367,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1390,10 +1390,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1403,10 +1403,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1414,10 +1414,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_symlink.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_symlink.wir.wado index b1963fd6b..0018edd30 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_symlink.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_symlink.wir.wado @@ -252,13 +252,13 @@ type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i3 type "functype/String::grow" = fn(ref String, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); @@ -362,8 +362,8 @@ fn run() with Stdout, Stderr, Preopens { } else { "core:cli/eprintln"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(48), used: 0 }; - String::append(__local_17, String { repr: array.new_data("readlink_at: unexpected target: "), used: 32 }); - String::append(__local_17, target); + String::push_str(__local_17, String { repr: array.new_data("readlink_at: unexpected target: "), used: 32 }); + String::push_str(__local_17, target); break __tmpl: __local_17; }); }; @@ -494,7 +494,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l22; @@ -1805,7 +1805,7 @@ fn String::grow(self, min_capacity) { self.repr = new_repr; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1849,7 +1849,7 @@ fn String^Eq::eq_bytes(a, b, len) { return 1; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasi_filesystem_write_stream.wir.wado b/wado-compiler/tests/fixtures.golden/wasi_filesystem_write_stream.wir.wado index da9cd5240..9a408704d 100644 --- a/wado-compiler/tests/fixtures.golden/wasi_filesystem_write_stream.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasi_filesystem_write_stream.wir.wado @@ -164,11 +164,11 @@ type "functype/core:internal/cm_stream_write_u8" = fn(i32, ref Array); type "functype/core:internal/cm_stream_write_raw_u8" = fn(i32, ref array, i32); -type "functype/Array>::append" = fn(ref Array>, ref "tuple/[Descriptor, String]"); +type "functype/Array>::push" = fn(ref Array>, ref "tuple/[Descriptor, String]"); type "functype/Array>::grow" = fn(ref Array>); -type "functype/Array::append" = fn(ref Array, u8); +type "functype/Array::push" = fn(ref Array, u8); type "functype/Array::grow" = fn(ref Array); @@ -316,7 +316,7 @@ fn __cm_binding__Preopens_get_directories() { __local_11 = "core:internal/memory_to_gc_array"(__local_9, __local_10); break __inline_memory_to_gc_string_1: String { repr: __local_11, used: __local_10 }; }; - Array>::append(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); + Array>::push(__result, "tuple/[Descriptor, String]" { 0: __lifted_result_6, 1: __lifted_result_7 }); drop("mem/realloc"(builtin::load_i32(__elem_addr + 4), builtin::load_i32((__elem_addr + 4) + 4), 1, 0)); __i = __i + 1; continue l7; @@ -792,7 +792,7 @@ fn "core:internal/cm_waitable_set_wait"(ws) { // from core:internal return code; evt_handle; payload; } -fn Array>::append(self, value) { +fn Array>::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -834,7 +834,7 @@ fn Array>::grow(self) { self.repr = new_repr; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { diff --git a/wado-compiler/tests/fixtures.golden/wasm_instructions_float_math.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_instructions_float_math.wir.wado index d4c838764..403499e5c 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_instructions_float_math.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_instructions_float_math.wir.wado @@ -91,7 +91,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -99,7 +99,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -250,14 +250,14 @@ fn run() with Stdout { abs_pos = builtin::f64_abs(3.5); "core:cli/println"(__tmpl: block -> ref String { __local_30 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_30, String { repr: array.new_data("f64_abs(-3.5) = "), used: 16 }); + String::push_str(__local_30, String { repr: array.new_data("f64_abs(-3.5) = "), used: 16 }); __local_31 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_30 }; f64::fmt_into(abs_neg, __local_31); break __tmpl: __local_30; }); "core:cli/println"(__tmpl: block -> ref String { __local_32 = String { repr: builtin::array_new(31), used: 0 }; - String::append(__local_32, String { repr: array.new_data("f64_abs(3.5) = "), used: 15 }); + String::push_str(__local_32, String { repr: array.new_data("f64_abs(3.5) = "), used: 15 }); __local_33 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_32 }; f64::fmt_into(abs_pos, __local_33); break __tmpl: __local_32; @@ -265,7 +265,7 @@ fn run() with Stdout { abs_neg32 = builtin::f32_abs(builtin::f32_demote_f64(-2.5)); "core:cli/println"(__tmpl: block -> ref String { __local_34 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_34, String { repr: array.new_data("f32_abs(-2.5) = "), used: 16 }); + String::push_str(__local_34, String { repr: array.new_data("f32_abs(-2.5) = "), used: 16 }); __local_35 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_34 }; f32::fmt_into(abs_neg32, __local_35); break __tmpl: __local_34; @@ -275,21 +275,21 @@ fn run() with Stdout { ceil3 = builtin::f64_ceil(2); "core:cli/println"(__tmpl: block -> ref String { __local_36 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_36, String { repr: array.new_data("f64_ceil(2.3) = "), used: 16 }); + String::push_str(__local_36, String { repr: array.new_data("f64_ceil(2.3) = "), used: 16 }); __local_37 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_36 }; f64::fmt_into(ceil1, __local_37); break __tmpl: __local_36; }); "core:cli/println"(__tmpl: block -> ref String { __local_38 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_38, String { repr: array.new_data("f64_ceil(-2.3) = "), used: 17 }); + String::push_str(__local_38, String { repr: array.new_data("f64_ceil(-2.3) = "), used: 17 }); __local_39 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_38 }; f64::fmt_into(ceil2, __local_39); break __tmpl: __local_38; }); "core:cli/println"(__tmpl: block -> ref String { __local_40 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_40, String { repr: array.new_data("f64_ceil(2.0) = "), used: 16 }); + String::push_str(__local_40, String { repr: array.new_data("f64_ceil(2.0) = "), used: 16 }); __local_41 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_40 }; f64::fmt_into(ceil3, __local_41); break __tmpl: __local_40; @@ -299,21 +299,21 @@ fn run() with Stdout { floor3 = builtin::f64_floor(2); "core:cli/println"(__tmpl: block -> ref String { __local_42 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_42, String { repr: array.new_data("f64_floor(2.7) = "), used: 17 }); + String::push_str(__local_42, String { repr: array.new_data("f64_floor(2.7) = "), used: 17 }); __local_43 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_42 }; f64::fmt_into(floor1, __local_43); break __tmpl: __local_42; }); "core:cli/println"(__tmpl: block -> ref String { __local_44 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_44, String { repr: array.new_data("f64_floor(-2.7) = "), used: 18 }); + String::push_str(__local_44, String { repr: array.new_data("f64_floor(-2.7) = "), used: 18 }); __local_45 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_44 }; f64::fmt_into(floor2, __local_45); break __tmpl: __local_44; }); "core:cli/println"(__tmpl: block -> ref String { __local_46 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_46, String { repr: array.new_data("f64_floor(2.0) = "), used: 17 }); + String::push_str(__local_46, String { repr: array.new_data("f64_floor(2.0) = "), used: 17 }); __local_47 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_46 }; f64::fmt_into(floor3, __local_47); break __tmpl: __local_46; @@ -322,14 +322,14 @@ fn run() with Stdout { trunc2 = builtin::f64_trunc(-2.9); "core:cli/println"(__tmpl: block -> ref String { __local_48 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_48, String { repr: array.new_data("f64_trunc(2.9) = "), used: 17 }); + String::push_str(__local_48, String { repr: array.new_data("f64_trunc(2.9) = "), used: 17 }); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; f64::fmt_into(trunc1, __local_49); break __tmpl: __local_48; }); "core:cli/println"(__tmpl: block -> ref String { __local_50 = String { repr: builtin::array_new(34), used: 0 }; - String::append(__local_50, String { repr: array.new_data("f64_trunc(-2.9) = "), used: 18 }); + String::push_str(__local_50, String { repr: array.new_data("f64_trunc(-2.9) = "), used: 18 }); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; f64::fmt_into(trunc2, __local_51); break __tmpl: __local_50; @@ -340,28 +340,28 @@ fn run() with Stdout { near4 = builtin::f64_nearest(2.7); "core:cli/println"(__tmpl: block -> ref String { __local_52 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_52, String { repr: array.new_data("f64_nearest(2.5) = "), used: 19 }); + String::push_str(__local_52, String { repr: array.new_data("f64_nearest(2.5) = "), used: 19 }); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; f64::fmt_into(near1, __local_53); break __tmpl: __local_52; }); "core:cli/println"(__tmpl: block -> ref String { __local_54 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_54, String { repr: array.new_data("f64_nearest(3.5) = "), used: 19 }); + String::push_str(__local_54, String { repr: array.new_data("f64_nearest(3.5) = "), used: 19 }); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; f64::fmt_into(near2, __local_55); break __tmpl: __local_54; }); "core:cli/println"(__tmpl: block -> ref String { __local_56 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_56, String { repr: array.new_data("f64_nearest(2.3) = "), used: 19 }); + String::push_str(__local_56, String { repr: array.new_data("f64_nearest(2.3) = "), used: 19 }); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; f64::fmt_into(near3, __local_57); break __tmpl: __local_56; }); "core:cli/println"(__tmpl: block -> ref String { __local_58 = String { repr: builtin::array_new(35), used: 0 }; - String::append(__local_58, String { repr: array.new_data("f64_nearest(2.7) = "), used: 19 }); + String::push_str(__local_58, String { repr: array.new_data("f64_nearest(2.7) = "), used: 19 }); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; f64::fmt_into(near4, __local_59); break __tmpl: __local_58; @@ -371,14 +371,14 @@ fn run() with Stdout { sqrt3 = builtin::f64_sqrt(2); "core:cli/println"(__tmpl: block -> ref String { __local_60 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_60, String { repr: array.new_data("f64_sqrt(4.0) = "), used: 16 }); + String::push_str(__local_60, String { repr: array.new_data("f64_sqrt(4.0) = "), used: 16 }); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; f64::fmt_into(sqrt1, __local_61); break __tmpl: __local_60; }); "core:cli/println"(__tmpl: block -> ref String { __local_62 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_62, String { repr: array.new_data("f64_sqrt(9.0) = "), used: 16 }); + String::push_str(__local_62, String { repr: array.new_data("f64_sqrt(9.0) = "), used: 16 }); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; f64::fmt_into(sqrt2, __local_63); break __tmpl: __local_62; @@ -396,28 +396,28 @@ fn run() with Stdout { max2 = f64.max(-1, 1); "core:cli/println"(__tmpl: block -> ref String { __local_64 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_64, String { repr: array.new_data("f64_min(3.0, 5.0) = "), used: 20 }); + String::push_str(__local_64, String { repr: array.new_data("f64_min(3.0, 5.0) = "), used: 20 }); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; f64::fmt_into(min1, __local_65); break __tmpl: __local_64; }); "core:cli/println"(__tmpl: block -> ref String { __local_66 = String { repr: builtin::array_new(37), used: 0 }; - String::append(__local_66, String { repr: array.new_data("f64_min(-1.0, 1.0) = "), used: 21 }); + String::push_str(__local_66, String { repr: array.new_data("f64_min(-1.0, 1.0) = "), used: 21 }); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; f64::fmt_into(min2, __local_67); break __tmpl: __local_66; }); "core:cli/println"(__tmpl: block -> ref String { __local_68 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_68, String { repr: array.new_data("f64_max(3.0, 5.0) = "), used: 20 }); + String::push_str(__local_68, String { repr: array.new_data("f64_max(3.0, 5.0) = "), used: 20 }); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; f64::fmt_into(max1, __local_69); break __tmpl: __local_68; }); "core:cli/println"(__tmpl: block -> ref String { __local_70 = String { repr: builtin::array_new(37), used: 0 }; - String::append(__local_70, String { repr: array.new_data("f64_max(-1.0, 1.0) = "), used: 21 }); + String::push_str(__local_70, String { repr: array.new_data("f64_max(-1.0, 1.0) = "), used: 21 }); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; f64::fmt_into(max2, __local_71); break __tmpl: __local_70; @@ -427,21 +427,21 @@ fn run() with Stdout { copy3 = f64.copysign(5, 5); "core:cli/println"(__tmpl: block -> ref String { __local_72 = String { repr: builtin::array_new(42), used: 0 }; - String::append(__local_72, String { repr: array.new_data("f64_copysign(3.0, -1.0) = "), used: 26 }); + String::push_str(__local_72, String { repr: array.new_data("f64_copysign(3.0, -1.0) = "), used: 26 }); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; f64::fmt_into(copy1, __local_73); break __tmpl: __local_72; }); "core:cli/println"(__tmpl: block -> ref String { __local_74 = String { repr: builtin::array_new(42), used: 0 }; - String::append(__local_74, String { repr: array.new_data("f64_copysign(-3.0, 1.0) = "), used: 26 }); + String::push_str(__local_74, String { repr: array.new_data("f64_copysign(-3.0, 1.0) = "), used: 26 }); __local_75 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_74 }; f64::fmt_into(copy2, __local_75); break __tmpl: __local_74; }); "core:cli/println"(__tmpl: block -> ref String { __local_76 = String { repr: builtin::array_new(41), used: 0 }; - String::append(__local_76, String { repr: array.new_data("f64_copysign(5.0, 5.0) = "), used: 25 }); + String::push_str(__local_76, String { repr: array.new_data("f64_copysign(5.0, 5.0) = "), used: 25 }); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_76 }; f64::fmt_into(copy3, __local_77); break __tmpl: __local_76; @@ -453,35 +453,35 @@ fn run() with Stdout { f32_max = f32.max(builtin::f32_demote_f64(3), builtin::f32_demote_f64(5)); "core:cli/println"(__tmpl: block -> ref String { __local_78 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_78, String { repr: array.new_data("f32_ceil(2.3) = "), used: 16 }); + String::push_str(__local_78, String { repr: array.new_data("f32_ceil(2.3) = "), used: 16 }); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; f32::fmt_into(f32_ceil, __local_79); break __tmpl: __local_78; }); "core:cli/println"(__tmpl: block -> ref String { __local_80 = String { repr: builtin::array_new(33), used: 0 }; - String::append(__local_80, String { repr: array.new_data("f32_floor(2.7) = "), used: 17 }); + String::push_str(__local_80, String { repr: array.new_data("f32_floor(2.7) = "), used: 17 }); __local_81 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_80 }; f32::fmt_into(f32_floor, __local_81); break __tmpl: __local_80; }); "core:cli/println"(__tmpl: block -> ref String { __local_82 = String { repr: builtin::array_new(32), used: 0 }; - String::append(__local_82, String { repr: array.new_data("f32_sqrt(4.0) = "), used: 16 }); + String::push_str(__local_82, String { repr: array.new_data("f32_sqrt(4.0) = "), used: 16 }); __local_83 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_82 }; f32::fmt_into(f32_sqrt, __local_83); break __tmpl: __local_82; }); "core:cli/println"(__tmpl: block -> ref String { __local_84 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_84, String { repr: array.new_data("f32_min(3.0, 5.0) = "), used: 20 }); + String::push_str(__local_84, String { repr: array.new_data("f32_min(3.0, 5.0) = "), used: 20 }); __local_85 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_84 }; f32::fmt_into(f32_min, __local_85); break __tmpl: __local_84; }); "core:cli/println"(__tmpl: block -> ref String { __local_86 = String { repr: builtin::array_new(36), used: 0 }; - String::append(__local_86, String { repr: array.new_data("f32_max(3.0, 5.0) = "), used: 20 }); + String::push_str(__local_86, String { repr: array.new_data("f32_max(3.0, 5.0) = "), used: 20 }); __local_87 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_86 }; f32::fmt_into(f32_max, __local_87); break __tmpl: __local_86; @@ -1378,7 +1378,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1433,7 +1433,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1465,7 +1465,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1547,25 +1547,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1668,9 +1668,9 @@ fn f32::fmt_into(self, f) { break __inline_String__len_6: __local_22.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1735,9 +1735,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1791,13 +1791,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1832,9 +1832,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1875,7 +1875,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_closure.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_closure.wir.wado index d7614d223..fc6dfafa7 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_closure.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_closure.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -327,7 +327,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -342,7 +342,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -380,7 +380,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -414,20 +414,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -437,10 +437,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -450,10 +450,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -461,10 +461,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_entry_struct.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_entry_struct.wir.wado index 30e690998..845dd7491 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_entry_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_entry_struct.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,24 +100,24 @@ fn run() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_2, 108); - String::append_char(__local_2, 105); - String::append_char(__local_2, 98); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 108); + String::push(__local_2, 105); + String::push(__local_2, 98); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(20, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_4, 101); - String::append_char(__local_4, 110); - String::append_char(__local_4, 116); - String::append_char(__local_4, 114); - String::append_char(__local_4, 121); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 101); + String::push(__local_4, 110); + String::push(__local_4, 116); + String::push(__local_4, 114); + String::push(__local_4, 121); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(30, __local_5); break __tmpl: __local_4; @@ -319,7 +319,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -334,7 +334,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -372,7 +372,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -406,20 +406,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -442,10 +442,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -453,10 +453,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_free_fn.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_free_fn.wir.wado index 27fe000a2..409cf0f9d 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_free_fn.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_free_fn.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -102,31 +102,31 @@ fn run() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_0, 97); - String::append_char(__local_0, 58); - String::append_char(__local_0, 32); + String::push(__local_0, 97); + String::push(__local_0, 58); + String::push(__local_0, 32); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(11, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_2, 98); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 98); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(21, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_4, 101); - String::append_char(__local_4, 110); - String::append_char(__local_4, 116); - String::append_char(__local_4, 114); - String::append_char(__local_4, 121); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 101); + String::push(__local_4, 110); + String::push(__local_4, 116); + String::push(__local_4, 114); + String::push(__local_4, 121); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(30, __local_5); break __tmpl: __local_4; @@ -328,7 +328,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -343,7 +343,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -381,7 +381,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -415,20 +415,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -438,10 +438,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -451,10 +451,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -462,10 +462,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_generic_fn.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_generic_fn.wir.wado index bbb43e23f..af85b8549 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_generic_fn.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_generic_fn.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -104,13 +104,13 @@ fn run() with Stdout { let __local_28: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(36), used: 0 }; - String::append_char(__local_2, 97); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_12 = __local_3; i32::fmt_decimal(42, __local_12); - String::append_char(__local_2, 32); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_17 = __local_3; i32::fmt_decimal(1, __local_17); @@ -118,13 +118,13 @@ fn run() with Stdout { }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(36), used: 0 }; - String::append_char(__local_4, 98); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 98); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_23 = __local_5; i32::fmt_decimal(42, __local_23); - String::append_char(__local_4, 32); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_28 = __local_5; i32::fmt_decimal(2, __local_28); @@ -327,7 +327,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -342,7 +342,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -380,7 +380,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -414,20 +414,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -437,10 +437,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -450,10 +450,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -461,10 +461,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_global.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_global.wir.wado index 66f08e93c..84b0f6c5f 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_global.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_global.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,18 +100,18 @@ fn run() with Stdout { let __local_3: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_0 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_0, 97); - String::append_char(__local_0, 58); - String::append_char(__local_0, 32); + String::push(__local_0, 97); + String::push(__local_0, 58); + String::push(__local_0, 32); __local_1 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_0 }; i32::fmt_decimal(100, __local_1); break __tmpl: __local_0; }); "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_2, 98); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 98); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(999, __local_3); break __tmpl: __local_2; @@ -313,7 +313,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -328,7 +328,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -366,7 +366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -400,20 +400,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_method.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_method.wir.wado index b2b758c84..8fb173cb1 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_method.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_method.wir.wado @@ -73,9 +73,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -112,9 +112,9 @@ fn run() with Stdout { let __local_17: ref String; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 97); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(42, __local_5); break __tmpl: __local_4; @@ -126,11 +126,11 @@ fn run() with Stdout { cfg_b = cb.config; "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(36), used: 0 }; - String::append_char(__local_6, 98); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); - String::append(__local_6, cfg_b.name); - String::append_char(__local_6, 32); + String::push(__local_6, 98); + String::push(__local_6, 58); + String::push(__local_6, 32); + String::push_str(__local_6, cfg_b.name); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(cfg_b.count, __local_7); break __tmpl: __local_6; @@ -332,7 +332,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -347,7 +347,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -385,7 +385,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -419,20 +419,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -442,10 +442,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -455,10 +455,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -466,10 +466,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_newtype.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_newtype.wir.wado index d889623c4..9c63c9d59 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_newtype.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_newtype.wir.wado @@ -95,7 +95,7 @@ type "functype/write_decimal_digits" = fn(ref array, i32, i64, i32); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -105,9 +105,9 @@ type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -176,18 +176,18 @@ fn run() with Stdout { va = a; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 97); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 97); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; f64::fmt_into(va, __local_5); break __tmpl: __local_4; }); "core:cli/println"(__tmpl: block -> ref String { __local_6 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_6, 98); - String::append_char(__local_6, 58); - String::append_char(__local_6, 32); + String::push(__local_6, 98); + String::push(__local_6, 58); + String::push(__local_6, 32); __local_7 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_6 }; i32::fmt_decimal(42, __local_7); break __tmpl: __local_6; @@ -955,8 +955,8 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -1011,8 +1011,8 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append_char(buf, 48); - String::append_char(buf, 46); + String::push(buf, 48); + String::push(buf, 46); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1044,7 +1044,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append_char(buf, 46); + String::push(buf, 46); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1173,27 +1173,27 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append_char(f.buf, 78); - String::append_char(f.buf, 97); - String::append_char(f.buf, 78); + String::push(f.buf, 78); + String::push(f.buf, 97); + String::push(f.buf, 78); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1314,9 +1314,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1370,13 +1370,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; - String::append_char(f.buf, 48); + String::push(f.buf, 48); if precision > 0 { - String::append_char(f.buf, 46); + String::push(f.buf, 46); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1411,9 +1411,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append_char(f.buf, 45); + String::push(f.buf, 45); } else if f.sign_plus { - String::append_char(f.buf, 43); + String::push(f.buf, 43); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1466,7 +1466,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1481,7 +1481,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1519,7 +1519,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l153; }; @@ -1677,20 +1677,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1700,10 +1700,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1713,10 +1713,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1724,10 +1724,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_pub_use_alias.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_pub_use_alias.wir.wado index a93b04693..205cb7c8b 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_pub_use_alias.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_pub_use_alias.wir.wado @@ -96,7 +96,7 @@ type "functype/__initialize_module" = fn(); type "functype/fmt_float_special" = fn(ref Formatter, bool, enum:SpecialKind, ref String); -type "functype/Array::append" = fn(ref Array, u64); +type "functype/Array::push" = fn(ref Array, u64); type "functype/Array::grow" = fn(ref Array); @@ -104,7 +104,7 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::append_byte_filled" = fn(ref String, u8, i32); -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/Formatter::apply_padding" = fn(ref Formatter, i32); @@ -169,8 +169,8 @@ fn run() with Stdout { __local_1 = String { repr: builtin::array_new(33), used: 0 }; __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; f64::fmt_into(m.value, __local_2); - String::append(__local_1, String { repr: array.new_data(" "), used: 1 }); - String::append(__local_1, m.unit); + String::push_str(__local_1, String { repr: array.new_data(" "), used: 1 }); + String::push_str(__local_1, m.unit); break __tmpl: __local_1; }); } @@ -936,7 +936,7 @@ fn write_decimal(buf, d, p, nd) { let index: i32; decimal_pos = nd + p; if decimal_pos <= 0 { - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); n_10 = 0 - decimal_pos; String::append_byte_filled(buf, 48, n_10); digit_offset = buf.used; @@ -991,7 +991,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { decimal_pos = nd + p; if decimal_pos <= 0 { leading_zeros = 0 - decimal_pos; - String::append(buf, String { repr: array.new_data("0."), used: 2 }); + String::push_str(buf, String { repr: array.new_data("0."), used: 2 }); if precision <= leading_zeros { String::append_byte_filled(buf, 48, precision); return; @@ -1023,7 +1023,7 @@ fn write_decimal_prec(buf, d, p, nd, precision) { n_37 = decimal_pos - nd; String::append_byte_filled(buf, 48, n_37); if precision > 0 { - String::append(buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(buf, 48, precision); }; } else { @@ -1105,25 +1105,25 @@ fn fmt_float_special(f, is_neg, kind, zero_repr) { break __inline_String__len_1: __local_6.used; }; if kind == 3 { - String::append(f.buf, String { repr: array.new_data("NaN"), used: 3 }); + String::push_str(f.buf, String { repr: array.new_data("NaN"), used: 3 }); } else if kind == 2 { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-inf"), used: 4 }; } else { String { repr: array.new_data("inf"), used: 3 }; }); } else { - String::append(f.buf, if is_neg -> ref String { + String::push_str(f.buf, if is_neg -> ref String { String { repr: array.new_data("-"), used: 1 }; } else { String { repr: builtin::array_new(0), used: 0 }; }); - String::append(f.buf, zero_repr); + String::push_str(f.buf, zero_repr); }; Formatter::apply_padding(f, mark); } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -1224,9 +1224,9 @@ fn f64::fmt_into(self, f) { break __inline_String__len_5: __local_19.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal(f.buf, d, p, nd); Formatter::apply_padding(f, mark); @@ -1280,13 +1280,13 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_1: __local_16.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; - String::append(f.buf, String { repr: array.new_data("0"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("0"), used: 1 }); if precision > 0 { - String::append(f.buf, String { repr: array.new_data("."), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("."), used: 1 }); String::append_byte_filled(f.buf, 48, precision); }; Formatter::apply_padding(f, mark_7); @@ -1321,9 +1321,9 @@ fn f64::fmt_fixed(self, precision, f) { break __inline_String__len_8: __local_25.used; }; if is_neg { - String::append(f.buf, String { repr: array.new_data("-"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("-"), used: 1 }); } else if f.sign_plus { - String::append(f.buf, String { repr: array.new_data("+"), used: 1 }); + String::push_str(f.buf, String { repr: array.new_data("+"), used: 1 }); }; write_decimal_prec(f.buf, d, p, nd, precision); Formatter::apply_padding(f, mark_13); @@ -1364,7 +1364,7 @@ fn String::append_byte_filled(self, byte, n) { self.used = new_used; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_struct.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_struct.wir.wado index 7d9debf67..f28346bf4 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_struct.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_struct.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,18 +100,18 @@ fn run() with Stdout { let __local_5: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_2, 97); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; i32::fmt_decimal(42, __local_3); break __tmpl: __local_2; }); "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 98); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 98); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(30, __local_5); break __tmpl: __local_4; @@ -313,7 +313,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -328,7 +328,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -366,7 +366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -400,20 +400,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_trait.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_trait.wir.wado index 848b4957d..e22526a51 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_trait.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_trait.wir.wado @@ -64,9 +64,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -100,18 +100,18 @@ fn run() with Stdout { let __local_4: ref Formatter; "core:cli/println"(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_1, 97); - String::append_char(__local_1, 58); - String::append_char(__local_1, 32); + String::push(__local_1, 97); + String::push(__local_1, 58); + String::push(__local_1, 32); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(10, __local_2); break __tmpl: __local_1; }); "core:cli/println"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_3, 98); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 98); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; i32::fmt_decimal(15, __local_4); break __tmpl: __local_3; @@ -313,7 +313,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -328,7 +328,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -366,7 +366,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -400,20 +400,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -423,10 +423,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -436,10 +436,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -447,10 +447,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_variant.wir.wado b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_variant.wir.wado index 1fb66526a..530e7fd8e 100644 --- a/wado-compiler/tests/fixtures.golden/wasm_name_conflict_variant.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wasm_name_conflict_variant.wir.wado @@ -83,9 +83,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -124,9 +124,9 @@ fn run() with Stdout { a = "./sub/wasm_name_conflict_variant_mod_a.wado/Status" { 0 }; "core:cli/println"(__tmpl: block -> ref String { __local_2 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_2, 97); - String::append_char(__local_2, 58); - String::append_char(__local_2, 32); + String::push(__local_2, 97); + String::push(__local_2, 58); + String::push(__local_2, 32); __local_3 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_2 }; __local_9 = "core:internal/Box" { value: let __match_scrut_0: ref "./sub/wasm_name_conflict_variant_mod_a.wado/Status"; __match_scrut_0 = a; if __match_scrut_0.discriminant == 0 -> i32 { 1; @@ -141,9 +141,9 @@ fn run() with Stdout { b = "./sub/wasm_name_conflict_variant_mod_b.wado/Status::Ok" { discriminant: 0, payload_0: 99 }; "core:cli/println"(__tmpl: block -> ref String { __local_4 = String { repr: builtin::array_new(19), used: 0 }; - String::append_char(__local_4, 98); - String::append_char(__local_4, 58); - String::append_char(__local_4, 32); + String::push(__local_4, 98); + String::push(__local_4, 58); + String::push(__local_4, 32); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; i32::fmt_decimal(let __match_scrut_1: ref "./sub/wasm_name_conflict_variant_mod_b.wado/Status"; __match_scrut_1 = b; if ref.test "./sub/wasm_name_conflict_variant_mod_b.wado/Status::Ok"(__match_scrut_1) -> i32 { let __cast_1: ref "./sub/wasm_name_conflict_variant_mod_b.wado/Status::Ok"; @@ -354,7 +354,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -369,7 +369,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -407,7 +407,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -441,20 +441,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -464,10 +464,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -477,10 +477,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -488,10 +488,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/while_merged.wir.wado b/wado-compiler/tests/fixtures.golden/while_merged.wir.wado index 8a1804c3c..b2eb1736f 100644 --- a/wado-compiler/tests/fixtures.golden/while_merged.wir.wado +++ b/wado-compiler/tests/fixtures.golden/while_merged.wir.wado @@ -89,11 +89,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -150,31 +150,31 @@ fn __test_0_break() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_3 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_3, String { repr: array.new_data("__test_0_break"), used: 14 }); - String::append_char(__local_3, 32); - String::append_char(__local_3, 97); - String::append_char(__local_3, 116); - String::append_char(__local_3, 32); - String::append(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); - String::append_char(__local_3, 58); + String::push_str(__local_3, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_3, String { repr: array.new_data("__test_0_break"), used: 14 }); + String::push(__local_3, 32); + String::push(__local_3, 97); + String::push(__local_3, 116); + String::push(__local_3, 32); + String::push_str(__local_3, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); + String::push(__local_3, 58); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_9 = __local_4; i32::fmt_decimal(9, __local_9); - String::append(__local_3, String { repr: array.new_data(" + String::push_str(__local_3, String { repr: array.new_data(" condition: count == 3 "), used: 23 }); - String::append_char(__local_3, 99); - String::append_char(__local_3, 111); - String::append_char(__local_3, 117); - String::append_char(__local_3, 110); - String::append_char(__local_3, 116); - String::append_char(__local_3, 58); - String::append_char(__local_3, 32); + String::push(__local_3, 99); + String::push(__local_3, 111); + String::push(__local_3, 117); + String::push(__local_3, 110); + String::push(__local_3, 116); + String::push(__local_3, 58); + String::push(__local_3, 32); __local_4 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_3 }; __local_14 = __local_4; i32::fmt_decimal(__v0, __local_14); - String::append_char(__local_3, 10); + String::push(__local_3, 10); break __tmpl: __local_3; }); unreachable; @@ -213,50 +213,50 @@ fn __test_1_continue() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(212), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_1_continue"), used: 17 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_1_continue"), used: 17 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_13 = __local_8; i32::fmt_decimal(22, __local_13); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: sum == 1 + 2 + 4 + 5 "), used: 33 }); - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_18 = __local_8; i32::fmt_decimal(__v0, __local_18); - String::append_char(__local_7, 10); - String::append_char(__local_7, 49); - String::append_char(__local_7, 32); - String::append_char(__local_7, 43); - String::append_char(__local_7, 32); - String::append_char(__local_7, 50); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 10); + String::push(__local_7, 49); + String::push(__local_7, 32); + String::push(__local_7, 43); + String::push(__local_7, 32); + String::push(__local_7, 50); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_23 = __local_8; i32::fmt_decimal(3, __local_23); - String::append_char(__local_7, 10); - String::append(__local_7, String { repr: array.new_data("1 + 2 + 4: "), used: 11 }); + String::push(__local_7, 10); + String::push_str(__local_7, String { repr: array.new_data("1 + 2 + 4: "), used: 11 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_28 = __local_8; i32::fmt_decimal(7, __local_28); - String::append_char(__local_7, 10); - String::append(__local_7, String { repr: array.new_data("1 + 2 + 4 + 5: "), used: 15 }); + String::push(__local_7, 10); + String::push_str(__local_7, String { repr: array.new_data("1 + 2 + 4 + 5: "), used: 15 }); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_33 = __local_8; i32::fmt_decimal(12, __local_33); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -300,29 +300,29 @@ fn __test_2_while_let_basic() { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_7, String { repr: array.new_data("__test_2_while_let_basic"), used: 24 }); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_7, String { repr: array.new_data("__test_2_while_let_basic"), used: 24 }); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_24 = __local_8; i32::fmt_decimal(32, __local_24); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: sum == 6 "), used: 21 }); - String::append_char(__local_7, 115); - String::append_char(__local_7, 117); - String::append_char(__local_7, 109); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 115); + String::push(__local_7, 117); + String::push(__local_7, 109); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_29 = __local_8; i32::fmt_decimal(__v0, __local_29); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -396,29 +396,29 @@ fn __test_3_while_let_chain() { if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_27 = String { repr: builtin::array_new(116), used: 0 }; - String::append(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_27, String { repr: array.new_data("__test_3_while_let_chain"), used: 24 }); - String::append_char(__local_27, 32); - String::append_char(__local_27, 97); - String::append_char(__local_27, 116); - String::append_char(__local_27, 32); - String::append(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); - String::append_char(__local_27, 58); + String::push_str(__local_27, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_27, String { repr: array.new_data("__test_3_while_let_chain"), used: 24 }); + String::push(__local_27, 32); + String::push(__local_27, 97); + String::push(__local_27, 116); + String::push(__local_27, 32); + String::push_str(__local_27, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); + String::push(__local_27, 58); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_55 = __local_28; i32::fmt_decimal(43, __local_55); - String::append(__local_27, String { repr: array.new_data(" + String::push_str(__local_27, String { repr: array.new_data(" condition: sum == 6 "), used: 21 }); - String::append_char(__local_27, 115); - String::append_char(__local_27, 117); - String::append_char(__local_27, 109); - String::append_char(__local_27, 58); - String::append_char(__local_27, 32); + String::push(__local_27, 115); + String::push(__local_27, 117); + String::push(__local_27, 109); + String::push(__local_27, 58); + String::push(__local_27, 32); __local_28 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_27 }; __local_60 = __local_28; i32::fmt_decimal(__v0_5, __local_60); - String::append_char(__local_27, 10); + String::push(__local_27, 10); break __tmpl: __local_27; }); unreachable; @@ -461,31 +461,31 @@ condition: sum == 6 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_29 = String { repr: builtin::array_new(121), used: 0 }; - String::append(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_29, String { repr: array.new_data("__test_3_while_let_chain"), used: 24 }); - String::append_char(__local_29, 32); - String::append_char(__local_29, 97); - String::append_char(__local_29, 116); - String::append_char(__local_29, 32); - String::append(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); - String::append_char(__local_29, 58); + String::push_str(__local_29, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_29, String { repr: array.new_data("__test_3_while_let_chain"), used: 24 }); + String::push(__local_29, 32); + String::push(__local_29, 97); + String::push(__local_29, 116); + String::push(__local_29, 32); + String::push_str(__local_29, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); + String::push(__local_29, 58); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_86 = __local_30; i32::fmt_decimal(54, __local_86); - String::append(__local_29, String { repr: array.new_data(" + String::push_str(__local_29, String { repr: array.new_data(" condition: total == 66 "), used: 24 }); - String::append_char(__local_29, 116); - String::append_char(__local_29, 111); - String::append_char(__local_29, 116); - String::append_char(__local_29, 97); - String::append_char(__local_29, 108); - String::append_char(__local_29, 58); - String::append_char(__local_29, 32); + String::push(__local_29, 116); + String::push(__local_29, 111); + String::push(__local_29, 116); + String::push(__local_29, 97); + String::push(__local_29, 108); + String::push(__local_29, 58); + String::push(__local_29, 32); __local_30 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_29 }; __local_91 = __local_30; i32::fmt_decimal(__v0_16, __local_91); - String::append_char(__local_29, 10); + String::push(__local_29, 10); break __tmpl: __local_29; }); unreachable; @@ -523,31 +523,31 @@ condition: total == 66 if __cond_26 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_31 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append(__local_31, String { repr: array.new_data("__test_3_while_let_chain"), used: 24 }); - String::append_char(__local_31, 32); - String::append_char(__local_31, 97); - String::append_char(__local_31, 116); - String::append_char(__local_31, 32); - String::append(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); - String::append_char(__local_31, 58); + String::push_str(__local_31, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push_str(__local_31, String { repr: array.new_data("__test_3_while_let_chain"), used: 24 }); + String::push(__local_31, 32); + String::push(__local_31, 97); + String::push(__local_31, 116); + String::push(__local_31, 32); + String::push_str(__local_31, String { repr: array.new_data("wado-compiler/tests/fixtures/while_merged.wado"), used: 46 }); + String::push(__local_31, 58); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_109 = __local_32; i32::fmt_decimal(65, __local_109); - String::append(__local_31, String { repr: array.new_data(" + String::push_str(__local_31, String { repr: array.new_data(" condition: count == 2 "), used: 23 }); - String::append_char(__local_31, 99); - String::append_char(__local_31, 111); - String::append_char(__local_31, 117); - String::append_char(__local_31, 110); - String::append_char(__local_31, 116); - String::append_char(__local_31, 58); - String::append_char(__local_31, 32); + String::push(__local_31, 99); + String::push(__local_31, 111); + String::push(__local_31, 117); + String::push(__local_31, 110); + String::push(__local_31, 116); + String::push(__local_31, 58); + String::push(__local_31, 32); __local_32 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_31 }; __local_114 = __local_32; i32::fmt_decimal(__v0_25, __local_114); - String::append_char(__local_31, 10); + String::push(__local_31, 10); break __tmpl: __local_31; }); unreachable; @@ -765,7 +765,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -780,7 +780,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -817,7 +817,7 @@ fn ArrayIter^Iterator::next(self) { return 0; item; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -870,7 +870,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l58; }; @@ -904,20 +904,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -927,10 +927,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -940,10 +940,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -951,10 +951,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wir_issue6_circular_struct_variant.wir.wado b/wado-compiler/tests/fixtures.golden/wir_issue6_circular_struct_variant.wir.wado index 6f8f6b627..bc7f48232 100644 --- a/wado-compiler/tests/fixtures.golden/wir_issue6_circular_struct_variant.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wir_issue6_circular_struct_variant.wir.wado @@ -92,9 +92,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -162,33 +162,33 @@ fn run() with Stdout { if __cond == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_7 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_7, 114); - String::append_char(__local_7, 117); - String::append_char(__local_7, 110); - String::append_char(__local_7, 32); - String::append_char(__local_7, 97); - String::append_char(__local_7, 116); - String::append_char(__local_7, 32); - String::append(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_issue6_circular_struct_variant.wado"), used: 68 }); - String::append_char(__local_7, 58); + String::push_str(__local_7, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_7, 114); + String::push(__local_7, 117); + String::push(__local_7, 110); + String::push(__local_7, 32); + String::push(__local_7, 97); + String::push(__local_7, 116); + String::push(__local_7, 32); + String::push_str(__local_7, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_issue6_circular_struct_variant.wado"), used: 68 }); + String::push(__local_7, 58); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_15 = __local_8; i32::fmt_decimal(36, __local_15); - String::append(__local_7, String { repr: array.new_data(" + String::push_str(__local_7, String { repr: array.new_data(" condition: total == 6 "), used: 23 }); - String::append_char(__local_7, 116); - String::append_char(__local_7, 111); - String::append_char(__local_7, 116); - String::append_char(__local_7, 97); - String::append_char(__local_7, 108); - String::append_char(__local_7, 58); - String::append_char(__local_7, 32); + String::push(__local_7, 116); + String::push(__local_7, 111); + String::push(__local_7, 116); + String::push(__local_7, 97); + String::push(__local_7, 108); + String::push(__local_7, 58); + String::push(__local_7, 32); __local_8 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_7 }; __local_20 = __local_8; i32::fmt_decimal(total, __local_20); - String::append_char(__local_7, 10); + String::push(__local_7, 10); break __tmpl: __local_7; }); unreachable; @@ -433,7 +433,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -448,7 +448,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -486,7 +486,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -520,20 +520,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -543,10 +543,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -556,10 +556,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -567,10 +567,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wir_issue8_cross_module_variant.wir.wado b/wado-compiler/tests/fixtures.golden/wir_issue8_cross_module_variant.wir.wado index 2f15d5f6b..05568f238 100644 --- a/wado-compiler/tests/fixtures.golden/wir_issue8_cross_module_variant.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wir_issue8_cross_module_variant.wir.wado @@ -98,13 +98,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -166,34 +166,34 @@ fn run() with Stdout { if __cond_3 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_10 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_10, 114); - String::append_char(__local_10, 117); - String::append_char(__local_10, 110); - String::append_char(__local_10, 32); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 32); - String::append(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_issue8_cross_module_variant.wado"), used: 65 }); - String::append_char(__local_10, 58); + String::push_str(__local_10, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_10, 114); + String::push(__local_10, 117); + String::push(__local_10, 110); + String::push(__local_10, 32); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 32); + String::push_str(__local_10, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_issue8_cross_module_variant.wado"), used: 65 }); + String::push(__local_10, 58); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_23 = __local_11; i32::fmt_decimal(8, __local_23); - String::append(__local_10, String { repr: array.new_data(" + String::push_str(__local_10, String { repr: array.new_data(" condition: p.data == 42 "), used: 25 }); - String::append_char(__local_10, 112); - String::append_char(__local_10, 46); - String::append_char(__local_10, 100); - String::append_char(__local_10, 97); - String::append_char(__local_10, 116); - String::append_char(__local_10, 97); - String::append_char(__local_10, 58); - String::append_char(__local_10, 32); + String::push(__local_10, 112); + String::push(__local_10, 46); + String::push(__local_10, 100); + String::push(__local_10, 97); + String::push(__local_10, 116); + String::push(__local_10, 97); + String::push(__local_10, 58); + String::push(__local_10, 32); __local_11 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_10 }; __local_28 = __local_11; i32::fmt_decimal(__v0_2, __local_28); - String::append_char(__local_10, 10); + String::push(__local_10, 10); break __tmpl: __local_10; }); unreachable; @@ -203,33 +203,33 @@ condition: p.data == 42 if __cond_5 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_12 = String { repr: builtin::array_new(120), used: 0 }; - String::append(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_12, 114); - String::append_char(__local_12, 117); - String::append_char(__local_12, 110); - String::append_char(__local_12, 32); - String::append_char(__local_12, 97); - String::append_char(__local_12, 116); - String::append_char(__local_12, 32); - String::append(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_issue8_cross_module_variant.wado"), used: 65 }); - String::append_char(__local_12, 58); + String::push_str(__local_12, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_12, 114); + String::push(__local_12, 117); + String::push(__local_12, 110); + String::push(__local_12, 32); + String::push(__local_12, 97); + String::push(__local_12, 116); + String::push(__local_12, 32); + String::push_str(__local_12, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_issue8_cross_module_variant.wado"), used: 65 }); + String::push(__local_12, 58); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_34 = __local_13; i32::fmt_decimal(9, __local_34); - String::append(__local_12, String { repr: array.new_data(" + String::push_str(__local_12, String { repr: array.new_data(" condition: p.tag == 1 "), used: 23 }); - String::append_char(__local_12, 112); - String::append_char(__local_12, 46); - String::append_char(__local_12, 116); - String::append_char(__local_12, 97); - String::append_char(__local_12, 103); - String::append_char(__local_12, 58); - String::append_char(__local_12, 32); + String::push(__local_12, 112); + String::push(__local_12, 46); + String::push(__local_12, 116); + String::push(__local_12, 97); + String::push(__local_12, 103); + String::push(__local_12, 58); + String::push(__local_12, 32); __local_13 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_12 }; __local_39 = __local_13; i32::fmt_decimal(__v0_4, __local_39); - String::append_char(__local_12, 10); + String::push(__local_12, 10); break __tmpl: __local_12; }); unreachable; @@ -246,30 +246,30 @@ condition: p.tag == 1 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_14 = String { repr: builtin::array_new(123), used: 0 }; - String::append(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_14, 114); - String::append_char(__local_14, 117); - String::append_char(__local_14, 110); - String::append_char(__local_14, 32); - String::append_char(__local_14, 97); - String::append_char(__local_14, 116); - String::append_char(__local_14, 32); - String::append(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_issue8_cross_module_variant.wado"), used: 65 }); - String::append_char(__local_14, 58); + String::push_str(__local_14, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_14, 114); + String::push(__local_14, 117); + String::push(__local_14, 110); + String::push(__local_14, 32); + String::push(__local_14, 97); + String::push(__local_14, 116); + String::push(__local_14, 32); + String::push_str(__local_14, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_issue8_cross_module_variant.wado"), used: 65 }); + String::push(__local_14, 58); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; __local_45 = __local_15; i32::fmt_decimal(16, __local_45); - String::append(__local_14, String { repr: array.new_data(" + String::push_str(__local_14, String { repr: array.new_data(" condition: msg == \"failed\" "), used: 28 }); - String::append_char(__local_14, 109); - String::append_char(__local_14, 115); - String::append_char(__local_14, 103); - String::append_char(__local_14, 58); - String::append_char(__local_14, 32); + String::push(__local_14, 109); + String::push(__local_14, 115); + String::push(__local_14, 103); + String::push(__local_14, 58); + String::push(__local_14, 32); __local_15 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_14 }; String^Inspect::inspect(__v0_8, __local_15); - String::append_char(__local_14, 10); + String::push(__local_14, 10); break __tmpl: __local_14; }); unreachable; @@ -513,7 +513,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -601,7 +601,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -639,7 +639,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l38; }; @@ -673,20 +673,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -696,10 +696,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -709,10 +709,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -720,10 +720,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -735,7 +735,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -752,22 +752,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b57; @@ -775,7 +775,7 @@ fn String^Inspect::inspect(self, f) { continue l58; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/wir_optimize_unwrap_fresh_elision.wir.wado b/wado-compiler/tests/fixtures.golden/wir_optimize_unwrap_fresh_elision.wir.wado index df4059679..e063f77bc 100644 --- a/wado-compiler/tests/fixtures.golden/wir_optimize_unwrap_fresh_elision.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wir_optimize_unwrap_fresh_elision.wir.wado @@ -93,9 +93,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -179,32 +179,32 @@ fn run() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_15 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_15, 114); - String::append_char(__local_15, 117); - String::append_char(__local_15, 110); - String::append_char(__local_15, 32); - String::append_char(__local_15, 97); - String::append_char(__local_15, 116); - String::append_char(__local_15, 32); - String::append(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision.wado"), used: 67 }); - String::append_char(__local_15, 58); + String::push_str(__local_15, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_15, 114); + String::push(__local_15, 117); + String::push(__local_15, 110); + String::push(__local_15, 32); + String::push(__local_15, 97); + String::push(__local_15, 116); + String::push(__local_15, 32); + String::push_str(__local_15, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision.wado"), used: 67 }); + String::push(__local_15, 58); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_32 = __local_16; i32::fmt_decimal(29, __local_32); - String::append(__local_15, String { repr: array.new_data(" + String::push_str(__local_15, String { repr: array.new_data(" condition: d1.x == 1 "), used: 22 }); - String::append_char(__local_15, 100); - String::append_char(__local_15, 49); - String::append_char(__local_15, 46); - String::append_char(__local_15, 120); - String::append_char(__local_15, 58); - String::append_char(__local_15, 32); + String::push(__local_15, 100); + String::push(__local_15, 49); + String::push(__local_15, 46); + String::push(__local_15, 120); + String::push(__local_15, 58); + String::push(__local_15, 32); __local_16 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_15 }; __local_37 = __local_16; i32::fmt_decimal(__v0_1, __local_37); - String::append_char(__local_15, 10); + String::push(__local_15, 10); break __tmpl: __local_15; }); unreachable; @@ -224,32 +224,32 @@ condition: d1.x == 1 if __cond_6 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_17 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_17, 114); - String::append_char(__local_17, 117); - String::append_char(__local_17, 110); - String::append_char(__local_17, 32); - String::append_char(__local_17, 97); - String::append_char(__local_17, 116); - String::append_char(__local_17, 32); - String::append(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision.wado"), used: 67 }); - String::append_char(__local_17, 58); + String::push_str(__local_17, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_17, 114); + String::push(__local_17, 117); + String::push(__local_17, 110); + String::push(__local_17, 32); + String::push(__local_17, 97); + String::push(__local_17, 116); + String::push(__local_17, 32); + String::push_str(__local_17, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision.wado"), used: 67 }); + String::push(__local_17, 58); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_46 = __local_18; i32::fmt_decimal(34, __local_46); - String::append(__local_17, String { repr: array.new_data(" + String::push_str(__local_17, String { repr: array.new_data(" condition: d2.x == 1 "), used: 22 }); - String::append_char(__local_17, 100); - String::append_char(__local_17, 50); - String::append_char(__local_17, 46); - String::append_char(__local_17, 120); - String::append_char(__local_17, 58); - String::append_char(__local_17, 32); + String::push(__local_17, 100); + String::push(__local_17, 50); + String::push(__local_17, 46); + String::push(__local_17, 120); + String::push(__local_17, 58); + String::push(__local_17, 32); __local_18 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_17 }; __local_51 = __local_18; i32::fmt_decimal(__v0_5, __local_51); - String::append_char(__local_17, 10); + String::push(__local_17, 10); break __tmpl: __local_17; }); unreachable; @@ -268,32 +268,32 @@ condition: d2.x == 1 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_19 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_19, 114); - String::append_char(__local_19, 117); - String::append_char(__local_19, 110); - String::append_char(__local_19, 32); - String::append_char(__local_19, 97); - String::append_char(__local_19, 116); - String::append_char(__local_19, 32); - String::append(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision.wado"), used: 67 }); - String::append_char(__local_19, 58); + String::push_str(__local_19, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_19, 114); + String::push(__local_19, 117); + String::push(__local_19, 110); + String::push(__local_19, 32); + String::push(__local_19, 97); + String::push(__local_19, 116); + String::push(__local_19, 32); + String::push_str(__local_19, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision.wado"), used: 67 }); + String::push(__local_19, 58); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_60 = __local_20; i32::fmt_decimal(38, __local_60); - String::append(__local_19, String { repr: array.new_data(" + String::push_str(__local_19, String { repr: array.new_data(" condition: d3.x == 10 "), used: 23 }); - String::append_char(__local_19, 100); - String::append_char(__local_19, 51); - String::append_char(__local_19, 46); - String::append_char(__local_19, 120); - String::append_char(__local_19, 58); - String::append_char(__local_19, 32); + String::push(__local_19, 100); + String::push(__local_19, 51); + String::push(__local_19, 46); + String::push(__local_19, 120); + String::push(__local_19, 58); + String::push(__local_19, 32); __local_20 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_19 }; __local_65 = __local_20; i32::fmt_decimal(__v0_8, __local_65); - String::append_char(__local_19, 10); + String::push(__local_19, 10); break __tmpl: __local_19; }); unreachable; @@ -313,32 +313,32 @@ condition: d3.x == 10 if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_21 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_21, 114); - String::append_char(__local_21, 117); - String::append_char(__local_21, 110); - String::append_char(__local_21, 32); - String::append_char(__local_21, 97); - String::append_char(__local_21, 116); - String::append_char(__local_21, 32); - String::append(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision.wado"), used: 67 }); - String::append_char(__local_21, 58); + String::push_str(__local_21, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_21, 114); + String::push(__local_21, 117); + String::push(__local_21, 110); + String::push(__local_21, 32); + String::push(__local_21, 97); + String::push(__local_21, 116); + String::push(__local_21, 32); + String::push_str(__local_21, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision.wado"), used: 67 }); + String::push(__local_21, 58); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_74 = __local_22; i32::fmt_decimal(44, __local_74); - String::append(__local_21, String { repr: array.new_data(" + String::push_str(__local_21, String { repr: array.new_data(" condition: d4.x == 1 "), used: 22 }); - String::append_char(__local_21, 100); - String::append_char(__local_21, 52); - String::append_char(__local_21, 46); - String::append_char(__local_21, 120); - String::append_char(__local_21, 58); - String::append_char(__local_21, 32); + String::push(__local_21, 100); + String::push(__local_21, 52); + String::push(__local_21, 46); + String::push(__local_21, 120); + String::push(__local_21, 58); + String::push(__local_21, 32); __local_22 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_21 }; __local_79 = __local_22; i32::fmt_decimal(__v0_12, __local_79); - String::append_char(__local_21, 10); + String::push(__local_21, 10); break __tmpl: __local_21; }); unreachable; @@ -355,19 +355,19 @@ condition: d4.x == 1 if __cond_14 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_23 = String { repr: builtin::array_new(110), used: 0 }; - String::append(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_23, 114); - String::append_char(__local_23, 117); - String::append_char(__local_23, 110); - String::append_char(__local_23, 32); - String::append_char(__local_23, 97); - String::append_char(__local_23, 116); - String::append_char(__local_23, 32); - String::append(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision.wado"), used: 67 }); - String::append_char(__local_23, 58); + String::push_str(__local_23, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_23, 114); + String::push(__local_23, 117); + String::push(__local_23, 110); + String::push(__local_23, 32); + String::push(__local_23, 97); + String::push(__local_23, 116); + String::push(__local_23, 32); + String::push_str(__local_23, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision.wado"), used: 67 }); + String::push(__local_23, 58); __local_24 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_23 }; i32::fmt_decimal(46, __local_24); - String::append(__local_23, String { repr: array.new_data(" + String::push_str(__local_23, String { repr: array.new_data(" condition: opt2 matches { Some(_) } "), used: 37 }); break __tmpl: __local_23; @@ -609,7 +609,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -624,7 +624,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -662,7 +662,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l34; }; @@ -696,20 +696,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -719,10 +719,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -732,10 +732,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -743,10 +743,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wir_optimize_unwrap_fresh_elision_edge.wir.wado b/wado-compiler/tests/fixtures.golden/wir_optimize_unwrap_fresh_elision_edge.wir.wado index f6a0844e7..a9700168a 100644 --- a/wado-compiler/tests/fixtures.golden/wir_optimize_unwrap_fresh_elision_edge.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wir_optimize_unwrap_fresh_elision_edge.wir.wado @@ -115,13 +115,13 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); type "functype/String^Eq::eq" = fn(ref String, ref String) -> bool; type "functype/String^Eq::eq_bytes" = fn(ref array, ref array, i32) -> bool; -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -160,11 +160,11 @@ fn make_data(x) { let __local_2: ref Formatter; return Data { x: x, y: x * 2, name: ref.as_non_null(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(21), used: 0 }; - String::append_char(__local_1, 100); - String::append_char(__local_1, 97); - String::append_char(__local_1, 116); - String::append_char(__local_1, 97); - String::append_char(__local_1, 45); + String::push(__local_1, 100); + String::push(__local_1, 97); + String::push(__local_1, 116); + String::push(__local_1, 97); + String::push(__local_1, 45); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(x, __local_2); break __tmpl: __local_1; @@ -176,10 +176,10 @@ fn make_result(x) { let __local_2: ref Formatter; return Result::Ok { discriminant: 0, payload_0: Data { x: x, y: x * 10, name: ref.as_non_null(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(20), used: 0 }; - String::append_char(__local_1, 114); - String::append_char(__local_1, 101); - String::append_char(__local_1, 115); - String::append_char(__local_1, 45); + String::push(__local_1, 114); + String::push(__local_1, 101); + String::push(__local_1, 115); + String::push(__local_1, 45); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(x, __local_2); break __tmpl: __local_1; @@ -191,13 +191,13 @@ fn make_nested(x) { let __local_2: ref Formatter; return Option>::Some { discriminant: 0, payload_0: Data { x: x, y: x * 3, name: ref.as_non_null(__tmpl: block -> ref String { __local_1 = String { repr: builtin::array_new(23), used: 0 }; - String::append_char(__local_1, 110); - String::append_char(__local_1, 101); - String::append_char(__local_1, 115); - String::append_char(__local_1, 116); - String::append_char(__local_1, 101); - String::append_char(__local_1, 100); - String::append_char(__local_1, 45); + String::push(__local_1, 110); + String::push(__local_1, 101); + String::push(__local_1, 115); + String::push(__local_1, 116); + String::push(__local_1, 101); + String::push(__local_1, 100); + String::push(__local_1, 45); __local_2 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_1 }; i32::fmt_decimal(x, __local_2); break __tmpl: __local_1; @@ -346,32 +346,32 @@ fn run() with Stdout { if __cond_2 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_48 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_48, 114); - String::append_char(__local_48, 117); - String::append_char(__local_48, 110); - String::append_char(__local_48, 32); - String::append_char(__local_48, 97); - String::append_char(__local_48, 116); - String::append_char(__local_48, 32); - String::append(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_48, 58); + String::push_str(__local_48, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_48, 114); + String::push(__local_48, 117); + String::push(__local_48, 110); + String::push(__local_48, 32); + String::push(__local_48, 97); + String::push(__local_48, 116); + String::push(__local_48, 32); + String::push_str(__local_48, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_48, 58); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_88 = __local_49; i32::fmt_decimal(33, __local_88); - String::append(__local_48, String { repr: array.new_data(" + String::push_str(__local_48, String { repr: array.new_data(" condition: d1.x == 99 "), used: 23 }); - String::append_char(__local_48, 100); - String::append_char(__local_48, 49); - String::append_char(__local_48, 46); - String::append_char(__local_48, 120); - String::append_char(__local_48, 58); - String::append_char(__local_48, 32); + String::push(__local_48, 100); + String::push(__local_48, 49); + String::push(__local_48, 46); + String::push(__local_48, 120); + String::push(__local_48, 58); + String::push(__local_48, 32); __local_49 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_48 }; __local_93 = __local_49; i32::fmt_decimal(__v0_1, __local_93); - String::append_char(__local_48, 10); + String::push(__local_48, 10); break __tmpl: __local_48; }); unreachable; @@ -381,32 +381,32 @@ condition: d1.x == 99 if __cond_4 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_50 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_50, 114); - String::append_char(__local_50, 117); - String::append_char(__local_50, 110); - String::append_char(__local_50, 32); - String::append_char(__local_50, 97); - String::append_char(__local_50, 116); - String::append_char(__local_50, 32); - String::append(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_50, 58); + String::push_str(__local_50, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_50, 114); + String::push(__local_50, 117); + String::push(__local_50, 110); + String::push(__local_50, 32); + String::push(__local_50, 97); + String::push(__local_50, 116); + String::push(__local_50, 32); + String::push_str(__local_50, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_50, 58); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_99 = __local_51; i32::fmt_decimal(34, __local_99); - String::append(__local_50, String { repr: array.new_data(" + String::push_str(__local_50, String { repr: array.new_data(" condition: d1.y == 2 "), used: 22 }); - String::append_char(__local_50, 100); - String::append_char(__local_50, 49); - String::append_char(__local_50, 46); - String::append_char(__local_50, 121); - String::append_char(__local_50, 58); - String::append_char(__local_50, 32); + String::push(__local_50, 100); + String::push(__local_50, 49); + String::push(__local_50, 46); + String::push(__local_50, 121); + String::push(__local_50, 58); + String::push(__local_50, 32); __local_51 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_50 }; __local_104 = __local_51; i32::fmt_decimal(__v0_3, __local_104); - String::append_char(__local_50, 10); + String::push(__local_50, 10); break __tmpl: __local_50; }); unreachable; @@ -433,38 +433,38 @@ condition: d1.y == 2 if __cond_9 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_52 = String { repr: builtin::array_new(136), used: 0 }; - String::append(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_52, 114); - String::append_char(__local_52, 117); - String::append_char(__local_52, 110); - String::append_char(__local_52, 32); - String::append_char(__local_52, 97); - String::append_char(__local_52, 116); - String::append_char(__local_52, 32); - String::append(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_52, 58); + String::push_str(__local_52, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_52, 114); + String::push(__local_52, 117); + String::push(__local_52, 110); + String::push(__local_52, 32); + String::push(__local_52, 97); + String::push(__local_52, 116); + String::push(__local_52, 32); + String::push_str(__local_52, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_52, 58); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_113 = __local_53; i32::fmt_decimal(39, __local_113); - String::append(__local_52, String { repr: array.new_data(" + String::push_str(__local_52, String { repr: array.new_data(" condition: d.x == i "), used: 21 }); - String::append_char(__local_52, 100); - String::append_char(__local_52, 46); - String::append_char(__local_52, 120); - String::append_char(__local_52, 58); - String::append_char(__local_52, 32); + String::push(__local_52, 100); + String::push(__local_52, 46); + String::push(__local_52, 120); + String::push(__local_52, 58); + String::push(__local_52, 32); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_118 = __local_53; i32::fmt_decimal(__v0_7, __local_118); - String::append_char(__local_52, 10); - String::append_char(__local_52, 105); - String::append_char(__local_52, 58); - String::append_char(__local_52, 32); + String::push(__local_52, 10); + String::push(__local_52, 105); + String::push(__local_52, 58); + String::push(__local_52, 32); __local_53 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_52 }; __local_123 = __local_53; i32::fmt_decimal(__v1_8, __local_123); - String::append_char(__local_52, 10); + String::push(__local_52, 10); break __tmpl: __local_52; }); unreachable; @@ -476,49 +476,49 @@ condition: d.x == i if __cond_13 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_54 = String { repr: builtin::array_new(164), used: 0 }; - String::append(__local_54, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_54, 114); - String::append_char(__local_54, 117); - String::append_char(__local_54, 110); - String::append_char(__local_54, 32); - String::append_char(__local_54, 97); - String::append_char(__local_54, 116); - String::append_char(__local_54, 32); - String::append(__local_54, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_54, 58); + String::push_str(__local_54, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_54, 114); + String::push(__local_54, 117); + String::push(__local_54, 110); + String::push(__local_54, 32); + String::push(__local_54, 97); + String::push(__local_54, 116); + String::push(__local_54, 32); + String::push_str(__local_54, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_54, 58); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_129 = __local_55; i32::fmt_decimal(40, __local_129); - String::append(__local_54, String { repr: array.new_data(" + String::push_str(__local_54, String { repr: array.new_data(" condition: d.y == i * 2 "), used: 25 }); - String::append_char(__local_54, 100); - String::append_char(__local_54, 46); - String::append_char(__local_54, 121); - String::append_char(__local_54, 58); - String::append_char(__local_54, 32); + String::push(__local_54, 100); + String::push(__local_54, 46); + String::push(__local_54, 121); + String::push(__local_54, 58); + String::push(__local_54, 32); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_134 = __local_55; i32::fmt_decimal(__v0_10, __local_134); - String::append_char(__local_54, 10); - String::append_char(__local_54, 105); - String::append_char(__local_54, 58); - String::append_char(__local_54, 32); + String::push(__local_54, 10); + String::push(__local_54, 105); + String::push(__local_54, 58); + String::push(__local_54, 32); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_139 = __local_55; i32::fmt_decimal(__v1_11, __local_139); - String::append_char(__local_54, 10); - String::append_char(__local_54, 105); - String::append_char(__local_54, 32); - String::append_char(__local_54, 42); - String::append_char(__local_54, 32); - String::append_char(__local_54, 50); - String::append_char(__local_54, 58); - String::append_char(__local_54, 32); + String::push(__local_54, 10); + String::push(__local_54, 105); + String::push(__local_54, 32); + String::push(__local_54, 42); + String::push(__local_54, 32); + String::push(__local_54, 50); + String::push(__local_54, 58); + String::push(__local_54, 32); __local_55 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_54 }; __local_144 = __local_55; i32::fmt_decimal(__v2, __local_144); - String::append_char(__local_54, 10); + String::push(__local_54, 10); break __tmpl: __local_54; }); unreachable; @@ -551,31 +551,31 @@ condition: d.y == i * 2 if __cond_17 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_56 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_56, 114); - String::append_char(__local_56, 117); - String::append_char(__local_56, 110); - String::append_char(__local_56, 32); - String::append_char(__local_56, 97); - String::append_char(__local_56, 116); - String::append_char(__local_56, 32); - String::append(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_56, 58); + String::push_str(__local_56, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_56, 114); + String::push(__local_56, 117); + String::push(__local_56, 110); + String::push(__local_56, 32); + String::push(__local_56, 97); + String::push(__local_56, 116); + String::push(__local_56, 32); + String::push_str(__local_56, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_56, 58); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_156 = __local_57; i32::fmt_decimal(46, __local_156); - String::append(__local_56, String { repr: array.new_data(" + String::push_str(__local_56, String { repr: array.new_data(" condition: a.x == 10 "), used: 22 }); - String::append_char(__local_56, 97); - String::append_char(__local_56, 46); - String::append_char(__local_56, 120); - String::append_char(__local_56, 58); - String::append_char(__local_56, 32); + String::push(__local_56, 97); + String::push(__local_56, 46); + String::push(__local_56, 120); + String::push(__local_56, 58); + String::push(__local_56, 32); __local_57 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_56 }; __local_161 = __local_57; i32::fmt_decimal(__v0_16, __local_161); - String::append_char(__local_56, 10); + String::push(__local_56, 10); break __tmpl: __local_56; }); unreachable; @@ -585,31 +585,31 @@ condition: a.x == 10 if __cond_19 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_58 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_58, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_58, 114); - String::append_char(__local_58, 117); - String::append_char(__local_58, 110); - String::append_char(__local_58, 32); - String::append_char(__local_58, 97); - String::append_char(__local_58, 116); - String::append_char(__local_58, 32); - String::append(__local_58, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_58, 58); + String::push_str(__local_58, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_58, 114); + String::push(__local_58, 117); + String::push(__local_58, 110); + String::push(__local_58, 32); + String::push(__local_58, 97); + String::push(__local_58, 116); + String::push(__local_58, 32); + String::push_str(__local_58, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_58, 58); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; __local_167 = __local_59; i32::fmt_decimal(47, __local_167); - String::append(__local_58, String { repr: array.new_data(" + String::push_str(__local_58, String { repr: array.new_data(" condition: b.x == 20 "), used: 22 }); - String::append_char(__local_58, 98); - String::append_char(__local_58, 46); - String::append_char(__local_58, 120); - String::append_char(__local_58, 58); - String::append_char(__local_58, 32); + String::push(__local_58, 98); + String::push(__local_58, 46); + String::push(__local_58, 120); + String::push(__local_58, 58); + String::push(__local_58, 32); __local_59 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_58 }; __local_172 = __local_59; i32::fmt_decimal(__v0_18, __local_172); - String::append_char(__local_58, 10); + String::push(__local_58, 10); break __tmpl: __local_58; }); unreachable; @@ -619,33 +619,33 @@ condition: b.x == 20 if __cond_21 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_60 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_60, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_60, 114); - String::append_char(__local_60, 117); - String::append_char(__local_60, 110); - String::append_char(__local_60, 32); - String::append_char(__local_60, 97); - String::append_char(__local_60, 116); - String::append_char(__local_60, 32); - String::append(__local_60, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_60, 58); + String::push_str(__local_60, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_60, 114); + String::push(__local_60, 117); + String::push(__local_60, 110); + String::push(__local_60, 32); + String::push(__local_60, 97); + String::push(__local_60, 116); + String::push(__local_60, 32); + String::push_str(__local_60, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_60, 58); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; __local_178 = __local_61; i32::fmt_decimal(49, __local_178); - String::append(__local_60, String { repr: array.new_data(" + String::push_str(__local_60, String { repr: array.new_data(" condition: a.name == \"data-10\" "), used: 32 }); - String::append_char(__local_60, 97); - String::append_char(__local_60, 46); - String::append_char(__local_60, 110); - String::append_char(__local_60, 97); - String::append_char(__local_60, 109); - String::append_char(__local_60, 101); - String::append_char(__local_60, 58); - String::append_char(__local_60, 32); + String::push(__local_60, 97); + String::push(__local_60, 46); + String::push(__local_60, 110); + String::push(__local_60, 97); + String::push(__local_60, 109); + String::push(__local_60, 101); + String::push(__local_60, 58); + String::push(__local_60, 32); __local_61 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_60 }; String^Inspect::inspect(__v0_20, __local_61); - String::append_char(__local_60, 10); + String::push(__local_60, 10); break __tmpl: __local_60; }); unreachable; @@ -655,33 +655,33 @@ condition: a.name == \"data-10\" if __cond_23 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_62 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_62, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_62, 114); - String::append_char(__local_62, 117); - String::append_char(__local_62, 110); - String::append_char(__local_62, 32); - String::append_char(__local_62, 97); - String::append_char(__local_62, 116); - String::append_char(__local_62, 32); - String::append(__local_62, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_62, 58); + String::push_str(__local_62, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_62, 114); + String::push(__local_62, 117); + String::push(__local_62, 110); + String::push(__local_62, 32); + String::push(__local_62, 97); + String::push(__local_62, 116); + String::push(__local_62, 32); + String::push_str(__local_62, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_62, 58); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; __local_185 = __local_63; i32::fmt_decimal(50, __local_185); - String::append(__local_62, String { repr: array.new_data(" + String::push_str(__local_62, String { repr: array.new_data(" condition: b.name == \"data-20\" "), used: 32 }); - String::append_char(__local_62, 98); - String::append_char(__local_62, 46); - String::append_char(__local_62, 110); - String::append_char(__local_62, 97); - String::append_char(__local_62, 109); - String::append_char(__local_62, 101); - String::append_char(__local_62, 58); - String::append_char(__local_62, 32); + String::push(__local_62, 98); + String::push(__local_62, 46); + String::push(__local_62, 110); + String::push(__local_62, 97); + String::push(__local_62, 109); + String::push(__local_62, 101); + String::push(__local_62, 58); + String::push(__local_62, 32); __local_63 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_62 }; String^Inspect::inspect(__v0_22, __local_63); - String::append_char(__local_62, 10); + String::push(__local_62, 10); break __tmpl: __local_62; }); unreachable; @@ -709,32 +709,32 @@ condition: b.name == \"data-20\" if __cond_27 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_64 = String { repr: builtin::array_new(118), used: 0 }; - String::append(__local_64, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_64, 114); - String::append_char(__local_64, 117); - String::append_char(__local_64, 110); - String::append_char(__local_64, 32); - String::append_char(__local_64, 97); - String::append_char(__local_64, 116); - String::append_char(__local_64, 32); - String::append(__local_64, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_64, 58); + String::push_str(__local_64, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_64, 114); + String::push(__local_64, 117); + String::push(__local_64, 110); + String::push(__local_64, 32); + String::push(__local_64, 97); + String::push(__local_64, 116); + String::push(__local_64, 32); + String::push_str(__local_64, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_64, 58); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; __local_198 = __local_65; i32::fmt_decimal(55, __local_198); - String::append(__local_64, String { repr: array.new_data(" + String::push_str(__local_64, String { repr: array.new_data(" condition: d4.x == 5 "), used: 22 }); - String::append_char(__local_64, 100); - String::append_char(__local_64, 52); - String::append_char(__local_64, 46); - String::append_char(__local_64, 120); - String::append_char(__local_64, 58); - String::append_char(__local_64, 32); + String::push(__local_64, 100); + String::push(__local_64, 52); + String::push(__local_64, 46); + String::push(__local_64, 120); + String::push(__local_64, 58); + String::push(__local_64, 32); __local_65 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_64 }; __local_203 = __local_65; i32::fmt_decimal(__v0_26, __local_203); - String::append_char(__local_64, 10); + String::push(__local_64, 10); break __tmpl: __local_64; }); unreachable; @@ -744,32 +744,32 @@ condition: d4.x == 5 if __cond_29 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_66 = String { repr: builtin::array_new(119), used: 0 }; - String::append(__local_66, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_66, 114); - String::append_char(__local_66, 117); - String::append_char(__local_66, 110); - String::append_char(__local_66, 32); - String::append_char(__local_66, 97); - String::append_char(__local_66, 116); - String::append_char(__local_66, 32); - String::append(__local_66, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_66, 58); + String::push_str(__local_66, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_66, 114); + String::push(__local_66, 117); + String::push(__local_66, 110); + String::push(__local_66, 32); + String::push(__local_66, 97); + String::push(__local_66, 116); + String::push(__local_66, 32); + String::push_str(__local_66, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_66, 58); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; __local_209 = __local_67; i32::fmt_decimal(56, __local_209); - String::append(__local_66, String { repr: array.new_data(" + String::push_str(__local_66, String { repr: array.new_data(" condition: d4.y == 15 "), used: 23 }); - String::append_char(__local_66, 100); - String::append_char(__local_66, 52); - String::append_char(__local_66, 46); - String::append_char(__local_66, 121); - String::append_char(__local_66, 58); - String::append_char(__local_66, 32); + String::push(__local_66, 100); + String::push(__local_66, 52); + String::push(__local_66, 46); + String::push(__local_66, 121); + String::push(__local_66, 58); + String::push(__local_66, 32); __local_67 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_66 }; __local_214 = __local_67; i32::fmt_decimal(__v0_28, __local_214); - String::append_char(__local_66, 10); + String::push(__local_66, 10); break __tmpl: __local_66; }); unreachable; @@ -788,31 +788,31 @@ condition: d4.y == 15 if __cond_33 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_68 = String { repr: builtin::array_new(117), used: 0 }; - String::append(__local_68, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_68, 114); - String::append_char(__local_68, 117); - String::append_char(__local_68, 110); - String::append_char(__local_68, 32); - String::append_char(__local_68, 97); - String::append_char(__local_68, 116); - String::append_char(__local_68, 32); - String::append(__local_68, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_68, 58); + String::push_str(__local_68, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_68, 114); + String::push(__local_68, 117); + String::push(__local_68, 110); + String::push(__local_68, 32); + String::push(__local_68, 97); + String::push(__local_68, 116); + String::push(__local_68, 32); + String::push_str(__local_68, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_68, 58); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; __local_223 = __local_69; i32::fmt_decimal(61, __local_223); - String::append(__local_68, String { repr: array.new_data(" + String::push_str(__local_68, String { repr: array.new_data(" condition: sum == 77 "), used: 22 }); - String::append_char(__local_68, 115); - String::append_char(__local_68, 117); - String::append_char(__local_68, 109); - String::append_char(__local_68, 58); - String::append_char(__local_68, 32); + String::push(__local_68, 115); + String::push(__local_68, 117); + String::push(__local_68, 109); + String::push(__local_68, 58); + String::push(__local_68, 32); __local_69 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_68 }; __local_228 = __local_69; i32::fmt_decimal(sum, __local_228); - String::append_char(__local_68, 10); + String::push(__local_68, 10); break __tmpl: __local_68; }); unreachable; @@ -822,26 +822,26 @@ condition: sum == 77 if __cond_35 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_70 = String { repr: builtin::array_new(130), used: 0 }; - String::append(__local_70, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_70, 114); - String::append_char(__local_70, 117); - String::append_char(__local_70, 110); - String::append_char(__local_70, 32); - String::append_char(__local_70, 97); - String::append_char(__local_70, 116); - String::append_char(__local_70, 32); - String::append(__local_70, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_70, 58); + String::push_str(__local_70, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_70, 114); + String::push(__local_70, 117); + String::push(__local_70, 110); + String::push(__local_70, 32); + String::push(__local_70, 97); + String::push(__local_70, 116); + String::push(__local_70, 32); + String::push_str(__local_70, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_70, 58); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; __local_234 = __local_71; i32::fmt_decimal(62, __local_234); - String::append(__local_70, String { repr: array.new_data(" + String::push_str(__local_70, String { repr: array.new_data(" condition: d5.name == \"res-7\" "), used: 31 }); - String::append(__local_70, String { repr: array.new_data("d5.name: "), used: 9 }); + String::push_str(__local_70, String { repr: array.new_data("d5.name: "), used: 9 }); __local_71 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_70 }; String^Inspect::inspect(__v0_34, __local_71); - String::append_char(__local_70, 10); + String::push(__local_70, 10); break __tmpl: __local_70; }); unreachable; @@ -863,23 +863,23 @@ condition: d5.name == \"res-7\" if __v0_37 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_72 = String { repr: builtin::array_new(135), used: 0 }; - String::append(__local_72, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_72, 114); - String::append_char(__local_72, 117); - String::append_char(__local_72, 110); - String::append_char(__local_72, 32); - String::append_char(__local_72, 97); - String::append_char(__local_72, 116); - String::append_char(__local_72, 32); - String::append(__local_72, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_72, 58); + String::push_str(__local_72, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_72, 114); + String::push(__local_72, 117); + String::push(__local_72, 110); + String::push(__local_72, 32); + String::push(__local_72, 97); + String::push(__local_72, 116); + String::push(__local_72, 32); + String::push_str(__local_72, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_72, 58); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; __local_245 = __local_73; i32::fmt_decimal(66, __local_245); - String::append(__local_72, String { repr: array.new_data(" + String::push_str(__local_72, String { repr: array.new_data(" condition: check_data(&d6) "), used: 28 }); - String::append(__local_72, String { repr: array.new_data("check_data(&d6): "), used: 17 }); + String::push_str(__local_72, String { repr: array.new_data("check_data(&d6): "), used: 17 }); __local_73 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_72 }; __local_250 = __local_73; Formatter::pad(__local_250, if __v0_37 -> ref String { @@ -887,7 +887,7 @@ condition: check_data(&d6) } else { String { repr: array.new_data("false"), used: 5 }; }); - String::append_char(__local_72, 10); + String::push(__local_72, 10); break __tmpl: __local_72; }); unreachable; @@ -908,29 +908,29 @@ condition: check_data(&d6) if __cond_43 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_74 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_74, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_74, 114); - String::append_char(__local_74, 117); - String::append_char(__local_74, 110); - String::append_char(__local_74, 32); - String::append_char(__local_74, 97); - String::append_char(__local_74, 116); - String::append_char(__local_74, 32); - String::append(__local_74, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_74, 58); + String::push_str(__local_74, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_74, 114); + String::push(__local_74, 117); + String::push(__local_74, 110); + String::push(__local_74, 32); + String::push(__local_74, 97); + String::push(__local_74, 116); + String::push(__local_74, 32); + String::push_str(__local_74, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_74, 58); __local_75 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_74 }; __local_259 = __local_75; i32::fmt_decimal(70, __local_259); - String::append(__local_74, String { repr: array.new_data(" + String::push_str(__local_74, String { repr: array.new_data(" condition: x == 42 "), used: 20 }); - String::append_char(__local_74, 120); - String::append_char(__local_74, 58); - String::append_char(__local_74, 32); + String::push(__local_74, 120); + String::push(__local_74, 58); + String::push(__local_74, 32); __local_75 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_74 }; __local_264 = __local_75; i32::fmt_decimal(x, __local_264); - String::append_char(__local_74, 10); + String::push(__local_74, 10); break __tmpl: __local_74; }); unreachable; @@ -939,29 +939,29 @@ condition: x == 42 if __cond_45 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_76 = String { repr: builtin::array_new(113), used: 0 }; - String::append(__local_76, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_76, 114); - String::append_char(__local_76, 117); - String::append_char(__local_76, 110); - String::append_char(__local_76, 32); - String::append_char(__local_76, 97); - String::append_char(__local_76, 116); - String::append_char(__local_76, 32); - String::append(__local_76, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_76, 58); + String::push_str(__local_76, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_76, 114); + String::push(__local_76, 117); + String::push(__local_76, 110); + String::push(__local_76, 32); + String::push(__local_76, 97); + String::push(__local_76, 116); + String::push(__local_76, 32); + String::push_str(__local_76, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_76, 58); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_76 }; __local_270 = __local_77; i32::fmt_decimal(71, __local_270); - String::append(__local_76, String { repr: array.new_data(" + String::push_str(__local_76, String { repr: array.new_data(" condition: y == 84 "), used: 20 }); - String::append_char(__local_76, 121); - String::append_char(__local_76, 58); - String::append_char(__local_76, 32); + String::push(__local_76, 121); + String::push(__local_76, 58); + String::push(__local_76, 32); __local_77 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_76 }; __local_275 = __local_77; i32::fmt_decimal(y, __local_275); - String::append_char(__local_76, 10); + String::push(__local_76, 10); break __tmpl: __local_76; }); unreachable; @@ -971,31 +971,31 @@ condition: y == 84 if __cond_47 == 0 { "core:internal/panic"(__tmpl: block -> ref String { __local_78 = String { repr: builtin::array_new(126), used: 0 }; - String::append(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); - String::append_char(__local_78, 114); - String::append_char(__local_78, 117); - String::append_char(__local_78, 110); - String::append_char(__local_78, 32); - String::append_char(__local_78, 97); - String::append_char(__local_78, 116); - String::append_char(__local_78, 32); - String::append(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); - String::append_char(__local_78, 58); + String::push_str(__local_78, String { repr: array.new_data("Assertion failed in "), used: 20 }); + String::push(__local_78, 114); + String::push(__local_78, 117); + String::push(__local_78, 110); + String::push(__local_78, 32); + String::push(__local_78, 97); + String::push(__local_78, 116); + String::push(__local_78, 32); + String::push_str(__local_78, String { repr: array.new_data("wado-compiler/tests/fixtures/wir_optimize_unwrap_fresh_elision_edge.wado"), used: 72 }); + String::push(__local_78, 58); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; __local_281 = __local_79; i32::fmt_decimal(72, __local_281); - String::append(__local_78, String { repr: array.new_data(" + String::push_str(__local_78, String { repr: array.new_data(" condition: name == \"data-42\" "), used: 30 }); - String::append_char(__local_78, 110); - String::append_char(__local_78, 97); - String::append_char(__local_78, 109); - String::append_char(__local_78, 101); - String::append_char(__local_78, 58); - String::append_char(__local_78, 32); + String::push(__local_78, 110); + String::push(__local_78, 97); + String::push(__local_78, 109); + String::push(__local_78, 101); + String::push(__local_78, 58); + String::push(__local_78, 32); __local_79 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_78 }; String^Inspect::inspect(__v0_46, __local_79); - String::append_char(__local_78, 10); + String::push(__local_78, 10); break __tmpl: __local_78; }); unreachable; @@ -1235,7 +1235,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -1323,7 +1323,7 @@ fn StrCharIter^Iterator::next(self) { return 0; code_10; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -1361,7 +1361,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l63; }; @@ -1381,7 +1381,7 @@ fn Formatter::pad(self, content) { } else { content_len >= self.width; } { - String::append(self.buf, content); + String::push_str(self.buf, content); return; }; padding = self.width - content_len; @@ -1389,17 +1389,17 @@ fn Formatter::pad(self, content) { let __match_scrut_0: enum:Alignment; __match_scrut_0 = align; if __match_scrut_0 == 0 { - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, padding); } else if align == 1 { left_pad = padding / 2; right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); - String::append(self.buf, content); + String::push_str(self.buf, content); Formatter::write_char_n(self, self.fill, right_pad); } else { Formatter::write_char_n(self, self.fill, padding); - String::append(self.buf, content); + String::push_str(self.buf, content); }; } @@ -1429,20 +1429,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -1452,10 +1452,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -1465,10 +1465,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -1476,10 +1476,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; @@ -1491,7 +1491,7 @@ fn String^Inspect::inspect(self, f) { let __local_7: ref StrCharIter; let __local_8: ref String; let _licm_buf_33: ref String; - String::append_char(f.buf, 34); + String::push(f.buf, 34); __iter_2 = __inline_StrCharIter_IntoIterator__into_iter_1: block -> ref StrCharIter { __local_7 = __inline_String__chars_2: block -> ref StrCharIter { __local_8 = self; @@ -1508,22 +1508,22 @@ fn String^Inspect::inspect(self, f) { if __sroa___pattern_temp_0_discriminant == 0 { c = __sroa___pattern_temp_0_payload_0; if c == 34 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 34); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 34); } else if c == 92 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 92); } else if c == 10 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 110); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 110); } else if c == 13 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 114); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 114); } else if c == 9 { - String::append_char(_licm_buf_33, 92); - String::append_char(_licm_buf_33, 116); + String::push(_licm_buf_33, 92); + String::push(_licm_buf_33, 116); } else { - String::append_char(_licm_buf_33, c); + String::push(_licm_buf_33, c); }; } else { break b86; @@ -1531,7 +1531,7 @@ fn String^Inspect::inspect(self, f) { continue l87; }; }; - String::append_char(f.buf, 34); + String::push(f.buf, 34); } export fn __cm_export__run as "run" diff --git a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_call_arg_needed.wir.wado b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_call_arg_needed.wir.wado index 9ebeacfe2..56811e793 100644 --- a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_call_arg_needed.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_call_arg_needed.wir.wado @@ -71,11 +71,11 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); -type "functype/Array::append" = fn(ref Array, i32); +type "functype/Array::push" = fn(ref Array, i32); type "functype/Array::grow" = fn(ref Array); @@ -119,7 +119,7 @@ fn run() with Stdout { }; new_len = __inline_append_zero_8: block -> i32 { __local_17 = value_copy Array(a); - Array::append(__local_17, 0); + Array::push(__local_17, 0); break __inline_append_zero_8: __local_17.used; }; "core:cli/println"(__tmpl: block -> ref String { @@ -331,7 +331,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -346,7 +346,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -373,7 +373,7 @@ fn String::append_char(self, c) { }; } -fn Array::append(self, value) { +fn Array::push(self, value) { let used: i32; used = self.used; if builtin::unlikely(used >= builtin::array_len(self.repr)) { @@ -426,7 +426,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l27; }; @@ -460,20 +460,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -483,10 +483,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -496,10 +496,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -507,10 +507,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_chained_field.wir.wado b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_chained_field.wir.wado index 96c362b08..07e55efc1 100644 --- a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_chained_field.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_chained_field.wir.wado @@ -73,9 +73,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -319,7 +319,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -334,7 +334,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -372,7 +372,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -406,20 +406,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -429,10 +429,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -442,10 +442,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -453,10 +453,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_if_fresh.wir.wado b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_if_fresh.wir.wado index 0eba56dac..c2e414ce2 100644 --- a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_if_fresh.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_if_fresh.wir.wado @@ -68,9 +68,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -333,7 +333,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -348,7 +348,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -386,7 +386,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -420,20 +420,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -443,10 +443,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -456,10 +456,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -467,10 +467,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_match_fresh.wir.wado b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_match_fresh.wir.wado index ba2f8c004..6ddd6c258 100644 --- a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_match_fresh.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_match_fresh.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -371,7 +371,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -386,7 +386,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -424,7 +424,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l35; }; @@ -458,20 +458,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -481,10 +481,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -494,10 +494,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -505,10 +505,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_mutation_needed.wir.wado b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_mutation_needed.wir.wado index d82b71fc2..102f2752d 100644 --- a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_mutation_needed.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_mutation_needed.wir.wado @@ -69,9 +69,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -321,7 +321,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -336,7 +336,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -374,7 +374,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l23; }; @@ -408,20 +408,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -431,10 +431,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -444,10 +444,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -455,10 +455,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_variant_read.wir.wado b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_variant_read.wir.wado index d2399e865..ff9058e22 100644 --- a/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_variant_read.wir.wado +++ b/wado-compiler/tests/fixtures.golden/wir_optimize_value_copy_variant_read.wir.wado @@ -71,9 +71,9 @@ type "functype/String::grow" = fn(ref String, i32); type "functype/String::internal_reserve_uninit" = fn(ref String, i32) -> i32; -type "functype/String::append" = fn(ref String, ref String); +type "functype/String::push_str" = fn(ref String, ref String); -type "functype/String::append_char" = fn(ref String, char); +type "functype/String::push" = fn(ref String, char); type "functype/Formatter::write_char_n" = fn(ref Formatter, char, i32); @@ -117,7 +117,7 @@ fn describe(bp) { __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_10 = __local_5; i32::fmt_decimal(f, __local_10); - String::append_char(__local_4, 44); + String::push(__local_4, 44); __local_5 = Formatter { fill: 32, align: 2, sign_plus: 0, zero_pad: 0, width: -1, precision: -1, indent: 0, buf: __local_4 }; __local_15 = __local_5; i32::fmt_decimal(s, __local_15); @@ -328,7 +328,7 @@ fn String::internal_reserve_uninit(self, n) { return start; } -fn String::append(self, other) { +fn String::push_str(self, other) { let other_len: i32; let new_used: i32; other_len = other.used; @@ -343,7 +343,7 @@ fn String::append(self, other) { self.used = new_used; } -fn String::append_char(self, c) { +fn String::push(self, c) { let code: u32; code = c; if builtin::unlikely((self.used + 4) > builtin::array_len(self.repr)) { @@ -381,7 +381,7 @@ fn Formatter::write_char_n(self, c, n) { if (i < n) == 0 { break __for_0; }; - String::append_char(_licm_buf_4, c); + String::push(_licm_buf_4, c); i = i + 1; continue l24; }; @@ -415,20 +415,20 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { content_len >= self.width; } { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; padding = self.width - content_len; if self.zero_pad { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; Formatter::write_char_n(self, 48, padding); return String::internal_reserve_uninit(self.buf, digit_count); @@ -438,10 +438,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { __match_scrut_0 = align; if __match_scrut_0 == 0 { if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_10 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, padding); @@ -451,10 +451,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { right_pad = padding - left_pad; Formatter::write_char_n(self, self.fill, left_pad); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; offset_13 = String::internal_reserve_uninit(self.buf, digit_count); Formatter::write_char_n(self, self.fill, right_pad); @@ -462,10 +462,10 @@ fn Formatter::prepare_int_write(self, is_negative, prefix, digit_count) { } else { Formatter::write_char_n(self, self.fill, padding); if sign_len > 0 { - String::append(self.buf, sign); + String::push_str(self.buf, sign); }; if prefix_len > 0 { - String::append(self.buf, prefix); + String::push_str(self.buf, prefix); }; return String::internal_reserve_uninit(self.buf, digit_count); }; diff --git a/wado-compiler/tests/fixtures/array_append_collapse.wado b/wado-compiler/tests/fixtures/array_append_collapse.wado index 4e25829a7..90debb6b5 100644 --- a/wado-compiler/tests/fixtures/array_append_collapse.wado +++ b/wado-compiler/tests/fixtures/array_append_collapse.wado @@ -59,7 +59,7 @@ impl SequenceLiteralBuilder for SeqVec { } fn push_literal(&mut self, value: Self::Element) { - self.items.append(value); + self.items.push(value); } fn build(&self) -> SeqVec { @@ -71,5 +71,5 @@ __DATA__ { "stdout": "ok\n", "wir_expect:O2": ["array.new_fixed(10, 20, 30)", "array.new_fixed("], - "wir_not_expect:O2": ["Array^SequenceLiteralBuilder::push_literal(", "Array::append(__local_"] + "wir_not_expect:O2": ["Array^SequenceLiteralBuilder::push_literal(", "Array::push(__local_"] } diff --git a/wado-compiler/tests/fixtures/array_bounds_elim_oob_complex.wado b/wado-compiler/tests/fixtures/array_bounds_elim_oob_complex.wado index 0a2f8bf55..98fc65d62 100644 --- a/wado-compiler/tests/fixtures/array_bounds_elim_oob_complex.wado +++ b/wado-compiler/tests/fixtures/array_bounds_elim_oob_complex.wado @@ -10,9 +10,9 @@ fn get_index() -> i32 { export fn run() with Stdout { // Array built dynamically via append - size not statically known let mut arr: Array = []; - arr.append(1); - arr.append(2); - arr.append(3); + arr.push(1); + arr.push(2); + arr.push(3); // Dynamic index from function call - must keep bounds check let idx = get_index(); diff --git a/wado-compiler/tests/fixtures/array_bounds_elim_oob_loop_dynamic.wado b/wado-compiler/tests/fixtures/array_bounds_elim_oob_loop_dynamic.wado index c309d246a..bc48afd4a 100644 --- a/wado-compiler/tests/fixtures/array_bounds_elim_oob_loop_dynamic.wado +++ b/wado-compiler/tests/fixtures/array_bounds_elim_oob_loop_dynamic.wado @@ -4,7 +4,7 @@ export fn run() { let mut arr: Array = []; for let mut i = 0; i < 3; i += 1 { - arr.append(i * 10); + arr.push(i * 10); } // arr has 3 elements [0, 10, 20] // In-bounds checks diff --git a/wado-compiler/tests/fixtures/array_of_generic_struct.wado b/wado-compiler/tests/fixtures/array_of_generic_struct.wado index 993530543..9553e3697 100644 --- a/wado-compiler/tests/fixtures/array_of_generic_struct.wado +++ b/wado-compiler/tests/fixtures/array_of_generic_struct.wado @@ -19,7 +19,7 @@ impl Container { } fn add(&mut self, item: T) { - self.items.append(item); + self.items.push(item); self.size += 1; } } @@ -33,8 +33,8 @@ test "container-of-boxes" { test "array-of-boxes" { let mut arr: Array> = []; - arr.append(Box::::new(10)); - arr.append(Box::::new(20)); + arr.push(Box::::new(10)); + arr.push(Box::::new(20)); assert arr.len() == 2; assert arr[0].value == 10; assert arr[1].value == 20; diff --git a/wado-compiler/tests/fixtures/array_specialized.wado b/wado-compiler/tests/fixtures/array_specialized.wado index 2d2c17add..e9490d95f 100644 --- a/wado-compiler/tests/fixtures/array_specialized.wado +++ b/wado-compiler/tests/fixtures/array_specialized.wado @@ -4,9 +4,9 @@ use { println, Stdout } from "core:cli"; // from array_specialized_bool.wado fn array_specialized_bool() with Stdout { let mut arr: Array = []; - arr.append(true); - arr.append(false); - arr.append(true); + arr.push(true); + arr.push(false); + arr.push(true); for let x of arr { println(`{x}`); @@ -16,9 +16,9 @@ fn array_specialized_bool() with Stdout { // from array_specialized_char.wado fn array_specialized_char() with Stdout { let mut arr: Array = []; - arr.append('A'); - arr.append('B'); - arr.append('C'); + arr.push('A'); + arr.push('B'); + arr.push('C'); for let x of arr { println(`{x}`); @@ -28,9 +28,9 @@ fn array_specialized_char() with Stdout { // from array_specialized_f32.wado fn array_specialized_f32() with Stdout { let mut arr: Array = []; - arr.append(1.5 as f32); - arr.append(2.5 as f32); - arr.append(3.5 as f32); + arr.push(1.5 as f32); + arr.push(2.5 as f32); + arr.push(3.5 as f32); for let x of arr { println(`{x}`); @@ -40,9 +40,9 @@ fn array_specialized_f32() with Stdout { // from array_specialized_f64.wado fn array_specialized_f64() with Stdout { let mut arr: Array = []; - arr.append(1.5); - arr.append(2.5); - arr.append(3.5); + arr.push(1.5); + arr.push(2.5); + arr.push(3.5); for let x of arr { println(`{x}`); @@ -52,9 +52,9 @@ fn array_specialized_f64() with Stdout { // from array_specialized_i16.wado fn array_specialized_i16() with Stdout { let mut arr: Array = []; - arr.append(1000 as i16); - arr.append(-2000 as i16); - arr.append(3000 as i16); + arr.push(1000 as i16); + arr.push(-2000 as i16); + arr.push(3000 as i16); for let x of arr { println(`{x}`); @@ -64,9 +64,9 @@ fn array_specialized_i16() with Stdout { // from array_specialized_i32.wado fn array_specialized_i32() with Stdout { let mut arr: Array = []; - arr.append(100000); - arr.append(-200000); - arr.append(300000); + arr.push(100000); + arr.push(-200000); + arr.push(300000); for let x of arr { println(`{x}`); @@ -76,9 +76,9 @@ fn array_specialized_i32() with Stdout { // from array_specialized_i64.wado fn array_specialized_i64() with Stdout { let mut arr: Array = []; - arr.append(10000000000 as i64); - arr.append(-20000000000 as i64); - arr.append(30000000000 as i64); + arr.push(10000000000 as i64); + arr.push(-20000000000 as i64); + arr.push(30000000000 as i64); for let x of arr { println(`{x}`); @@ -88,9 +88,9 @@ fn array_specialized_i64() with Stdout { // from array_specialized_i8.wado fn array_specialized_i8() with Stdout { let mut arr: Array = []; - arr.append(1 as i8); - arr.append(-2 as i8); - arr.append(3 as i8); + arr.push(1 as i8); + arr.push(-2 as i8); + arr.push(3 as i8); for let x of arr { println(`{x}`); @@ -100,9 +100,9 @@ fn array_specialized_i8() with Stdout { // from array_specialized_string.wado fn array_specialized_string() with Stdout { let mut arr: Array = []; - arr.append("hello"); - arr.append("world"); - arr.append("!"); + arr.push("hello"); + arr.push("world"); + arr.push("!"); for let x of arr { println(`{x}`); @@ -112,9 +112,9 @@ fn array_specialized_string() with Stdout { // from array_specialized_tuple.wado fn array_specialized_tuple() with Stdout { let mut arr: Array<[bool, i32, String]> = []; - arr.append([true, 1, "one"]); - arr.append([false, 2, "two"]); - arr.append([true, 3, "three"]); + arr.push([true, 1, "one"]); + arr.push([false, 2, "two"]); + arr.push([true, 3, "three"]); for let x of arr { println(`{x.0} {x.1} {x.2}`); @@ -124,9 +124,9 @@ fn array_specialized_tuple() with Stdout { // from array_specialized_u16.wado fn array_specialized_u16() with Stdout { let mut arr: Array = []; - arr.append(1000 as u16); - arr.append(2000 as u16); - arr.append(3000 as u16); + arr.push(1000 as u16); + arr.push(2000 as u16); + arr.push(3000 as u16); for let x of arr { println(`{x}`); @@ -136,9 +136,9 @@ fn array_specialized_u16() with Stdout { // from array_specialized_u32.wado fn array_specialized_u32() with Stdout { let mut arr: Array = []; - arr.append(100000 as u32); - arr.append(200000 as u32); - arr.append(300000 as u32); + arr.push(100000 as u32); + arr.push(200000 as u32); + arr.push(300000 as u32); for let x of arr { println(`{x}`); @@ -148,9 +148,9 @@ fn array_specialized_u32() with Stdout { // from array_specialized_u64.wado fn array_specialized_u64() with Stdout { let mut arr: Array = []; - arr.append(10000000000 as u64); - arr.append(20000000000 as u64); - arr.append(30000000000 as u64); + arr.push(10000000000 as u64); + arr.push(20000000000 as u64); + arr.push(30000000000 as u64); for let x of arr { println(`{x}`); @@ -160,9 +160,9 @@ fn array_specialized_u64() with Stdout { // from array_specialized_u8.wado fn array_specialized_u8() with Stdout { let mut arr: Array = []; - arr.append(1 as u8); - arr.append(2 as u8); - arr.append(3 as u8); + arr.push(1 as u8); + arr.push(2 as u8); + arr.push(3 as u8); for let x of arr { println(`{x}`); diff --git a/wado-compiler/tests/fixtures/closure_1.wado b/wado-compiler/tests/fixtures/closure_1.wado index cd8f09ecc..e0566ec0f 100644 --- a/wado-compiler/tests/fixtures/closure_1.wado +++ b/wado-compiler/tests/fixtures/closure_1.wado @@ -31,7 +31,7 @@ impl Transform { fn for_each_item(items: Array, f: fn(i32) -> i32) -> Array { let mut result: Array = []; for let item of items { - result.append(f(item)); + result.push(f(item)); } return result; } diff --git a/wado-compiler/tests/fixtures/closure_2.wado b/wado-compiler/tests/fixtures/closure_2.wado index 8de1e98c6..dbbd418a5 100644 --- a/wado-compiler/tests/fixtures/closure_2.wado +++ b/wado-compiler/tests/fixtures/closure_2.wado @@ -250,7 +250,7 @@ test "loop scope c-style for" { for let mut i = 0; i < 5; i += 1 { let get_i = |_: i32| i; - closures.append(get_i); + closures.push(get_i); } assert call_fn(closures[0], 0) == 0; @@ -266,7 +266,7 @@ test "loop scope for-of" { for let item of items { let get_item = |_: i32| item; - closures.append(get_item); + closures.push(get_item); } assert call_fn(closures[0], 0) == 10; diff --git a/wado-compiler/tests/fixtures/dict_mini.wado b/wado-compiler/tests/fixtures/dict_mini.wado index 9c90da327..34b5f5e6d 100644 --- a/wado-compiler/tests/fixtures/dict_mini.wado +++ b/wado-compiler/tests/fixtures/dict_mini.wado @@ -25,7 +25,7 @@ impl MiniDict { } } // Key not found, append new entry - self.entries.append([key, value]); + self.entries.push([key, value]); } fn get(&self, key: K) -> Option { diff --git a/wado-compiler/tests/fixtures/from-literal-cast.wado b/wado-compiler/tests/fixtures/from-literal-cast.wado index 174db2fdd..ecaaccf75 100644 --- a/wado-compiler/tests/fixtures/from-literal-cast.wado +++ b/wado-compiler/tests/fixtures/from-literal-cast.wado @@ -25,8 +25,8 @@ impl KeyValueLiteralBuilder for PairList { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> PairList { diff --git a/wado-compiler/tests/fixtures/from-literal-custom.wado b/wado-compiler/tests/fixtures/from-literal-custom.wado index 9a594dc9d..b3bc9d470 100644 --- a/wado-compiler/tests/fixtures/from-literal-custom.wado +++ b/wado-compiler/tests/fixtures/from-literal-custom.wado @@ -26,8 +26,8 @@ impl KeyValueLiteralBuilder for LinearMap { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> LinearMap { diff --git a/wado-compiler/tests/fixtures/from-literal-enum-concrete.wado b/wado-compiler/tests/fixtures/from-literal-enum-concrete.wado index a9c2f7bbc..fc32bb6de 100644 --- a/wado-compiler/tests/fixtures/from-literal-enum-concrete.wado +++ b/wado-compiler/tests/fixtures/from-literal-enum-concrete.wado @@ -21,8 +21,8 @@ impl KeyValueLiteralBuilder for DirMap { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> DirMap { diff --git a/wado-compiler/tests/fixtures/from-literal-error-enum-mismatch.wado b/wado-compiler/tests/fixtures/from-literal-error-enum-mismatch.wado index 4dc47a042..208306529 100644 --- a/wado-compiler/tests/fixtures/from-literal-error-enum-mismatch.wado +++ b/wado-compiler/tests/fixtures/from-literal-error-enum-mismatch.wado @@ -17,8 +17,8 @@ impl KeyValueLiteralBuilder for DirMap { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> DirMap { diff --git a/wado-compiler/tests/fixtures/from-literal-error-flags-mismatch.wado b/wado-compiler/tests/fixtures/from-literal-error-flags-mismatch.wado index ae7b132b2..b7052a670 100644 --- a/wado-compiler/tests/fixtures/from-literal-error-flags-mismatch.wado +++ b/wado-compiler/tests/fixtures/from-literal-error-flags-mismatch.wado @@ -17,8 +17,8 @@ impl KeyValueLiteralBuilder for PermsMap { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> PermsMap { diff --git a/wado-compiler/tests/fixtures/from-literal-error-nested-generic-mismatch.wado b/wado-compiler/tests/fixtures/from-literal-error-nested-generic-mismatch.wado index 40c6f918a..a98478f22 100644 --- a/wado-compiler/tests/fixtures/from-literal-error-nested-generic-mismatch.wado +++ b/wado-compiler/tests/fixtures/from-literal-error-nested-generic-mismatch.wado @@ -19,8 +19,8 @@ impl KeyValueLiteralBuilder for NestedMap, V> { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> NestedMap, V> { diff --git a/wado-compiler/tests/fixtures/from-literal-error-newtype-mismatch.wado b/wado-compiler/tests/fixtures/from-literal-error-newtype-mismatch.wado index c8442406c..1d980ea73 100644 --- a/wado-compiler/tests/fixtures/from-literal-error-newtype-mismatch.wado +++ b/wado-compiler/tests/fixtures/from-literal-error-newtype-mismatch.wado @@ -17,8 +17,8 @@ impl KeyValueLiteralBuilder for TagMap { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> TagMap { diff --git a/wado-compiler/tests/fixtures/from-literal-error-variant-mismatch.wado b/wado-compiler/tests/fixtures/from-literal-error-variant-mismatch.wado index 84aab828b..50c820095 100644 --- a/wado-compiler/tests/fixtures/from-literal-error-variant-mismatch.wado +++ b/wado-compiler/tests/fixtures/from-literal-error-variant-mismatch.wado @@ -17,8 +17,8 @@ impl KeyValueLiteralBuilder for StatusMap { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> StatusMap { diff --git a/wado-compiler/tests/fixtures/from-literal-flags-concrete.wado b/wado-compiler/tests/fixtures/from-literal-flags-concrete.wado index 2d472ee77..ac071e421 100644 --- a/wado-compiler/tests/fixtures/from-literal-flags-concrete.wado +++ b/wado-compiler/tests/fixtures/from-literal-flags-concrete.wado @@ -19,8 +19,8 @@ impl KeyValueLiteralBuilder for PermsMap { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> PermsMap { diff --git a/wado-compiler/tests/fixtures/from-literal-fn-arg.wado b/wado-compiler/tests/fixtures/from-literal-fn-arg.wado index 905ed8473..b5cff2797 100644 --- a/wado-compiler/tests/fixtures/from-literal-fn-arg.wado +++ b/wado-compiler/tests/fixtures/from-literal-fn-arg.wado @@ -34,8 +34,8 @@ impl KeyValueLiteralBuilder for SimpleMap { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> SimpleMap { diff --git a/wado-compiler/tests/fixtures/from-literal-nested-generic.wado b/wado-compiler/tests/fixtures/from-literal-nested-generic.wado index 8332aeffe..0dfbcb065 100644 --- a/wado-compiler/tests/fixtures/from-literal-nested-generic.wado +++ b/wado-compiler/tests/fixtures/from-literal-nested-generic.wado @@ -22,8 +22,8 @@ impl KeyValueLiteralBuilder for NestedMap, V> { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> NestedMap, V> { diff --git a/wado-compiler/tests/fixtures/from-literal-newtype-concrete.wado b/wado-compiler/tests/fixtures/from-literal-newtype-concrete.wado index aafe26c8e..9a77a7f9f 100644 --- a/wado-compiler/tests/fixtures/from-literal-newtype-concrete.wado +++ b/wado-compiler/tests/fixtures/from-literal-newtype-concrete.wado @@ -16,8 +16,8 @@ impl KeyValueLiteralBuilder for TagMap { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> TagMap { diff --git a/wado-compiler/tests/fixtures/from-literal-variant-concrete.wado b/wado-compiler/tests/fixtures/from-literal-variant-concrete.wado index f272633b4..780c4ee2f 100644 --- a/wado-compiler/tests/fixtures/from-literal-variant-concrete.wado +++ b/wado-compiler/tests/fixtures/from-literal-variant-concrete.wado @@ -19,8 +19,8 @@ impl KeyValueLiteralBuilder for StatusMap { } fn insert_literal(&mut self, key: String, value: Self::Value) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> StatusMap { diff --git a/wado-compiler/tests/fixtures/generic_advanced.wado b/wado-compiler/tests/fixtures/generic_advanced.wado index 2a55ae51a..2063eb787 100644 --- a/wado-compiler/tests/fixtures/generic_advanced.wado +++ b/wado-compiler/tests/fixtures/generic_advanced.wado @@ -51,7 +51,7 @@ impl MonoContainer { return MonoContainer { items: [] as Array }; } fn add(&mut self, item: T) { - self.items.append(item); + self.items.push(item); } fn len(&self) -> i32 { return self.items.len(); diff --git a/wado-compiler/tests/fixtures/generic_struct_1.wado b/wado-compiler/tests/fixtures/generic_struct_1.wado index 69e086644..8c49332ba 100644 --- a/wado-compiler/tests/fixtures/generic_struct_1.wado +++ b/wado-compiler/tests/fixtures/generic_struct_1.wado @@ -121,7 +121,7 @@ test "array of non-generic struct" { test "array direct" { let mut arr: Array = []; - arr.append(42); + arr.push(42); assert arr.len() == 1; } diff --git a/wado-compiler/tests/fixtures/global_2.wado b/wado-compiler/tests/fixtures/global_2.wado index f8417e4df..19353ff79 100644 --- a/wado-compiler/tests/fixtures/global_2.wado +++ b/wado-compiler/tests/fixtures/global_2.wado @@ -107,7 +107,7 @@ fn test_functions() with Stdout { fn test_object() with Stdout { println(`len={ITEMS.len()}`); println(`item0={ITEMS[0]}`); - ITEMS.append(4); + ITEMS.push(4); println(`after append len={ITEMS.len()}`); println(MESSAGE); MESSAGE = "Updated!"; diff --git a/wado-compiler/tests/fixtures/inline_array_append_nested.wado b/wado-compiler/tests/fixtures/inline_array_append_nested.wado index 0ba99ed8b..f4392f3c0 100644 --- a/wado-compiler/tests/fixtures/inline_array_append_nested.wado +++ b/wado-compiler/tests/fixtures/inline_array_append_nested.wado @@ -11,8 +11,8 @@ impl Container { fn add_items(&mut self, count: i32) { for let mut i = 0; i < count; i += 1 { // Multiple append calls in a loop - self.items.append(i); - self.items.append(i * 2); + self.items.push(i); + self.items.push(i * 2); } } @@ -23,13 +23,13 @@ impl Container { for let mut i = 0; i < self.items.len(); i += 1 { let val = self.items[i]; if val % 2 == 0 { - temp.append(val); + temp.push(val); } } // Copy back for let mut j = 0; j < temp.len(); j += 1 { - self.items.append(temp[j] + 100); + self.items.push(temp[j] + 100); } } } diff --git a/wado-compiler/tests/fixtures/inline_cross_module_method.wado b/wado-compiler/tests/fixtures/inline_cross_module_method.wado index 86533c1b6..e2bc18a43 100644 --- a/wado-compiler/tests/fixtures/inline_cross_module_method.wado +++ b/wado-compiler/tests/fixtures/inline_cross_module_method.wado @@ -5,7 +5,7 @@ export fn run() { let mut arr: Array = [10, 20, 30]; - arr.append(40); + arr.push(40); assert arr.len() == 4; } @@ -13,6 +13,6 @@ __DATA__ { "stdout": "", "wir_expect:O0": [ - "fn Array::append(self, value) {" + "fn Array::push(self, value) {" ] } diff --git a/wado-compiler/tests/fixtures/inline_merged.wado b/wado-compiler/tests/fixtures/inline_merged.wado index 65a4270ca..e88b921d2 100644 --- a/wado-compiler/tests/fixtures/inline_merged.wado +++ b/wado-compiler/tests/fixtures/inline_merged.wado @@ -3,7 +3,7 @@ use { println, Stdout } from "core:cli"; fn test_array_append_minimal() with Stdout { let mut arr: Array = []; for let mut i = 0; i < 3; i += 1 { - arr.append(i); + arr.push(i); } println(`len={arr.len()}`); } @@ -105,9 +105,9 @@ fn test_match_tuple() with Stdout { fn test_method_minimal() with Stdout { let mut arr1: Array = []; let mut arr2: Array = []; - arr1.append(1); - arr1.append(2); - arr2.append(3); + arr1.push(1); + arr1.push(2); + arr2.push(3); let a = arr1[0]; let b = arr2[0]; println(`Result: {a}, {b}`); diff --git a/wado-compiler/tests/fixtures/key-value-literal-blanket-impl.wado b/wado-compiler/tests/fixtures/key-value-literal-blanket-impl.wado index 0e83279a1..482626836 100644 --- a/wado-compiler/tests/fixtures/key-value-literal-blanket-impl.wado +++ b/wado-compiler/tests/fixtures/key-value-literal-blanket-impl.wado @@ -37,8 +37,8 @@ impl KeyValueLiteralBuilder for Bag { } fn insert_literal(&mut self, key: String, value: V) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> Bag { diff --git a/wado-compiler/tests/fixtures/key-value-literal-both-traits.wado b/wado-compiler/tests/fixtures/key-value-literal-both-traits.wado index b000b8029..7892c5c87 100644 --- a/wado-compiler/tests/fixtures/key-value-literal-both-traits.wado +++ b/wado-compiler/tests/fixtures/key-value-literal-both-traits.wado @@ -43,8 +43,8 @@ impl KeyValueLiteralBuilder for Bag { } fn insert_literal(&mut self, key: String, value: T) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> Bag { @@ -61,7 +61,7 @@ impl SequenceLiteralBuilder for Bag { } fn push_literal(&mut self, value: T) { - self.values.append(value); + self.values.push(value); } fn build(&self) -> Bag { diff --git a/wado-compiler/tests/fixtures/key-value-literal-immutable.wado b/wado-compiler/tests/fixtures/key-value-literal-immutable.wado index 5935c3471..076cd4ee4 100644 --- a/wado-compiler/tests/fixtures/key-value-literal-immutable.wado +++ b/wado-compiler/tests/fixtures/key-value-literal-immutable.wado @@ -38,8 +38,8 @@ impl KeyValueLiteralBuilder for FrozenMapBuilder { } fn insert_literal(&mut self, key: String, value: V) { - self.keys.append(key); - self.values.append(value); + self.keys.push(key); + self.values.push(value); } fn build(&self) -> FrozenMap { diff --git a/wado-compiler/tests/fixtures/match_1.wado b/wado-compiler/tests/fixtures/match_1.wado index eafc8a55a..ce3b6f8b9 100644 --- a/wado-compiler/tests/fixtures/match_1.wado +++ b/wado-compiler/tests/fixtures/match_1.wado @@ -32,7 +32,7 @@ fn classify_builder(x: i32) -> String { _ && x > 0 => { if x > 10 { let mut s = String::with_capacity(8); - s.append("big"); + s.push_str("big"); s } else { "small" diff --git a/wado-compiler/tests/fixtures/match_variant_2.wado b/wado-compiler/tests/fixtures/match_variant_2.wado index 307af2260..d0e48361e 100644 --- a/wado-compiler/tests/fixtures/match_variant_2.wado +++ b/wado-compiler/tests/fixtures/match_variant_2.wado @@ -26,9 +26,9 @@ fn apply_padding(s: String, spec: FormatSpec) -> String { return match spec.align { Left => { - result.append(s); + result.push_str(s); for let mut i = 0; i < pad_len; i += 1 { - result.append_char(fill); + result.push(fill); } result; }, @@ -36,19 +36,19 @@ fn apply_padding(s: String, spec: FormatSpec) -> String { let left_pad = pad_len / 2; let right_pad = pad_len - left_pad; for let mut i = 0; i < left_pad; i += 1 { - result.append_char(fill); + result.push(fill); } - result.append(s); + result.push_str(s); for let mut i = 0; i < right_pad; i += 1 { - result.append_char(fill); + result.push(fill); } result; }, Right => { for let mut i = 0; i < pad_len; i += 1 { - result.append_char(fill); + result.push(fill); } - result.append(s); + result.push_str(s); result; }, }; diff --git a/wado-compiler/tests/fixtures/match_variant_import_module.wado b/wado-compiler/tests/fixtures/match_variant_import_module.wado index 5b1def687..81503a3a0 100644 --- a/wado-compiler/tests/fixtures/match_variant_import_module.wado +++ b/wado-compiler/tests/fixtures/match_variant_import_module.wado @@ -25,9 +25,9 @@ pub fn apply_padding(s: String, spec: FormatSpec) -> String { return match spec.align { Left => { - result.append(s); + result.push_str(s); for let mut i = 0; i < pad_len; i += 1 { - result.append_char(fill); + result.push(fill); } result; }, @@ -35,19 +35,19 @@ pub fn apply_padding(s: String, spec: FormatSpec) -> String { let left_pad = pad_len / 2; let right_pad = pad_len - left_pad; for let mut i = 0; i < left_pad; i += 1 { - result.append_char(fill); + result.push(fill); } - result.append(s); + result.push_str(s); for let mut i = 0; i < right_pad; i += 1 { - result.append_char(fill); + result.push(fill); } result; }, Right => { for let mut i = 0; i < pad_len; i += 1 { - result.append_char(fill); + result.push(fill); } - result.append(s); + result.push_str(s); result; }, }; diff --git a/wado-compiler/tests/fixtures/mut_param.wado b/wado-compiler/tests/fixtures/mut_param.wado index fcf4c3198..99ae0a803 100644 --- a/wado-compiler/tests/fixtures/mut_param.wado +++ b/wado-compiler/tests/fixtures/mut_param.wado @@ -46,7 +46,7 @@ fn replace_string(mut s: String) -> String { // Appending to a mut string param does not affect the caller's string. fn append_bang(mut s: String) -> String { - s.append("!"); + s.push_str("!"); return s; } diff --git a/wado-compiler/tests/fixtures/mut_param_merged.wado b/wado-compiler/tests/fixtures/mut_param_merged.wado index e1a8f1fc0..585b0d4b3 100644 --- a/wado-compiler/tests/fixtures/mut_param_merged.wado +++ b/wado-compiler/tests/fixtures/mut_param_merged.wado @@ -19,7 +19,7 @@ fn replace(mut s: String) -> String { // Appending to a mut string param does not affect the caller's string. fn append_bang(mut s: String) -> String { - s.append("!"); + s.push_str("!"); return s; } @@ -37,7 +37,7 @@ fn double_first(mut arr: Array) -> Array { // Appending to a mut array param does not affect the caller's array. fn push_zero(mut arr: Array) -> Array { - arr.append(0); + arr.push(0); return arr; } diff --git a/wado-compiler/tests/fixtures/nested_array.wado b/wado-compiler/tests/fixtures/nested_array.wado index 690b52562..32f150b67 100644 --- a/wado-compiler/tests/fixtures/nested_array.wado +++ b/wado-compiler/tests/fixtures/nested_array.wado @@ -64,7 +64,7 @@ fn nested_array_mutate_test() with Stdout { // Append to inner array let mut row = matrix[0]; - row.append(99); + row.push(99); println(`{row:?}`); // Replace inner array diff --git a/wado-compiler/tests/fixtures/newtype_generic.wado b/wado-compiler/tests/fixtures/newtype_generic.wado index c4561a8c8..9c8383484 100644 --- a/wado-compiler/tests/fixtures/newtype_generic.wado +++ b/wado-compiler/tests/fixtures/newtype_generic.wado @@ -21,7 +21,7 @@ export fn run() with Stdout { // Mutable operations let mut arr2: MyArray = [10, 20]; - arr2.append(30); + arr2.push(30); println(`after append: {arr2.len()}`); // Different element types diff --git a/wado-compiler/tests/fixtures/newtype_generic_container_return.wado b/wado-compiler/tests/fixtures/newtype_generic_container_return.wado index e216f13a5..3631c0f83 100644 --- a/wado-compiler/tests/fixtures/newtype_generic_container_return.wado +++ b/wado-compiler/tests/fixtures/newtype_generic_container_return.wado @@ -21,7 +21,7 @@ impl Point { fn make_list(&self) -> Array { let mut arr: Array = []; - arr.append(Point { x: self.x, y: self.y }); + arr.push(Point { x: self.x, y: self.y }); return arr; } } diff --git a/wado-compiler/tests/fixtures/pattern_mut_binding.wado b/wado-compiler/tests/fixtures/pattern_mut_binding.wado index 824df6501..5a3eb4442 100644 --- a/wado-compiler/tests/fixtures/pattern_mut_binding.wado +++ b/wado-compiler/tests/fixtures/pattern_mut_binding.wado @@ -40,7 +40,7 @@ export fn run() with Stdout { // mut binding with String — append does not affect original let opt_str = Option::::Some("hello"); if let Some(mut s) = opt_str { - s.append(" world"); + s.push_str(" world"); assert s == "hello world"; println(`mutated: {s}`); } @@ -52,7 +52,7 @@ export fn run() with Stdout { // mut binding with Array — append does not affect original let opt_arr = Option::>::Some([1, 2, 3] as Array); if let Some(mut arr) = opt_arr { - arr.append(4); + arr.push(4); assert arr.len() == 4; println(`mutated len: {arr.len()}`); } diff --git a/wado-compiler/tests/fixtures/ref_2.wado b/wado-compiler/tests/fixtures/ref_2.wado index 42d85a054..50450ad7f 100644 --- a/wado-compiler/tests/fixtures/ref_2.wado +++ b/wado-compiler/tests/fixtures/ref_2.wado @@ -2,8 +2,8 @@ use { println, Stdout } from "core:cli"; // ref_mut fn append_elements(arr: &mut Array) { - arr.append(4); - arr.append(5); + arr.push(4); + arr.push(5); } fn double_all(arr: &mut Array) { @@ -13,12 +13,12 @@ fn double_all(arr: &mut Array) { } fn append_world(s: &mut String) { - s.append(", World!"); + s.push_str(", World!"); } fn append_twice(s: &mut String, suffix: String) { - s.append(suffix); - s.append(suffix); + s.push_str(suffix); + s.push_str(suffix); } // ref_loop_mut @@ -75,12 +75,12 @@ fn process(arr: &mut Array, input: &Array, count: i32) { while i < count { let val = input[i]; if val < 128 { - arr.append(val); + arr.push(val); } else { let dist = (val - 128) as i32; let src = arr.len() - dist; - arr.append(arr[src]); - arr.append(arr[src + 1]); + arr.push(arr[src]); + arr.push(arr[src + 1]); } i += 1; } diff --git a/wado-compiler/tests/fixtures/result_unwrap_fresh_elision.wado b/wado-compiler/tests/fixtures/result_unwrap_fresh_elision.wado index 03e81236b..d139e3e1b 100644 --- a/wado-compiler/tests/fixtures/result_unwrap_fresh_elision.wado +++ b/wado-compiler/tests/fixtures/result_unwrap_fresh_elision.wado @@ -6,9 +6,9 @@ use { println } from "core:cli"; fn make_result() -> Result, String> { let mut arr: Array = []; - arr.append(1); - arr.append(2); - arr.append(3); + arr.push(1); + arr.push(2); + arr.push(3); return Result::, String>::Ok(arr); } diff --git a/wado-compiler/tests/fixtures/sequence-literal-custom.wado b/wado-compiler/tests/fixtures/sequence-literal-custom.wado index dd0bd6800..32c49c622 100644 --- a/wado-compiler/tests/fixtures/sequence-literal-custom.wado +++ b/wado-compiler/tests/fixtures/sequence-literal-custom.wado @@ -29,7 +29,7 @@ impl SequenceLiteralBuilder for SeqVec { } fn push_literal(&mut self, value: Self::Element) { - self.items.append(value); + self.items.push(value); } fn build(&self) -> SeqVec { diff --git a/wado-compiler/tests/fixtures/sequence-literal-fn-arg.wado b/wado-compiler/tests/fixtures/sequence-literal-fn-arg.wado index 52d282d6b..59d24671a 100644 --- a/wado-compiler/tests/fixtures/sequence-literal-fn-arg.wado +++ b/wado-compiler/tests/fixtures/sequence-literal-fn-arg.wado @@ -28,7 +28,7 @@ impl SequenceLiteralBuilder for SeqVec { } fn push_literal(&mut self, value: Self::Element) { - self.items.append(value); + self.items.push(value); } fn build(&self) -> SeqVec { diff --git a/wado-compiler/tests/fixtures/sequence-literal-immutable.wado b/wado-compiler/tests/fixtures/sequence-literal-immutable.wado index 552956ef6..72e9f79e0 100644 --- a/wado-compiler/tests/fixtures/sequence-literal-immutable.wado +++ b/wado-compiler/tests/fixtures/sequence-literal-immutable.wado @@ -29,7 +29,7 @@ impl SequenceLiteralBuilder for FrozenVecBuilder { } fn push_literal(&mut self, value: T) { - self.items.append(value); + self.items.push(value); } fn build(&self) -> FrozenVec { diff --git a/wado-compiler/tests/fixtures/sequence-literal-newtype.wado b/wado-compiler/tests/fixtures/sequence-literal-newtype.wado index cd0888d7f..dcc52a0a4 100644 --- a/wado-compiler/tests/fixtures/sequence-literal-newtype.wado +++ b/wado-compiler/tests/fixtures/sequence-literal-newtype.wado @@ -19,7 +19,7 @@ impl SequenceLiteralBuilder for Vec3Builder { } fn push_literal(&mut self, value: f64) { - self.values.append(value); + self.values.push(value); } fn build(&self) -> Vec3 { diff --git a/wado-compiler/tests/fixtures/serde_full_json_serialize.wado b/wado-compiler/tests/fixtures/serde_full_json_serialize.wado index 30b242419..ab23dde92 100644 --- a/wado-compiler/tests/fixtures/serde_full_json_serialize.wado +++ b/wado-compiler/tests/fixtures/serde_full_json_serialize.wado @@ -44,7 +44,7 @@ struct JsonWriter { impl JsonWriter { fn write(&mut self, s: &String) { - self.buf.append(*s); + self.buf.push_str(*s); } } diff --git a/wado-compiler/tests/fixtures/serde_generic_trait_method.wado b/wado-compiler/tests/fixtures/serde_generic_trait_method.wado index 7cc22cf9a..da7ad2370 100644 --- a/wado-compiler/tests/fixtures/serde_generic_trait_method.wado +++ b/wado-compiler/tests/fixtures/serde_generic_trait_method.wado @@ -28,7 +28,7 @@ struct Buffer { impl Writer for Buffer { fn write_value(&mut self, value: &T) { - self.data.append(value.to_text()); + self.data.push_str(value.to_text()); } } @@ -36,7 +36,7 @@ export fn run() with Stdout { let mut buf = Buffer { data: "" }; let n = 42; buf.write_value::(&n); - buf.data.append(","); + buf.data.push_str(","); let s = "hello"; buf.write_value::(&s); println(buf.data); diff --git a/wado-compiler/tests/fixtures/serde_serialize_array.wado b/wado-compiler/tests/fixtures/serde_serialize_array.wado index ab50c83c2..3b93c3e2a 100644 --- a/wado-compiler/tests/fixtures/serde_serialize_array.wado +++ b/wado-compiler/tests/fixtures/serde_serialize_array.wado @@ -36,17 +36,17 @@ impl Serializer for JsonSerializer { type SeqSerializer = JsonSeqSerializer; fn serialize_i32(&mut self, v: i32) -> Result<(), SerializeError> { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_string(&mut self, v: &String) -> Result<(), SerializeError> { - self.buf.append(`"{*v}"`); + self.buf.push_str(`"{*v}"`); return Result::<(), SerializeError>::Ok(()); } fn begin_seq(&mut self, len: i32) -> Result { - self.buf.append("["); + self.buf.push_str("["); return Result::::Ok(JsonSeqSerializer { ser: *self, count: 0, @@ -57,7 +57,7 @@ impl Serializer for JsonSerializer { impl SerializeSeq for JsonSeqSerializer { fn element(&mut self, value: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.ser.buf.append(","); + self.ser.buf.push_str(","); } value.serialize::(&mut self.ser); self.count += 1; @@ -65,7 +65,7 @@ impl SerializeSeq for JsonSeqSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.ser.buf.append("]"); + self.ser.buf.push_str("]"); return Result::<(), SerializeError>::Ok(()); } } diff --git a/wado-compiler/tests/fixtures/serde_serialize_enum.wado b/wado-compiler/tests/fixtures/serde_serialize_enum.wado index e1345b54d..c98b52545 100644 --- a/wado-compiler/tests/fixtures/serde_serialize_enum.wado +++ b/wado-compiler/tests/fixtures/serde_serialize_enum.wado @@ -20,12 +20,12 @@ struct JsonSerializer { impl Serializer for JsonSerializer { fn serialize_string(&mut self, v: &String) -> Result<(), SerializeError> { - self.buf.append(`"{*v}"`); + self.buf.push_str(`"{*v}"`); return Result::<(), SerializeError>::Ok(()); } fn serialize_unit_variant(&mut self, type_name: &String, variant_name: &String, disc: i32) -> Result<(), SerializeError> { - self.buf.append(`"{*variant_name}"`); + self.buf.push_str(`"{*variant_name}"`); return Result::<(), SerializeError>::Ok(()); } } diff --git a/wado-compiler/tests/fixtures/serde_serialize_option.wado b/wado-compiler/tests/fixtures/serde_serialize_option.wado index 4d5174b01..6ca9652ae 100644 --- a/wado-compiler/tests/fixtures/serde_serialize_option.wado +++ b/wado-compiler/tests/fixtures/serde_serialize_option.wado @@ -21,12 +21,12 @@ struct JsonSerializer { impl Serializer for JsonSerializer { fn serialize_i32(&mut self, v: i32) -> Result<(), SerializeError> { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_null(&mut self) -> Result<(), SerializeError> { - self.buf.append("null"); + self.buf.push_str("null"); return Result::<(), SerializeError>::Ok(()); } } diff --git a/wado-compiler/tests/fixtures/serde_serialize_struct.wado b/wado-compiler/tests/fixtures/serde_serialize_struct.wado index 0fbba84fa..9db4ebe1b 100644 --- a/wado-compiler/tests/fixtures/serde_serialize_struct.wado +++ b/wado-compiler/tests/fixtures/serde_serialize_struct.wado @@ -38,26 +38,26 @@ impl Serializer for JsonSerializer { type StructSerializer = JsonStructSerializer; fn serialize_i32(&mut self, v: i32) -> Result<(), SerializeError> { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_string(&mut self, v: &String) -> Result<(), SerializeError> { - self.buf.append(`"{*v}"`); + self.buf.push_str(`"{*v}"`); return Result::<(), SerializeError>::Ok(()); } fn serialize_bool(&mut self, v: bool) -> Result<(), SerializeError> { if v { - self.buf.append("true"); + self.buf.push_str("true"); } else { - self.buf.append("false"); + self.buf.push_str("false"); } return Result::<(), SerializeError>::Ok(()); } fn begin_struct(&mut self, name: &String, fields: i32) -> Result { - self.buf.append("{"); + self.buf.push_str("{"); return Result::::Ok(JsonStructSerializer { ser: *self, count: 0, @@ -68,16 +68,16 @@ impl Serializer for JsonSerializer { impl SerializeStruct for JsonStructSerializer { fn field(&mut self, name: &String, value: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.ser.buf.append(","); + self.ser.buf.push_str(","); } - self.ser.buf.append(`"{*name}":`); + self.ser.buf.push_str(`"{*name}":`); value.serialize::(&mut self.ser); self.count += 1; return Result::<(), SerializeError>::Ok(()); } fn end(&mut self) -> Result<(), SerializeError> { - self.ser.buf.append("}"); + self.ser.buf.push_str("}"); return Result::<(), SerializeError>::Ok(()); } } diff --git a/wado-compiler/tests/fixtures/serde_serialize_trait.wado b/wado-compiler/tests/fixtures/serde_serialize_trait.wado index 4af3f79b0..6f2b6c62d 100644 --- a/wado-compiler/tests/fixtures/serde_serialize_trait.wado +++ b/wado-compiler/tests/fixtures/serde_serialize_trait.wado @@ -25,12 +25,12 @@ struct TextSerializer { impl Serializer for TextSerializer { fn serialize_i32(&mut self, v: i32) -> Result<(), SerializeError> { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_string(&mut self, v: &String) -> Result<(), SerializeError> { - self.buf.append(`"{*v}"`); + self.buf.push_str(`"{*v}"`); return Result::<(), SerializeError>::Ok(()); } } diff --git a/wado-compiler/tests/fixtures/serde_serialize_variant.wado b/wado-compiler/tests/fixtures/serde_serialize_variant.wado index c80473f27..d03c87d09 100644 --- a/wado-compiler/tests/fixtures/serde_serialize_variant.wado +++ b/wado-compiler/tests/fixtures/serde_serialize_variant.wado @@ -34,17 +34,17 @@ impl Serializer for JsonSerializer { type VariantSerializer = JsonVariantSerializer; fn serialize_f64(&mut self, v: f64) -> Result<(), SerializeError> { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_unit_variant(&mut self, type_name: &String, variant_name: &String, disc: i32) -> Result<(), SerializeError> { - self.buf.append(`"{*variant_name}"`); + self.buf.push_str(`"{*variant_name}"`); return Result::<(), SerializeError>::Ok(()); } fn begin_variant(&mut self, type_name: &String, variant_name: &String, disc: i32) -> Result { - self.buf.append(String::concat(String::concat(String::concat("{\"", *variant_name), "\""), ":")); + self.buf.push_str(String::concat(String::concat(String::concat("{\"", *variant_name), "\""), ":")); return Result::::Ok(JsonVariantSerializer { ser: *self, }); @@ -57,7 +57,7 @@ impl SerializeVariant for JsonVariantSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.ser.buf.append("}"); + self.ser.buf.push_str("}"); return Result::<(), SerializeError>::Ok(()); } } diff --git a/wado-compiler/tests/fixtures/serde_sub_serializer.wado b/wado-compiler/tests/fixtures/serde_sub_serializer.wado index 9c8e6e77a..667ab6861 100644 --- a/wado-compiler/tests/fixtures/serde_sub_serializer.wado +++ b/wado-compiler/tests/fixtures/serde_sub_serializer.wado @@ -53,17 +53,17 @@ impl Serializer for TextSerializer { type StructSerializer = TextStructSerializer; fn serialize_i32(&mut self, v: i32) -> Result<(), SerializeError> { - self.buf.append(`{v}`); + self.buf.push_str(`{v}`); return Result::<(), SerializeError>::Ok(()); } fn serialize_string(&mut self, v: &String) -> Result<(), SerializeError> { - self.buf.append(`"{*v}"`); + self.buf.push_str(`"{*v}"`); return Result::<(), SerializeError>::Ok(()); } fn begin_seq(&mut self, len: i32) -> Result { - self.buf.append("["); + self.buf.push_str("["); return Result::::Ok(TextSeqSerializer { parent: *self, count: 0, @@ -71,7 +71,7 @@ impl Serializer for TextSerializer { } fn begin_struct(&mut self, name: &String, fields: i32) -> Result { - self.buf.append("{"); + self.buf.push_str("{"); return Result::::Ok(TextStructSerializer { parent: *self, count: 0, @@ -82,7 +82,7 @@ impl Serializer for TextSerializer { impl SerializeSeq for TextSeqSerializer { fn element(&mut self, value: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.parent.buf.append(","); + self.parent.buf.push_str(","); } value.serialize::(&mut self.parent); self.count += 1; @@ -90,7 +90,7 @@ impl SerializeSeq for TextSeqSerializer { } fn end(&mut self) -> Result<(), SerializeError> { - self.parent.buf.append("]"); + self.parent.buf.push_str("]"); return Result::<(), SerializeError>::Ok(()); } } @@ -98,16 +98,16 @@ impl SerializeSeq for TextSeqSerializer { impl SerializeStruct for TextStructSerializer { fn field(&mut self, name: &String, value: &T) -> Result<(), SerializeError> { if self.count > 0 { - self.parent.buf.append(","); + self.parent.buf.push_str(","); } - self.parent.buf.append(`"{*name}":`); + self.parent.buf.push_str(`"{*name}":`); value.serialize::(&mut self.parent); self.count += 1; return Result::<(), SerializeError>::Ok(()); } fn end(&mut self) -> Result<(), SerializeError> { - self.parent.buf.append("}"); + self.parent.buf.push_str("}"); return Result::<(), SerializeError>::Ok(()); } } diff --git a/wado-compiler/tests/fixtures/static_1.wado b/wado-compiler/tests/fixtures/static_1.wado index 3429d4364..2e77c0b92 100644 --- a/wado-compiler/tests/fixtures/static_1.wado +++ b/wado-compiler/tests/fixtures/static_1.wado @@ -157,9 +157,9 @@ test "static method generic (Array::with_capacity)" { let mut arr = Array::::with_capacity(10); assert arr.len() == 0; - arr.append(1); - arr.append(2); - arr.append(3); + arr.push(1); + arr.push(2); + arr.push(3); assert arr.len() == 3; assert arr[0] == 1; assert arr[1] == 2; diff --git a/wado-compiler/tests/fixtures/static_2.wado b/wado-compiler/tests/fixtures/static_2.wado index 2e7978a7d..fc2c0faca 100644 --- a/wado-compiler/tests/fixtures/static_2.wado +++ b/wado-compiler/tests/fixtures/static_2.wado @@ -65,8 +65,8 @@ struct Factory { impl Factory { pub fn make_array(first: U, second: U) -> Array { let mut arr: Array = []; - arr.append(first); - arr.append(second); + arr.push(first); + arr.push(second); return arr; } } diff --git a/wado-compiler/tests/fixtures/stream-http-echo.wado b/wado-compiler/tests/fixtures/stream-http-echo.wado index 7a1472dd0..1eb1e4edd 100644 --- a/wado-compiler/tests/fixtures/stream-http-echo.wado +++ b/wado-compiler/tests/fixtures/stream-http-echo.wado @@ -14,7 +14,7 @@ export async fn handle(request: Request) -> Result { if chunk.len() == 0 { break; } - chunks.append(chunk); + chunks.push(chunk); } body_stream.drop(); diff --git a/wado-compiler/tests/fixtures/stream-http-response-body-string.wado b/wado-compiler/tests/fixtures/stream-http-response-body-string.wado index 9f64cda54..fd86228cf 100644 --- a/wado-compiler/tests/fixtures/stream-http-response-body-string.wado +++ b/wado-compiler/tests/fixtures/stream-http-response-body-string.wado @@ -6,7 +6,7 @@ use { Request, Response, ErrorCode, Fields, Trailers } from "wasi:http"; fn string_to_bytes(s: String) -> Array { let mut bytes: Array = []; for let c of s.chars() { - bytes.append(c as u8); + bytes.push(c as u8); } return bytes; } diff --git a/wado-compiler/tests/fixtures/sub/zlib_cross_compress.wado b/wado-compiler/tests/fixtures/sub/zlib_cross_compress.wado index b1b052e6d..58878b2c3 100644 --- a/wado-compiler/tests/fixtures/sub/zlib_cross_compress.wado +++ b/wado-compiler/tests/fixtures/sub/zlib_cross_compress.wado @@ -51,7 +51,7 @@ fn read_all_stdin() -> Array with Stdin { break; } for let mut i = 0; i < chunk.len(); i += 1 { - buf.append(chunk[i]); + buf.push(chunk[i]); } } stdin_stream.drop(); @@ -90,7 +90,7 @@ export fn run() with Stdout, Stdin { let level = input[1] as i32; let mut data: Array = []; for let mut i = 2; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let result = compress2(&data, level); print_bytes(&result); @@ -99,7 +99,7 @@ export fn run() with Stdout, Stdin { let level = input[1] as i32; let mut data: Array = []; for let mut i = 2; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let result = deflate_raw2(&data, level); print_bytes(&result); @@ -108,7 +108,7 @@ export fn run() with Stdout, Stdin { let level = input[1] as i32; let mut data: Array = []; for let mut i = 2; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let result = gzip_compress2(&data, level); print_bytes(&result); @@ -116,7 +116,7 @@ export fn run() with Stdout, Stdin { // zlib_compress_stored: data=input[1..] let mut data: Array = []; for let mut i = 1; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let result = zlib_compress_stored(&data); print_bytes(&result); @@ -126,7 +126,7 @@ export fn run() with Stdout, Stdin { let strategy = input[2] as i32; let mut data: Array = []; for let mut i = 3; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let result = compress_with_strategy(&data, level, strategy); print_bytes(&result); @@ -134,7 +134,7 @@ export fn run() with Stdout, Stdin { // checksums: data=input[1..] let mut data: Array = []; for let mut i = 1; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let len = data.len(); let a = adler32(adler32_init(), &data, 0, len); @@ -166,7 +166,7 @@ export fn run() with Stdout, Stdin { let split = read_be_i32(&input, 1); let mut data: Array = []; for let mut i = 5; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let total_len = data.len(); let a1 = adler32(adler32_init(), &data, 0, split); @@ -177,7 +177,7 @@ export fn run() with Stdout, Stdin { let split = read_be_i32(&input, 1); let mut data: Array = []; for let mut i = 5; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let total_len = data.len(); let c1 = crc32(crc32_init(), &data, 0, split); @@ -188,7 +188,7 @@ export fn run() with Stdout, Stdin { let level = input[1] as i32; let mut data: Array = []; for let mut i = 2; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let mut ds = DeflateStream::new(level); let result = ds.compress(&data); @@ -198,7 +198,7 @@ export fn run() with Stdout, Stdin { let level = input[1] as i32; let mut data: Array = []; for let mut i = 2; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let mut ds = DeflateStream::new_with_format(level, RAW_FORMAT); let result = ds.compress(&data); @@ -208,7 +208,7 @@ export fn run() with Stdout, Stdin { let level = input[1] as i32; let mut data: Array = []; for let mut i = 2; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } let mut ds = DeflateStream::new_with_format(level, GZIP_FORMAT); let result = ds.compress(&data); diff --git a/wado-compiler/tests/fixtures/sub/zlib_cross_inflate.wado b/wado-compiler/tests/fixtures/sub/zlib_cross_inflate.wado index 16303fcd9..67593aa38 100644 --- a/wado-compiler/tests/fixtures/sub/zlib_cross_inflate.wado +++ b/wado-compiler/tests/fixtures/sub/zlib_cross_inflate.wado @@ -25,7 +25,7 @@ fn read_all_stdin() -> Array with Stdin { break; } for let mut i = 0; i < chunk.len(); i += 1 { - buf.append(chunk[i]); + buf.push(chunk[i]); } } stdin_stream.drop(); @@ -52,7 +52,7 @@ export fn run() with Stdout, Stdin { let cmd = input[0] as i32; let mut data: Array = []; for let mut i = 1; i < input.len(); i += 1 { - data.append(input[i]); + data.push(input[i]); } if cmd == 0 { diff --git a/wado-compiler/tests/fixtures/template_string_option_loop.wado b/wado-compiler/tests/fixtures/template_string_option_loop.wado index 5f903d7d8..d93f90eb8 100644 --- a/wado-compiler/tests/fixtures/template_string_option_loop.wado +++ b/wado-compiler/tests/fixtures/template_string_option_loop.wado @@ -12,7 +12,7 @@ export fn run() { let labels: Array = ["BinOp", "Pass"]; for let mut i = 0; i < labels.len(); i += 1 { let s = `{base}{labels[i]}`; - cases.append(Case { payload: Option::::Some(s) }); + cases.push(Case { payload: Option::::Some(s) }); } let p0 = cases[0].payload.unwrap(); diff --git a/wado-compiler/tests/fixtures/trait_bound_sort_no_ord.wado b/wado-compiler/tests/fixtures/trait_bound_sort_no_ord.wado index 3a5065c88..50dbc3f48 100644 --- a/wado-compiler/tests/fixtures/trait_bound_sort_no_ord.wado +++ b/wado-compiler/tests/fixtures/trait_bound_sort_no_ord.wado @@ -11,7 +11,7 @@ struct Point { export fn run() { let mut points: Array = []; - points.append(Point { x: NoOrd::A(1) }); + points.push(Point { x: NoOrd::A(1) }); // Point does not implement Ord (NoOrd variant field), so sort() should not be available points.sort(); } diff --git a/wado-compiler/tests/fixtures/treemap_btree.wado b/wado-compiler/tests/fixtures/treemap_btree.wado index 1e7aaf5fd..24516ddc4 100644 --- a/wado-compiler/tests/fixtures/treemap_btree.wado +++ b/wado-compiler/tests/fixtures/treemap_btree.wado @@ -58,9 +58,9 @@ impl BTreeNode { for let mut i = 0; i < self.keys.len(); i += 1 { if !self.deleted[i] { - new_keys.append(self.keys[i]); - new_values.append(self.values[i]); - new_deleted.append(false); + new_keys.push(self.keys[i]); + new_values.push(self.values[i]); + new_deleted.push(false); } } @@ -137,9 +137,9 @@ impl TreeMap { fn insert(&mut self, key: K, value: V) { if let None = self.root { let mut new_root = BTreeNode::::new_leaf(); - new_root.keys.append(key); - new_root.values.append(value); - new_root.deleted.append(false); + new_root.keys.push(key); + new_root.values.push(value); + new_root.deleted.push(false); self.root = Option::Some(&mut new_root); self.size = 1; return; @@ -148,7 +148,7 @@ impl TreeMap { if let Some(root) = self.root { if root.is_full(self.max_keys()) { let mut new_root = BTreeNode::::new_internal(); - new_root.children.append(root); + new_root.children.push(root); self.split_child(&mut new_root, 0); self.root = Option::Some(&mut new_root); } @@ -175,9 +175,9 @@ impl TreeMap { return; } - node.keys.append(key); - node.values.append(value); - node.deleted.append(false); + node.keys.push(key); + node.values.push(value); + node.deleted.push(false); self.sort_node_entries(node); self.size += 1; @@ -209,14 +209,14 @@ impl TreeMap { let mid = self.t - 1; for let mut i = mid + 1; i < full_child.keys.len(); i += 1 { - new_sibling.keys.append(full_child.keys[i]); - new_sibling.values.append(full_child.values[i]); - new_sibling.deleted.append(full_child.deleted[i]); + new_sibling.keys.push(full_child.keys[i]); + new_sibling.values.push(full_child.values[i]); + new_sibling.deleted.push(full_child.deleted[i]); } if !full_child.is_leaf { for let mut i = mid + 1; i < full_child.children.len(); i += 1 { - new_sibling.children.append(full_child.children[i]); + new_sibling.children.push(full_child.children[i]); } } @@ -224,10 +224,10 @@ impl TreeMap { let promoted_value = full_child.values[mid]; let promoted_deleted = full_child.deleted[mid]; - parent.keys.append(promoted_key); - parent.values.append(promoted_value); - parent.deleted.append(promoted_deleted); - parent.children.append(&mut new_sibling); + parent.keys.push(promoted_key); + parent.values.push(promoted_value); + parent.deleted.push(promoted_deleted); + parent.children.push(&mut new_sibling); self.sort_node_entries(parent); } @@ -319,7 +319,7 @@ impl TreeMap { } if !node.deleted[i] { - result.append([node.keys[i], node.values[i]]); + result.push([node.keys[i], node.values[i]]); } i += 1; diff --git a/wado-compiler/tests/fixtures/treemap_btree2.wado b/wado-compiler/tests/fixtures/treemap_btree2.wado index a72b56913..b24fbf7cf 100644 --- a/wado-compiler/tests/fixtures/treemap_btree2.wado +++ b/wado-compiler/tests/fixtures/treemap_btree2.wado @@ -58,9 +58,9 @@ impl BTreeNode { for let mut i = 0; i < self.keys.len(); i += 1 { if !self.deleted[i] { - new_keys.append(self.keys[i]); - new_values.append(self.values[i]); - new_deleted.append(false); + new_keys.push(self.keys[i]); + new_values.push(self.values[i]); + new_deleted.push(false); } } @@ -137,9 +137,9 @@ impl TreeMap { fn insert(&mut self, key: K, value: V) { if let None = self.root { let mut new_root = BTreeNode::::new_leaf(); - new_root.keys.append(key); - new_root.values.append(value); - new_root.deleted.append(false); + new_root.keys.push(key); + new_root.values.push(value); + new_root.deleted.push(false); self.root = Option::Some(&mut new_root); self.size = 1; return; @@ -148,7 +148,7 @@ impl TreeMap { if let Some(root) = self.root { if root.is_full(self.max_keys()) { let mut new_root = BTreeNode::::new_internal(); - new_root.children.append(root); + new_root.children.push(root); self.split_child(&mut new_root, 0); self.root = Option::Some(&mut new_root); } @@ -175,9 +175,9 @@ impl TreeMap { return; } - node.keys.append(key); - node.values.append(value); - node.deleted.append(false); + node.keys.push(key); + node.values.push(value); + node.deleted.push(false); self.sort_node_entries(node); self.size += 1; @@ -209,14 +209,14 @@ impl TreeMap { let mid = self.t - 1; for let mut i = mid + 1; i < full_child.keys.len(); i += 1 { - new_sibling.keys.append(full_child.keys[i]); - new_sibling.values.append(full_child.values[i]); - new_sibling.deleted.append(full_child.deleted[i]); + new_sibling.keys.push(full_child.keys[i]); + new_sibling.values.push(full_child.values[i]); + new_sibling.deleted.push(full_child.deleted[i]); } if !full_child.is_leaf { for let mut i = mid + 1; i < full_child.children.len(); i += 1 { - new_sibling.children.append(full_child.children[i]); + new_sibling.children.push(full_child.children[i]); } } @@ -224,10 +224,10 @@ impl TreeMap { let promoted_value = full_child.values[mid]; let promoted_deleted = full_child.deleted[mid]; - parent.keys.append(promoted_key); - parent.values.append(promoted_value); - parent.deleted.append(promoted_deleted); - parent.children.append(&mut new_sibling); + parent.keys.push(promoted_key); + parent.values.push(promoted_value); + parent.deleted.push(promoted_deleted); + parent.children.push(&mut new_sibling); self.sort_node_entries(parent); } @@ -319,7 +319,7 @@ impl TreeMap { } if !node.deleted[i] { - result.append([node.keys[i], node.values[i]]); + result.push([node.keys[i], node.values[i]]); } i += 1; diff --git a/wado-compiler/tests/fixtures/tuple_for_of.wado b/wado-compiler/tests/fixtures/tuple_for_of.wado index 2c4f72e22..5aa6c5ceb 100644 --- a/wado-compiler/tests/fixtures/tuple_for_of.wado +++ b/wado-compiler/tests/fixtures/tuple_for_of.wado @@ -25,7 +25,7 @@ test "basic heterogeneous" { let t = [42, "hello", true]; let mut results: Array = []; for let v of t { - results.append(`{v}`); + results.push(`{v}`); } assert results[0] == "42"; assert results[1] == "hello"; @@ -37,8 +37,8 @@ test "enumerate" { let mut indices: Array = []; let mut values: Array = []; for let [i, v] of t.enumerate() { - indices.append(i); - values.append(`{v}`); + indices.push(i); + values.push(`{v}`); } assert indices[0] == 0; assert indices[1] == 1; @@ -79,7 +79,7 @@ test "trait dispatch per element type" { let t = [42, "wado", true]; let mut results: Array = []; for let v of t { - results.append(v.describe()); + results.push(v.describe()); } assert results[0] == "int(42)"; assert results[1] == "str(wado)"; @@ -90,7 +90,7 @@ test "enumerate with trait dispatch" { let t = [1, "two"]; let mut results: Array = []; for let [i, v] of t.enumerate() { - results.append(`{i}: {v.describe()}`); + results.push(`{i}: {v.describe()}`); } assert results[0] == "0: int(1)"; assert results[1] == "1: str(two)"; @@ -101,7 +101,7 @@ test "nested tuple for-of expansion" { let mut results: Array = []; for let v of t { for let w of v { - results.append(`{w}`); + results.push(`{w}`); } } assert results[0] == "1"; @@ -115,7 +115,7 @@ test "mutable binding" { let mut results: Array = []; for let mut v of t { v = v + 1; - results.append(v); + results.push(v); } assert results[0] == 11; assert results[1] == 21; diff --git a/wado-compiler/tests/fixtures/u64_arithmetic.wado b/wado-compiler/tests/fixtures/u64_arithmetic.wado index c249ad41b..6b0ed0ca5 100644 --- a/wado-compiler/tests/fixtures/u64_arithmetic.wado +++ b/wado-compiler/tests/fixtures/u64_arithmetic.wado @@ -9,7 +9,7 @@ export fn run() with Stdout { let mut v = val; while v > 0 as u64 { // This cast from u64 to i32 was previously broken in codegen - digits.append((v % 10 as u64) as i32); + digits.push((v % 10 as u64) as i32); v = v / 10 as u64; } diff --git a/wado-compiler/tests/fixtures/variadic_1.wado b/wado-compiler/tests/fixtures/variadic_1.wado index 15fa8c31c..63adeee85 100644 --- a/wado-compiler/tests/fixtures/variadic_1.wado +++ b/wado-compiler/tests/fixtures/variadic_1.wado @@ -98,7 +98,7 @@ test "surround empty middle" { fn collect_for_of<..T>(items: [..T]) -> [..T] { let mut result: Array = []; for let item of items { - result.append(`{item}`); + result.push(`{item}`); } assert result[0] == "1"; assert result[1] == "hello"; diff --git a/wado-compiler/tests/fixtures/variant_deref_cross_module.wado b/wado-compiler/tests/fixtures/variant_deref_cross_module.wado index dd4200647..1ef05f86e 100644 --- a/wado-compiler/tests/fixtures/variant_deref_cross_module.wado +++ b/wado-compiler/tests/fixtures/variant_deref_cross_module.wado @@ -2,15 +2,15 @@ use { Elem, Alt, RepeatElem, LabelElem } from "./sub/variant_deref_helper.wado"; fn process(elem: &Elem, out: &mut String) { if let TokenRef(name) = *elem { - out.append(name); + out.push_str(name); return; } if let Literal(text) = *elem { - out.append(text); + out.push_str(text); return; } if let RuleRef(name) = *elem { - out.append(name); + out.push_str(name); return; } if let Repeat(rep) = *elem { diff --git a/wado-compiler/tests/fixtures/variant_import_struct_module.wado b/wado-compiler/tests/fixtures/variant_import_struct_module.wado index 0314f5828..d2e7d2445 100644 --- a/wado-compiler/tests/fixtures/variant_import_struct_module.wado +++ b/wado-compiler/tests/fixtures/variant_import_struct_module.wado @@ -31,7 +31,7 @@ pub fn format_with_opts(s: String, opts: Options) -> String { let pad_len = opts.width - s.len(); let mut pad = String::with_capacity(pad_len); for let mut i = 0; i < pad_len; i += 1 { - pad.append(" "); + pad.push_str(" "); } return match opts.align { Left => String::concat(s, pad), @@ -42,10 +42,10 @@ pub fn format_with_opts(s: String, opts: Options) -> String { let mut lpad = String::with_capacity(left); let mut rpad = String::with_capacity(right); for let mut i = 0; i < left; i += 1 { - lpad.append(" "); + lpad.push_str(" "); } for let mut i = 0; i < right; i += 1 { - rpad.append(" "); + rpad.push_str(" "); } String::concat(String::concat(lpad, s), rpad); }, diff --git a/wado-compiler/tests/fixtures/wasi_filesystem_read_transform_stream.wado b/wado-compiler/tests/fixtures/wasi_filesystem_read_transform_stream.wado index 8c6414e67..dfa360747 100644 --- a/wado-compiler/tests/fixtures/wasi_filesystem_read_transform_stream.wado +++ b/wado-compiler/tests/fixtures/wasi_filesystem_read_transform_stream.wado @@ -23,9 +23,9 @@ fn to_upper(data: Array) -> Array { for let mut i = 0; i < data.len(); i += 1 { let b = data[i]; if b >= 97 && b <= 122 { - result.append(b - 32); + result.push(b - 32); } else { - result.append(b); + result.push(b); } } return result; diff --git a/wado-compiler/tests/fixtures/wasi_filesystem_set_size.wado b/wado-compiler/tests/fixtures/wasi_filesystem_set_size.wado index 931c03c11..21f6fe218 100644 --- a/wado-compiler/tests/fixtures/wasi_filesystem_set_size.wado +++ b/wado-compiler/tests/fixtures/wasi_filesystem_set_size.wado @@ -28,7 +28,7 @@ fn read_all(file: &Descriptor) -> Array { break; } for let b of chunk { - result.append(b); + result.push(b); } } read_stream.drop(); diff --git a/wado-compiler/tests/fixtures/wir_optimize_value_copy_call_arg_needed.wado b/wado-compiler/tests/fixtures/wir_optimize_value_copy_call_arg_needed.wado index d7b8ddbf8..3714a14c2 100644 --- a/wado-compiler/tests/fixtures/wir_optimize_value_copy_call_arg_needed.wado +++ b/wado-compiler/tests/fixtures/wir_optimize_value_copy_call_arg_needed.wado @@ -10,7 +10,7 @@ use { println } from "core:cli"; fn append_zero(mut arr: Array) -> i32 { - arr.append(0); + arr.push(0); return arr.len(); } diff --git a/wado-compiler/tests/format.fixtures.golden/all.lower.wado b/wado-compiler/tests/format.fixtures.golden/all.lower.wado index 3cc0ad636..f9f960739 100644 --- a/wado-compiler/tests/format.fixtures.golden/all.lower.wado +++ b/wado-compiler/tests/format.fixtures.golden/all.lower.wado @@ -7,6 +7,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -129,6 +229,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -149,6 +257,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -225,6 +349,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -245,6 +377,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -321,6 +469,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -341,6 +497,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -417,6 +589,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -437,6 +617,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -488,6 +684,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -1317,6 +1613,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -1337,6 +1641,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -1413,6 +1733,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1433,6 +1761,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -1509,6 +1853,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1529,6 +1881,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -1605,6 +1973,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -1625,6 +2001,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -1676,53 +2068,153 @@ pub struct "ArrayIter" { index: i32, } -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, } -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, } -pub struct "IterSkip" { - pub inner: StrUtf8ByteIter, +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrUtf8ByteIter, +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrUtf8ByteIter, +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrUtf8ByteIter, - pub pred: fn(u8) -> bool, +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, } -pub fn write_to_stream(tx: StreamWritable, message: String, add_newline: bool) { - let bytes: builtin::array = message.String::internal_raw_bytes(); +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrUtf8ByteIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrUtf8ByteIter, + pub pred: fn(u8) -> bool, +} + +pub fn write_to_stream(tx: StreamWritable, message: String, add_newline: bool) { + let bytes: builtin::array = message.String::internal_raw_bytes(); let len: i32 = message.String::len(); if add_newline { let new_repr: builtin::array = "core::cli::core/builtin/array_new"((len + 1)); @@ -1853,6 +2345,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -1873,6 +2373,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -1949,6 +2465,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1969,6 +2493,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -2045,6 +2585,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2065,6 +2613,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -2141,6 +2705,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -2161,6 +2733,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -2227,6 +2815,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -2630,6 +3318,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -2650,6 +3346,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -2726,6 +3438,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2746,6 +3466,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -2822,6 +3558,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2842,6 +3586,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -2918,6 +3678,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -2938,6 +3706,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -3013,38 +3797,138 @@ pub struct "ArrayIter" { index: i32, } -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, -} - -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, } -pub struct "IterSkip" { - pub inner: StrUtf8ByteIter, +pub struct "IterSkip" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrUtf8ByteIter, +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrUtf8ByteIter, pub remaining: i32, } @@ -3090,6 +3974,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -3110,6 +4002,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -3186,6 +4094,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -3206,6 +4122,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -3282,6 +4214,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -3302,6 +4242,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -3378,6 +4334,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -3398,6 +4362,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -3449,6 +4429,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -3534,6 +4614,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -3554,6 +4642,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -3630,6 +4734,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -3650,6 +4762,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -3726,6 +4854,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -3746,6 +4882,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -3822,6 +4974,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -3842,6 +5002,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -3912,29 +5088,129 @@ pub struct "ArrayIter" { index: i32, } -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, -} - -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, } pub struct "IterSkip" { @@ -4290,20 +5566,20 @@ pub fn fixed_width(f: f64, n: i32) -> FormatResult { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(131); - __r.String::append("Assertion failed in "); - __r.String::append("fixed_width"); - __r.String::append(" at "); - __r.String::append("core:prelude/fpfmt.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("fixed_width"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/fpfmt.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 289 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("digits must be <= 18"); - __r.String::append("\ncondition: n <= 18\n"); - __r.String::append("n: "); + __r.String::push_str(": "); + __r.String::push_str("digits must be <= 18"); + __r.String::push_str("\ncondition: n <= 18\n"); + __r.String::push_str("n: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -4532,7 +5808,7 @@ fn fill_zeros(buf: &mut String, n: i32) { pub fn write_decimal(buf: &mut String, d: u64, p: i32, nd: i32) { let decimal_pos: i32 = (nd + p); if (decimal_pos <= 0) { - buf.String::append("0."); + buf.String::push_str("0."); "core::prelude/fpfmt.wado::fill_zeros"(buf, -decimal_pos); let digit_offset: i32 = buf.String::len(); "core::prelude/fpfmt.wado::fill_zeros"(buf, nd); @@ -4584,13 +5860,13 @@ pub fn write_exp(buf: &mut String, d: u64, p: i32, nd: i32, upper: bool) { "core::prelude/fpfmt.wado::fill_zeros"(buf, 1); "core::prelude/fpfmt.wado::write_digits_at"(buf, start, d, 1); } - buf.String::append(if upper { + buf.String::push_str(if upper { "E"; } else { "e"; }); if (exp < 0) { - buf.String::append("-"); + buf.String::push_str("-"); } let abs_exp: i32 = if (exp < 0) { -exp; @@ -4598,15 +5874,15 @@ pub fn write_exp(buf: &mut String, d: u64, p: i32, nd: i32, upper: bool) { exp; }; if (abs_exp < 10) { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); } else { if (abs_exp < 100) { - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); } else { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); } } } @@ -4625,7 +5901,7 @@ pub fn write_decimal_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: let decimal_pos: i32 = (nd + p); if (decimal_pos <= 0) { let leading_zeros: i32 = -decimal_pos; - buf.String::append("0."); + buf.String::push_str("0."); if (precision <= leading_zeros) { "core::prelude/fpfmt.wado::fill_zeros"(buf, precision); return; @@ -4658,7 +5934,7 @@ pub fn write_decimal_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: "core::prelude/fpfmt.wado::write_digits_at"(buf, start, d, nd); "core::prelude/fpfmt.wado::fill_zeros"(buf, (decimal_pos - nd)); if (precision > 0) { - buf.String::append("."); + buf.String::push_str("."); "core::prelude/fpfmt.wado::fill_zeros"(buf, precision); } } else { @@ -4746,13 +6022,13 @@ pub fn write_exp_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: i32, "core::prelude/fpfmt.wado::write_digits_at"(buf, start, first_d, 1); } let exp: i32 = ((p + nd) - 1); - buf.String::append(if upper { + buf.String::push_str(if upper { "E"; } else { "e"; }); if (exp < 0) { - buf.String::append("-"); + buf.String::push_str("-"); } let abs_exp: i32 = if (exp < 0) { -exp; @@ -4760,15 +6036,15 @@ pub fn write_exp_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: i32, exp; }; if (abs_exp < 10) { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); } else { if (abs_exp < 100) { - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); } else { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); } } } @@ -5110,6 +6386,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -5130,6 +6414,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -5249,6 +6549,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -5269,6 +6577,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -5361,6 +6685,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -5381,6 +6713,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -5473,6 +6821,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -5493,6 +6849,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -5542,10 +6914,10 @@ fn "Array^SequenceLiteralBuilder::build"(self: &Array) -> Array { } fn "Array^SequenceLiteralBuilder::push_literal"(self: &mut Array, value: u64) with stores[value] { - self."Array::append"(value); + self."Array::push"(value); } -pub fn "Array::append"(self: &mut Array, value: u64) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: u64) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -5613,6 +6985,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -6568,6 +8040,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -6588,6 +8068,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -6664,6 +8160,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -6684,6 +8188,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -6760,6 +8280,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -6780,6 +8308,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -6864,6 +8408,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -6884,6 +8436,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -6935,38 +8503,138 @@ pub struct "ArrayIter" { index: i32, } -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, -} - -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, } -pub struct "IterSkip" { - pub inner: StrUtf8ByteIter, +pub struct "IterSkip" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrUtf8ByteIter, +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrUtf8ByteIter, pub remaining: i32, } @@ -7192,7 +8860,7 @@ pub fn char::from_u32_unchecked(value: u32) -> char { pub fn char::to_string(self: Box) -> String { let mut buf: String = "core::prelude/string.wado::String::with_capacity"(4); - buf.String::append_char(self.value); + buf.String::push(self.value); return buf; } @@ -7595,24 +9263,24 @@ fn fmt_float_special(f: &mut Formatter, is_neg: bool, kind: SpecialKind, zero_re NaN => true, _ => false, } { - f.buf.String::append("NaN"); + f.buf.String::push_str("NaN"); } else { if match kind { Inf => true, _ => false, } { - f.buf.String::append(if is_neg { + f.buf.String::push_str(if is_neg { "-inf"; } else { "inf"; }); } else { - f.buf.String::append(if is_neg { + f.buf.String::push_str(if is_neg { "-"; } else { ""; }); - f.buf.String::append(zero_repr); + f.buf.String::push_str(zero_repr); } } f.Formatter::apply_padding(mark); @@ -7620,10 +9288,10 @@ fn fmt_float_special(f: &mut Formatter, is_neg: bool, kind: SpecialKind, zero_re fn fmt_float_sign(f: &mut Formatter, is_neg: bool) { if is_neg { - f.buf.String::append("-"); + f.buf.String::push_str("-"); } else { if f.sign_plus { - f.buf.String::append("+"); + f.buf.String::push_str("+"); } } } @@ -7686,7 +9354,7 @@ fn f32::inspect_into(self: Box, f: &mut Formatter) { } else { if (p >= 0) { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); - f.buf.String::append(".0"); + f.buf.String::push_str(".0"); } else { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); } @@ -7928,7 +9596,7 @@ fn f64::inspect_into(self: Box, f: &mut Formatter) { } else { if (p >= 0) { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); - f.buf.String::append(".0"); + f.buf.String::push_str(".0"); } else { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); } @@ -7955,9 +9623,9 @@ fn f64::fmt_fixed(self: Box, precision: i32, f: &mut Formatter) { } let mark: i32 = f.Formatter::mark(); "core::prelude/primitive.wado::fmt_float_sign"(f, is_neg); - f.buf.String::append("0"); + f.buf.String::push_str("0"); if (precision > 0) { - f.buf.String::append("."); + f.buf.String::push_str("."); f.buf.String::append_byte_filled('0' as u8, precision); } f.Formatter::apply_padding(mark); @@ -7998,17 +9666,17 @@ fn f64::fmt_exp(self: Box, precision: i32, upper: i32, f: &mut Formatter) { } let mark: i32 = f.Formatter::mark(); "core::prelude/primitive.wado::fmt_float_sign"(f, is_neg); - f.buf.String::append("0"); + f.buf.String::push_str("0"); if (precision > 0) { - f.buf.String::append("."); + f.buf.String::push_str("."); f.buf.String::append_byte_filled('0' as u8, precision); } - f.buf.String::append(if upper_bool { + f.buf.String::push_str(if upper_bool { "E"; } else { "e"; }); - f.buf.String::append("0"); + f.buf.String::push_str("0"); f.Formatter::apply_padding(mark); return; } @@ -8213,7 +9881,7 @@ pub fn "char^Display::fmt"(self: Box, f: &mut Formatter) { f.Formatter::write_char(self.value); } else { let mut s: String = "core::prelude/string.wado::String::with_capacity"(4); - s.String::append_char(self.value); + s.String::push(self.value); f.Formatter::pad(s); } } @@ -9277,7 +10945,7 @@ pub fn "i32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i32"); + __r.String::push_str(" out of range for i32"); break __tmpl: __r; })); } @@ -9290,7 +10958,7 @@ pub fn "i16^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i16"); + __r.String::push_str(" out of range for i16"); break __tmpl: __r; })); } @@ -9303,7 +10971,7 @@ pub fn "i8^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -9316,7 +10984,7 @@ pub fn "i16^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for i16"); + __r.String::push_str(" out of range for i16"); break __tmpl: __r; })); } @@ -9329,7 +10997,7 @@ pub fn "i8^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -9342,7 +11010,7 @@ pub fn "i8^TryFrom::try_from"(value: i16) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i16^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -9355,7 +11023,7 @@ pub fn "u32^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -9368,7 +11036,7 @@ pub fn "u64^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u64"); + __r.String::push_str(" out of range for u64"); break __tmpl: __r; })); } @@ -9381,7 +11049,7 @@ pub fn "u32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -9394,7 +11062,7 @@ pub fn "i64^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i64"); + __r.String::push_str(" out of range for i64"); break __tmpl: __r; })); } @@ -9407,7 +11075,7 @@ pub fn "u32^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -9420,7 +11088,7 @@ pub fn "u16^TryFrom::try_from"(value: u32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u16"); + __r.String::push_str(" out of range for u16"); break __tmpl: __r; })); } @@ -9433,7 +11101,7 @@ pub fn "u8^TryFrom::try_from"(value: u32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u8"); + __r.String::push_str(" out of range for u8"); break __tmpl: __r; })); } @@ -9446,7 +11114,7 @@ pub fn "u8^TryFrom::try_from"(value: u16) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u16^Display::fmt"(&mut __f); - __r.String::append(" out of range for u8"); + __r.String::push_str(" out of range for u8"); break __tmpl: __r; })); } @@ -9460,7 +11128,7 @@ pub fn "f32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f32"); + __r.String::push_str(" cannot be exactly represented as f32"); break __tmpl: __r; })); } @@ -9474,7 +11142,7 @@ pub fn "f64^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f64"); + __r.String::push_str(" cannot be exactly represented as f64"); break __tmpl: __r; })); } @@ -9487,7 +11155,7 @@ pub fn "f64^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f64"); + __r.String::push_str(" cannot be exactly represented as f64"); break __tmpl: __r; })); } @@ -9500,7 +11168,7 @@ pub fn "f32^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f32"); + __r.String::push_str(" cannot be exactly represented as f32"); break __tmpl: __r; })); } @@ -9539,6 +11207,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -9559,6 +11235,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -9635,6 +11327,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9655,6 +11355,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -9731,6 +11447,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9751,6 +11475,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -9827,6 +11567,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -9847,6 +11595,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -9927,12 +11691,150 @@ pub struct StrCharIter { byte_index: i32, } +pub struct StrSplitIter { + repr: builtin::array, + used: i32, + pos: i32, + sep_repr: builtin::array, + sep_len: i32, + finished: bool, +} + +pub struct StrSplitNIter { + repr: builtin::array, + used: i32, + pos: i32, + sep_repr: builtin::array, + sep_len: i32, + remaining: i32, + finished: bool, +} + +pub struct StrSplitWhitespaceIter { + repr: builtin::array, + used: i32, + pos: i32, +} + +pub struct StrLinesIter { + repr: builtin::array, + used: i32, + pos: i32, + finished: bool, +} + +pub struct StrCharIndicesIter { + repr: builtin::array, + used: i32, + byte_index: i32, +} + pub struct "ArrayIter" { repr: builtin::array, used: i32, index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -10076,7 +11978,7 @@ pub fn String::append_byte_filled(self: &mut String, byte: u8, n: i32) { self.used = new_used; } -pub fn String::append(self: &mut String, other: String) { +pub fn String::push_str(self: &mut String, other: String) { let other_len: i32 = other.String::len(); if (other_len == 0) { return; @@ -10089,6 +11991,10 @@ pub fn String::append(self: &mut String, other: String) { self.used = new_used; } +pub fn String::append(self: &mut String, other: String) { + self.String::push_str(other); +} + pub fn String::concat(a: String, b: String) -> String { let len_a: i32 = a.String::len(); let len_b: i32 = b.String::len(); @@ -10182,7 +12088,7 @@ pub fn "StrUtf8ByteIter^Iterator::collect"(self: &mut StrUtf8ByteIter) -> Array< let __pattern_temp_0: Option = self."StrUtf8ByteIter^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let item: u8 = __variant_payload(__pattern_temp_0, case=0); - result."Array::append"(item); + result."Array::push"(item); } else { break; } @@ -10370,7 +12276,7 @@ pub fn "StrCharIter^Iterator::collect"(self: &mut StrCharIter) -> Array { let __pattern_temp_0: Option = self."StrCharIter^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let item: char = __variant_payload(__pattern_temp_0, case=0); - result."Array::append"(item); + result."Array::push"(item); } else { break; } @@ -10527,7 +12433,7 @@ pub fn String::chars(self: &String) -> StrCharIter { return StrCharIter { repr: self.repr, used: self.used, byte_index: 0 }; } -pub fn String::append_char(self: &mut String, c: char) { +pub fn String::push(self: &mut String, c: char) { let code: u32 = c as u32; if core::builtin::unlikely(((self.used + 4) > core::builtin::array_len(self.repr))) { self.String::grow((self.used + 4)); @@ -10557,7 +12463,11 @@ pub fn String::append_char(self: &mut String, c: char) { } } -pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { +pub fn String::append_char(self: &mut String, c: char) { + self.String::push(c); +} + +pub fn String::truncate(self: &mut String, byte_len: i32) { if (byte_len >= self.used) { return; } @@ -10567,20 +12477,20 @@ pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(144); - __r.String::append("Assertion failed in "); - __r.String::append("String::truncate_bytes"); - __r.String::append(" at "); - __r.String::append("core:prelude/string.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::truncate"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); - Box { value: 355 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("negative length"); - __r.String::append("\ncondition: byte_len >= 0\n"); - __r.String::append("byte_len: "); + Box { value: 365 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("negative length"); + __r.String::push_str("\ncondition: byte_len >= 0\n"); + __r.String::push_str("byte_len: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10596,32 +12506,32 @@ pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); - __r.String::append("Assertion failed in "); - __r.String::append("String::truncate_bytes"); - __r.String::append(" at "); - __r.String::append("core:prelude/string.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::truncate"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); - Box { value: 360 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("not on a UTF-8 character boundary"); - __r.String::append("\ncondition: b < 0x80 || b >= 0xC0\n"); - __r.String::append("b: "); + Box { value: 370 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b < 0x80: "); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b: "); + __r.String::push_str("\n"); + __r.String::push_str("b: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b >= 0xC0: "); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10656,6 +12566,78 @@ pub fn String::truncate_chars(self: &mut String, char_count: i32) { self.used = byte_pos; } +pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { + self.String::truncate(byte_len); +} + +pub fn String::pop(self: &mut String) -> Option { + if (self.used == 0) { + return null; + } + let mut pos: i32 = (self.used - 1); + loop { + if !(pos > 0) { + break; + } + let b: u8 = core::builtin::array_get_u8(self.repr, pos); + if ((b >= 0x80) && (b < 0xC0)) { + pos = (pos - 1); + } else { + break; + } + } + let b0: u32 = core::builtin::array_get_u8(self.repr, pos) as u32; + let code: u32 = if (b0 < 0x80) { + b0; + } else { + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + (((b0 & 0x1F) << 6) | (b1 & 0x3F)); + } else { + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (pos + 2)) as u32; + ((((b0 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + } else { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (pos + 2)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (pos + 3)) as u32; + (((((b0 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + }; + }; + }; + self.used = pos; + return Option::Some("core::prelude/primitive.wado::char::from_u32_unchecked"(code)); +} + +pub fn String::clear(self: &mut String) { + self.used = 0; +} + +pub fn String::capacity(self: &String) -> i32 { + return core::builtin::array_len(self.repr); +} + +pub fn String::reserve(self: &mut String, additional: i32) { + let required: i32 = (self.used + additional); + if (required > core::builtin::array_len(self.repr)) { + self.String::grow(required); + } +} + +pub fn String::shrink_to_fit(self: &mut String) { + let capacity: i32 = core::builtin::array_len(self.repr); + if (capacity > self.used) { + let new_repr: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(self.used); + "core::prelude/string.wado::core/builtin/array_copy"(new_repr, 0, self.repr, 0, self.used); + self.repr = new_repr; + } +} + +pub fn String::as_bytes(self: &String) -> Array { + return self.String::bytes()."StrUtf8ByteIter^Iterator::collect"(); +} + pub fn String::trim_ascii_start(self: &String) -> String { let mut start: i32 = 0; loop { @@ -10794,21 +12776,1754 @@ fn String::internal_substr_bytes(self: &String, start: i32, end: i32) -> String return String { repr: repr, used: len }; } -pub fn "String^Default::default"() -> String { - return ""; -} - +pub fn String::contains(self: &String, pat: String) -> bool { + return match self.String::find(pat) { + Some(_) => true, + _ => false, + }; +} + +pub fn String::starts_with(self: &String, pat: String) -> bool { + let pat_len: i32 = pat.String::len(); + if (pat_len > self.used) { + return false; + } + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + __for_3: { + let mut i: i32 = 0; + loop { + if !(i < pat_len) { + break __for_3; + } + __for_3_body: { + if (core::builtin::array_get_u8(self.repr, i) != core::builtin::array_get_u8(pat_repr, i)) { + return false; + } + } + i = (i + 1); + } + } + return true; +} + +pub fn String::ends_with(self: &String, pat: String) -> bool { + let pat_len: i32 = pat.String::len(); + if (pat_len > self.used) { + return false; + } + let offset: i32 = (self.used - pat_len); + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + __for_4: { + let mut i: i32 = 0; + loop { + if !(i < pat_len) { + break __for_4; + } + __for_4_body: { + if (core::builtin::array_get_u8(self.repr, (offset + i)) != core::builtin::array_get_u8(pat_repr, i)) { + return false; + } + } + i = (i + 1); + } + } + return true; +} + +pub fn String::find(self: &String, pat: String) -> Option { + let pat_len: i32 = pat.String::len(); + if (pat_len == 0) { + return Option::Some(0); + } + if (pat_len > self.used) { + return null; + } + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + let limit: i32 = (self.used - pat_len); + __for_5: { + let mut i: i32 = 0; + loop { + if !(i <= limit) { + break __for_5; + } + __for_5_body: { + let mut matched: bool = true; + __for_6: { + let mut j: i32 = 0; + loop { + if !(j < pat_len) { + break __for_6; + } + __for_6_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(pat_repr, j)) { + matched = false; + break __for_6; + } + } + j = (j + 1); + } + } + if matched { + return Option::Some(i); + } + } + i = (i + 1); + } + } + return null; +} + +pub fn String::rfind(self: &String, pat: String) -> Option { + let pat_len: i32 = pat.String::len(); + if (pat_len == 0) { + return Option::Some(self.used); + } + if (pat_len > self.used) { + return null; + } + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + let mut i: i32 = (self.used - pat_len); + loop { + let mut matched: bool = true; + __for_7: { + let mut j: i32 = 0; + loop { + if !(j < pat_len) { + break __for_7; + } + __for_7_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(pat_repr, j)) { + matched = false; + break __for_7; + } + } + j = (j + 1); + } + } + if matched { + return Option::Some(i); + } + if (i == 0) { + break; + } + i = (i - 1); + } + return null; +} + +pub fn String::contains_char(self: &String, ch: char) -> bool { + __for_of_2: { + let mut __iter_2: StrCharIter = self.String::chars()."StrCharIter^IntoIterator::into_iter"(); + loop { + let __pattern_temp_0: Option = __iter_2."StrCharIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let c: char = __variant_payload(__pattern_temp_0, case=0); + if (c == ch) { + return true; + } + } else { + break; + } + } + } + return false; +} + +pub fn String::find_char(self: &String, pred: fn(char) -> bool) -> Option { + let mut byte_index: i32 = 0; + let mut iter: StrCharIter = self.String::chars(); + loop { + let __pattern_temp_0: Option = iter."StrCharIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let c: char = __variant_payload(__pattern_temp_0, case=0); + if pred(c) { + return Option::Some(byte_index); + } + let code: u32 = c as u32; + if (code < 0x80) { + byte_index = (byte_index + 1); + } else { + if (code < 0x800) { + byte_index = (byte_index + 2); + } else { + if (code < 0x10000) { + byte_index = (byte_index + 3); + } else { + byte_index = (byte_index + 4); + } + } + } + } else { + break; + } + } + return null; +} + +pub fn String::insert(self: &mut String, byte_index: i32, ch: char) { + __assert_2: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index <= self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(308); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 726 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index <= self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index <= self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + if ((byte_index > 0) && (byte_index < self.used)) { + let b: u8 = core::builtin::array_get_u8(self.repr, byte_index); + __assert_3: { + let __v0: u8 = b; + let __v1: bool = (b < 0x80); + let __v2: u8 = b; + let __v3: bool = (b >= 0xC0); + let __cond: bool = (__v1 || __v3); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 729 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + } + let code: u32 = ch as u32; + let char_len: i32 = if (code < 0x80) { + 1; + } else { + if (code < 0x800) { + 2; + } else { + if (code < 0x10000) { + 3; + } else { + 4; + }; + }; + }; + let new_used: i32 = (self.used + char_len); + if (new_used > core::builtin::array_len(self.repr)) { + self.String::grow(new_used); + } + let mut i: i32 = (self.used - 1); + loop { + if !(i >= byte_index) { + break; + } + core::builtin::array_set_u8(self.repr, (i + char_len), core::builtin::array_get_u8(self.repr, i)); + if (i == 0) { + break; + } + i = (i - 1); + } + if (code < 0x80) { + core::builtin::array_set_u8(self.repr, byte_index, code as u8); + } else { + if (code < 0x800) { + core::builtin::array_set_u8(self.repr, byte_index, (0xC0 | (code >> 6)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | (code & 0x3F)) as u8); + } else { + if (code < 0x10000) { + core::builtin::array_set_u8(self.repr, byte_index, (0xE0 | (code >> 12)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | ((code >> 6) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 2), (0x80 | (code & 0x3F)) as u8); + } else { + core::builtin::array_set_u8(self.repr, byte_index, (0xF0 | (code >> 18)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | ((code >> 12) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 2), (0x80 | ((code >> 6) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 3), (0x80 | (code & 0x3F)) as u8); + } + } + } + self.used = new_used; +} + +pub fn String::insert_str(self: &mut String, byte_index: i32, s: String) { + let s_len: i32 = s.String::len(); + if (s_len == 0) { + return; + } + __assert_4: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index <= self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(308); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert_str"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 771 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index <= self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index <= self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + if ((byte_index > 0) && (byte_index < self.used)) { + let b: u8 = core::builtin::array_get_u8(self.repr, byte_index); + __assert_5: { + let __v0: u8 = b; + let __v1: bool = (b < 0x80); + let __v2: u8 = b; + let __v3: bool = (b >= 0xC0); + let __cond: bool = (__v1 || __v3); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert_str"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 774 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + } + let new_used: i32 = (self.used + s_len); + if (new_used > core::builtin::array_len(self.repr)) { + self.String::grow(new_used); + } + let mut i: i32 = (self.used - 1); + loop { + if !(i >= byte_index) { + break; + } + core::builtin::array_set_u8(self.repr, (i + s_len), core::builtin::array_get_u8(self.repr, i)); + if (i == 0) { + break; + } + i = (i - 1); + } + "core::prelude/string.wado::core/builtin/array_copy"(self.repr, byte_index, s.String::internal_raw_bytes(), 0, s_len); + self.used = new_used; +} + +pub fn String::remove(self: &mut String, byte_index: i32) -> char { + __assert_6: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index < self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(306); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::remove"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 795 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index < self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index < self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + let b0: u32 = core::builtin::array_get_u8(self.repr, byte_index) as u32; + let char_len: i32 = if (b0 < 0x80) { + 1; + } else { + if (b0 < 0xE0) { + 2; + } else { + if (b0 < 0xF0) { + 3; + } else { + 4; + }; + }; + }; + let code: u32 = if (b0 < 0x80) { + b0; + } else { + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + (((b0 & 0x1F) << 6) | (b1 & 0x3F)); + } else { + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 2)) as u32; + ((((b0 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + } else { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 2)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 3)) as u32; + (((((b0 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + }; + }; + }; + let src: i32 = (byte_index + char_len); + __for_8: { + let mut i: i32 = src; + loop { + if !(i < self.used) { + break __for_8; + } + __for_8_body: { + core::builtin::array_set_u8(self.repr, (i - char_len), core::builtin::array_get_u8(self.repr, i)); + } + i = (i + 1); + } + } + self.used = (self.used - char_len); + return "core::prelude/primitive.wado::char::from_u32_unchecked"(code); +} + +pub fn String::repeat(self: &String, n: i32) -> String { + if ((n <= 0) || (self.used == 0)) { + return "core::prelude/string.wado::String::with_capacity"(0); + } + let total: i32 = (self.used * n); + let repr: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(total); + __for_9: { + let mut r: i32 = 0; + loop { + if !(r < n) { + break __for_9; + } + __for_9_body: { + "core::prelude/string.wado::core/builtin/array_copy"(repr, (r * self.used), self.repr, 0, self.used); + } + r = (r + 1); + } + } + return String { repr: repr, used: total }; +} + +pub fn String::replace(self: &String, from: String, to: String) -> String { + return self.String::replacen(from, to, -1); +} + +pub fn String::replacen(self: &String, from: String, to: String, count: i32) -> String { + let from_len: i32 = from.String::len(); + if (from_len == 0) { + return *self; + } + let to_len: i32 = to.String::len(); + let from_repr: builtin::array = from.String::internal_raw_bytes(); + let to_repr: builtin::array = to.String::internal_raw_bytes(); + let mut result: String = "core::prelude/string.wado::String::with_capacity"(self.used); + let mut pos: i32 = 0; + let mut replacements: i32 = 0; + let limit: i32 = (self.used - from_len); + loop { + if !(pos <= limit) { + break; + } + if ((count >= 0) && (replacements >= count)) { + break; + } + let mut matched: bool = true; + __for_10: { + let mut j: i32 = 0; + loop { + if !(j < from_len) { + break __for_10; + } + __for_10_body: { + if (core::builtin::array_get_u8(self.repr, (pos + j)) != core::builtin::array_get_u8(from_repr, j)) { + matched = false; + break __for_10; + } + } + j = (j + 1); + } + } + if matched { + if (to_len > 0) { + let new_used: i32 = (result.used + to_len); + if (new_used > core::builtin::array_len(result.repr)) { + result.String::grow(new_used); + } + "core::prelude/string.wado::core/builtin/array_copy"(result.repr, result.used, to_repr, 0, to_len); + result.used = new_used; + } + pos = (pos + from_len); + replacements = (replacements + 1); + } else { + if (result.used >= core::builtin::array_len(result.repr)) { + result.String::grow((result.used + 1)); + } + core::builtin::array_set_u8(result.repr, result.used, core::builtin::array_get_u8(self.repr, pos)); + result.used = (result.used + 1); + pos = (pos + 1); + } + } + loop { + if !(pos < self.used) { + break; + } + if (result.used >= core::builtin::array_len(result.repr)) { + result.String::grow((result.used + 1)); + } + core::builtin::array_set_u8(result.repr, result.used, core::builtin::array_get_u8(self.repr, pos)); + result.used = (result.used + 1); + pos = (pos + 1); + } + return result; +} + +pub fn "String^Default::default"() -> String { + return ""; +} + pub fn "String^From::from"(value: char) -> String { let mut s: String = "core::prelude/string.wado::String::with_capacity"(4); - s.String::append_char(value); + s.String::push(value); return s; } -pub fn "StrUtf8ByteIter^Eq::eq"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> bool { - return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.index }."i32^Eq::eq"(Box { value: other.index })); +pub fn "StrSplitIter^Iterator::next"(self: &mut StrSplitIter) -> Option { + if self.finished { + return null; + } + let limit: i32 = (self.used - self.sep_len); + let mut i: i32 = self.pos; + loop { + if !(i <= limit) { + break; + } + let mut matched: bool = true; + __for_11: { + let mut j: i32 = 0; + loop { + if !(j < self.sep_len) { + break __for_11; + } + __for_11_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(self.sep_repr, j)) { + matched = false; + break __for_11; + } + } + j = (j + 1); + } + } + if matched { + let len: i32 = (i - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.pos = (i + self.sep_len); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + i = (i + 1); + } + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitIter^Iterator::collect"(self: &mut StrSplitIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitIter^Iterator::count"(self: &mut StrSplitIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitIter^Iterator::find"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::any"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitIter^Iterator::all"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitIter^Iterator::last"(self: &mut StrSplitIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitIter^Iterator::nth"(self: &mut StrSplitIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::position"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::reduce"(self: &mut StrSplitIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitIter^Iterator::filter"(self: &StrSplitIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitIter^Iterator::enumerate"(self: &StrSplitIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitIter^Iterator::take"(self: &StrSplitIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitIter^Iterator::skip"(self: &StrSplitIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrSplitNIter^Iterator::next"(self: &mut StrSplitNIter) -> Option { + if self.finished { + return null; + } + if (self.remaining <= 1) { + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + let limit: i32 = (self.used - self.sep_len); + let mut i: i32 = self.pos; + loop { + if !(i <= limit) { + break; + } + let mut matched: bool = true; + __for_12: { + let mut j: i32 = 0; + loop { + if !(j < self.sep_len) { + break __for_12; + } + __for_12_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(self.sep_repr, j)) { + matched = false; + break __for_12; + } + } + j = (j + 1); + } + } + if matched { + let len: i32 = (i - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.pos = (i + self.sep_len); + self.remaining = (self.remaining - 1); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + i = (i + 1); + } + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitNIter^Iterator::collect"(self: &mut StrSplitNIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitNIter^Iterator::count"(self: &mut StrSplitNIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitNIter^Iterator::find"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::any"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitNIter^Iterator::all"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitNIter^Iterator::last"(self: &mut StrSplitNIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitNIter^Iterator::nth"(self: &mut StrSplitNIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::position"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::reduce"(self: &mut StrSplitNIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitNIter^Iterator::filter"(self: &StrSplitNIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitNIter^Iterator::enumerate"(self: &StrSplitNIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitNIter^Iterator::take"(self: &StrSplitNIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitNIter^Iterator::skip"(self: &StrSplitNIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +fn is_ascii_whitespace_byte(b: u8) -> bool { + return (((((b == 0x20) || (b == 0x09)) || (b == 0x0A)) || (b == 0x0D)) || (b == 0x0C)); +} + +pub fn "StrSplitWhitespaceIter^Iterator::next"(self: &mut StrSplitWhitespaceIter) -> Option { + loop { + if !((self.pos < self.used) && "core::prelude/string.wado::is_ascii_whitespace_byte"(core::builtin::array_get_u8(self.repr, self.pos))) { + break; + } + self.pos = (self.pos + 1); + } + if (self.pos >= self.used) { + return null; + } + let start: i32 = self.pos; + loop { + if !((self.pos < self.used) && !"core::prelude/string.wado::is_ascii_whitespace_byte"(core::builtin::array_get_u8(self.repr, self.pos))) { + break; + } + self.pos = (self.pos + 1); + } + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitWhitespaceIter^Iterator::collect"(self: &mut StrSplitWhitespaceIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitWhitespaceIter^Iterator::count"(self: &mut StrSplitWhitespaceIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitWhitespaceIter^Iterator::find"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::any"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitWhitespaceIter^Iterator::all"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitWhitespaceIter^Iterator::last"(self: &mut StrSplitWhitespaceIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitWhitespaceIter^Iterator::nth"(self: &mut StrSplitWhitespaceIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::position"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::reduce"(self: &mut StrSplitWhitespaceIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::filter"(self: &StrSplitWhitespaceIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::enumerate"(self: &StrSplitWhitespaceIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::take"(self: &StrSplitWhitespaceIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::skip"(self: &StrSplitWhitespaceIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrLinesIter^Iterator::next"(self: &mut StrLinesIter) -> Option { + if self.finished { + return null; + } + if (self.pos >= self.used) { + self.finished = true; + return null; + } + let start: i32 = self.pos; + loop { + if !(self.pos < self.used) { + break; + } + let b: u8 = core::builtin::array_get_u8(self.repr, self.pos); + if (b == 0x0A) { + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.pos = (self.pos + 1); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + if (b == 0x0D) { + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.pos = (self.pos + 1); + if ((self.pos < self.used) && (core::builtin::array_get_u8(self.repr, self.pos) == 0x0A)) { + self.pos = (self.pos + 1); + } + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + self.pos = (self.pos + 1); + } + let len: i32 = (self.pos - start); + if (len > 0) { + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + self.finished = true; + return null; +} + +pub fn "StrLinesIter^Iterator::collect"(self: &mut StrLinesIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrLinesIter^Iterator::count"(self: &mut StrLinesIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrLinesIter^Iterator::find"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::any"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrLinesIter^Iterator::all"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrLinesIter^Iterator::last"(self: &mut StrLinesIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrLinesIter^Iterator::nth"(self: &mut StrLinesIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::position"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::reduce"(self: &mut StrLinesIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrLinesIter^Iterator::filter"(self: &StrLinesIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrLinesIter^Iterator::enumerate"(self: &StrLinesIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrLinesIter^Iterator::take"(self: &StrLinesIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrLinesIter^Iterator::skip"(self: &StrLinesIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrCharIndicesIter^Iterator::next"(self: &mut StrCharIndicesIter) -> Option<[i32, char]> { + if (self.byte_index >= self.used) { + return null; + } + let idx: i32 = self.byte_index; + let b0: u8 = core::builtin::array_get_u8(self.repr, self.byte_index); + self.byte_index = (self.byte_index + 1); + if (b0 < 0x80) { + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(b0 as u32)]); + } + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + self.byte_index = (self.byte_index + 1); + let code: u32 = (((b0 as u32 & 0x1F) << 6) | (b1 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); + } + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 1)) as u32; + self.byte_index = (self.byte_index + 2); + let code: u32 = ((((b0 as u32 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); + } + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 1)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 2)) as u32; + self.byte_index = (self.byte_index + 3); + let code: u32 = (((((b0 as u32 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); +} + +pub fn "StrCharIndicesIter^Iterator::collect"(self: &mut StrCharIndicesIter) -> Array<[i32, char]> { + let mut result: Array<[i32, char]> = __seq_lit: { + let mut __b: Array<[i32, char]> = "core::prelude/string.wado::Array>^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array>^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + result."Array>::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrCharIndicesIter^Iterator::count"(self: &mut StrCharIndicesIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrCharIndicesIter^Iterator::find"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> Option<[i32, char]> { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option<[i32, char]>::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::any"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> bool { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrCharIndicesIter^Iterator::all"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> bool { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrCharIndicesIter^Iterator::last"(self: &mut StrCharIndicesIter) -> Option<[i32, char]> { + let mut result: Option<[i32, char]> = null; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + result = Option<[i32, char]>::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrCharIndicesIter^Iterator::nth"(self: &mut StrCharIndicesIter, n: i32) -> Option<[i32, char]> { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option<[i32, char]>::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::position"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::reduce"(self: &mut StrCharIndicesIter, f: fn([i32, char], [i32, char]) -> [i32, char]) -> Option<[i32, char]> { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + let mut acc: [i32, char] = first; + loop { + let __pattern_temp_1: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option<[i32, char]>::Some(acc); + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::filter"(self: &StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrCharIndicesIter^Iterator::enumerate"(self: &StrCharIndicesIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrCharIndicesIter^Iterator::take"(self: &StrCharIndicesIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrCharIndicesIter^Iterator::skip"(self: &StrCharIndicesIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn String::split(self: &String, sep: String) -> StrSplitIter { + return StrSplitIter { repr: self.repr, used: self.used, pos: 0, sep_repr: sep.String::internal_raw_bytes(), sep_len: sep.String::len(), finished: false }; +} + +pub fn String::splitn(self: &String, n: i32, sep: String) -> StrSplitNIter { + return StrSplitNIter { repr: self.repr, used: self.used, pos: 0, sep_repr: sep.String::internal_raw_bytes(), sep_len: sep.String::len(), remaining: n, finished: (n <= 0) }; +} + +pub fn String::split_whitespace(self: &String) -> StrSplitWhitespaceIter { + return StrSplitWhitespaceIter { repr: self.repr, used: self.used, pos: 0 }; +} + +pub fn String::lines(self: &String) -> StrLinesIter { + return StrLinesIter { repr: self.repr, used: self.used, pos: 0, finished: false }; +} + +pub fn String::char_indices(self: &String) -> StrCharIndicesIter { + return StrCharIndicesIter { repr: self.repr, used: self.used, byte_index: 0 }; +} + +pub fn "StrUtf8ByteIter^Eq::eq"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.index }."i32^Eq::eq"(Box { value: other.index })); +} + +pub fn "StrUtf8ByteIter^Ord::cmp"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.index }."i32^Ord::cmp"(Box { value: other.index }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrCharIter^Eq::eq"(self: &StrCharIter, other: &StrCharIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.byte_index }."i32^Eq::eq"(Box { value: other.byte_index })); +} + +pub fn "StrCharIter^Ord::cmp"(self: &StrCharIter, other: &StrCharIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.byte_index }."i32^Ord::cmp"(Box { value: other.byte_index }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitIter^Eq::eq"(self: &StrSplitIter, other: &StrSplitIter) -> bool { + return (((((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && self.sep_repr."builtin::array^Eq::eq"(&other.sep_repr)) && Box { value: self.sep_len }."i32^Eq::eq"(Box { value: other.sep_len })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrSplitIter^Ord::cmp"(self: &StrSplitIter, other: &StrSplitIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = self.sep_repr."builtin::array^Ord::cmp"(&other.sep_repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.sep_len }."i32^Ord::cmp"(Box { value: other.sep_len }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitNIter^Eq::eq"(self: &StrSplitNIter, other: &StrSplitNIter) -> bool { + return ((((((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && self.sep_repr."builtin::array^Eq::eq"(&other.sep_repr)) && Box { value: self.sep_len }."i32^Eq::eq"(Box { value: other.sep_len })) && Box { value: self.remaining }."i32^Eq::eq"(Box { value: other.remaining })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrSplitNIter^Ord::cmp"(self: &StrSplitNIter, other: &StrSplitNIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = self.sep_repr."builtin::array^Ord::cmp"(&other.sep_repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.sep_len }."i32^Ord::cmp"(Box { value: other.sep_len }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.remaining }."i32^Ord::cmp"(Box { value: other.remaining }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitWhitespaceIter^Eq::eq"(self: &StrSplitWhitespaceIter, other: &StrSplitWhitespaceIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })); } -pub fn "StrUtf8ByteIter^Ord::cmp"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> Ordering { +pub fn "StrSplitWhitespaceIter^Ord::cmp"(self: &StrSplitWhitespaceIter, other: &StrSplitWhitespaceIter) -> Ordering { let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); if (c != Ordering::Equal) { return c; @@ -10817,18 +14532,42 @@ pub fn "StrUtf8ByteIter^Ord::cmp"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIte if (c != Ordering::Equal) { return c; } - let c: Ordering = Box { value: self.index }."i32^Ord::cmp"(Box { value: other.index }); + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); if (c != Ordering::Equal) { return c; } return Ordering::Equal; } -pub fn "StrCharIter^Eq::eq"(self: &StrCharIter, other: &StrCharIter) -> bool { +pub fn "StrLinesIter^Eq::eq"(self: &StrLinesIter, other: &StrLinesIter) -> bool { + return (((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrLinesIter^Ord::cmp"(self: &StrLinesIter, other: &StrLinesIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrCharIndicesIter^Eq::eq"(self: &StrCharIndicesIter, other: &StrCharIndicesIter) -> bool { return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.byte_index }."i32^Eq::eq"(Box { value: other.byte_index })); } -pub fn "StrCharIter^Ord::cmp"(self: &StrCharIter, other: &StrCharIter) -> Ordering { +pub fn "StrCharIndicesIter^Ord::cmp"(self: &StrCharIndicesIter, other: &StrCharIndicesIter) -> Ordering { let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); if (c != Ordering::Equal) { return c; @@ -10870,6 +14609,95 @@ pub fn "StrCharIter^Inspect::inspect"(self: &StrCharIter, f: &mut Formatter) { f.Formatter::write_str(" }"); } +pub fn "StrSplitIter^Inspect::inspect"(self: &StrSplitIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrSplitNIter^Inspect::inspect"(self: &StrSplitNIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitNIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("remaining: "); + Box { value: self.remaining }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrSplitWhitespaceIter^Inspect::inspect"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitWhitespaceIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrLinesIter^Inspect::inspect"(self: &StrLinesIter, f: &mut Formatter) { + f.Formatter::write_str("StrLinesIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrCharIndicesIter^Inspect::inspect"(self: &StrCharIndicesIter, f: &mut Formatter) { + f.Formatter::write_str("StrCharIndicesIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("byte_index: "); + Box { value: self.byte_index }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(I::Item) -> bool, f: &mut Formatter) { f.Formatter::write_str("|I::Item| -> bool"); } @@ -10902,6 +14730,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -10922,6 +14758,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -11000,6 +14852,123 @@ pub fn "StrCharIter^InspectAlt::inspect_alt"(self: &StrCharIter, f: &mut Formatt f.Formatter::close_brace("}"); } +pub fn "StrSplitIter^InspectAlt::inspect_alt"(self: &StrSplitIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrSplitNIter^InspectAlt::inspect_alt"(self: &StrSplitNIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitNIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("remaining: "); + Box { value: self.remaining }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrSplitWhitespaceIter^InspectAlt::inspect_alt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitWhitespaceIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrLinesIter^InspectAlt::inspect_alt"(self: &StrLinesIter, f: &mut Formatter) { + f.Formatter::open_brace("StrLinesIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrCharIndicesIter^InspectAlt::inspect_alt"(self: &StrCharIndicesIter, f: &mut Formatter) { + f.Formatter::open_brace("StrCharIndicesIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("byte_index: "); + Box { value: self.byte_index }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11032,6 +15001,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11052,6 +15029,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -11104,6 +15097,26 @@ pub fn "StrCharIter^Display::fmt"(self: &StrCharIter, f: &mut Formatter) { self."StrCharIter^Inspect::inspect"(f); } +pub fn "StrSplitIter^Display::fmt"(self: &StrSplitIter, f: &mut Formatter) { + self."StrSplitIter^Inspect::inspect"(f); +} + +pub fn "StrSplitNIter^Display::fmt"(self: &StrSplitNIter, f: &mut Formatter) { + self."StrSplitNIter^Inspect::inspect"(f); +} + +pub fn "StrSplitWhitespaceIter^Display::fmt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + self."StrSplitWhitespaceIter^Inspect::inspect"(f); +} + +pub fn "StrLinesIter^Display::fmt"(self: &StrLinesIter, f: &mut Formatter) { + self."StrLinesIter^Inspect::inspect"(f); +} + +pub fn "StrCharIndicesIter^Display::fmt"(self: &StrCharIndicesIter, f: &mut Formatter) { + self."StrCharIndicesIter^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11136,6 +15149,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11156,6 +15177,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -11208,6 +15245,26 @@ pub fn "StrCharIter^DisplayAlt::fmt_alt"(self: &StrCharIter, f: &mut Formatter) self."StrCharIter^InspectAlt::inspect_alt"(f); } +pub fn "StrSplitIter^DisplayAlt::fmt_alt"(self: &StrSplitIter, f: &mut Formatter) { + self."StrSplitIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrSplitNIter^DisplayAlt::fmt_alt"(self: &StrSplitNIter, f: &mut Formatter) { + self."StrSplitNIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrSplitWhitespaceIter^DisplayAlt::fmt_alt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + self."StrSplitWhitespaceIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrLinesIter^DisplayAlt::fmt_alt"(self: &StrLinesIter, f: &mut Formatter) { + self."StrLinesIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrCharIndicesIter^DisplayAlt::fmt_alt"(self: &StrCharIndicesIter, f: &mut Formatter) { + self."StrCharIndicesIter^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -11240,6 +15297,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -11248,16 +15313,32 @@ pub fn "Fn<2,u8>^DisplayAlt::fmt_alt"(self: &fn(u8, u8) -> u8, f: &mut Formatter self."Fn<2,u8>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(char) -> bool, f: &mut Formatter) { +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(char) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,char>^DisplayAlt::fmt_alt"(self: &fn(char, char) -> char, f: &mut Formatter) { + self."Fn<2,char>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<2,char>^DisplayAlt::fmt_alt"(self: &fn(char, char) -> char, f: &mut Formatter) { - self."Fn<2,char>^InspectAlt::inspect_alt"(f); +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^InspectAlt::inspect_alt"(f); +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); } pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { @@ -11304,6 +15385,94 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); } +pub fn "Array>::push"(self: &mut Array<[i32, char]>, value: [i32, char]) with stores[value] { + let used: i32 = self.used; + if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { + self."Array>::grow"(); + } + core::builtin::array_set::<[i32, char]>(self.repr, used, value); + self.used = (used + 1); +} + +pub fn "Array>::grow"(self: &mut Array<[i32, char]>) { + let capacity: i32 = core::builtin::array_len(self.repr); + let new_capacity: i32 = "core::prelude/array.wado::i32_max"((capacity * 2), 4); + let new_repr: builtin::array<[i32, char]> = core::builtin::array_new::<[i32, char]>(new_capacity); + let old_repr: builtin::array<[i32, char]> = self.repr; + let used: i32 = self.used; + __for_0: { + let mut i: i32 = 0; + loop { + if !(i < used) { + break __for_0; + } + __for_0_body: { + core::builtin::array_set::<[i32, char]>(new_repr, i, core::builtin::array_get::<[i32, char]>(old_repr, i)); + } + i = (i + 1); + } + } + self.repr = new_repr; +} + +fn "Array>^SequenceLiteralBuilder::build"(self: &Array<[i32, char]>) -> Array<[i32, char]> { + return *self; +} + +fn "Array>^SequenceLiteralBuilder::new_literal"(capacity: i32) -> Array<[i32, char]> { + return "core::prelude/string.wado::Array>::with_capacity"(capacity); +} + +pub fn "Array>::with_capacity"(capacity: i32) -> Array<[i32, char]> { + return Array> { repr: core::builtin::array_new::<[i32, char]>(capacity), used: 0 }; +} + +pub fn "Array::push"(self: &mut Array, value: String) with stores[value] { + let used: i32 = self.used; + if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { + self."Array::grow"(); + } + core::builtin::array_set::(self.repr, used, value); + self.used = (used + 1); +} + +pub fn "Array::grow"(self: &mut Array) { + let capacity: i32 = core::builtin::array_len(self.repr); + let new_capacity: i32 = "core::prelude/array.wado::i32_max"((capacity * 2), 4); + let new_repr: builtin::array = core::builtin::array_new::(new_capacity); + let old_repr: builtin::array = self.repr; + let used: i32 = self.used; + __for_0: { + let mut i: i32 = 0; + loop { + if !(i < used) { + break __for_0; + } + __for_0_body: { + core::builtin::array_set::(new_repr, i, core::builtin::array_get::(old_repr, i)); + } + i = (i + 1); + } + } + self.repr = new_repr; +} + +fn "Array^SequenceLiteralBuilder::build"(self: &Array) -> Array { + return *self; +} + +fn "Array^SequenceLiteralBuilder::new_literal"(capacity: i32) -> Array { + return "core::prelude/string.wado::Array::with_capacity"(capacity); +} + +pub fn "Array::with_capacity"(capacity: i32) -> Array { + return Array { repr: core::builtin::array_new::(capacity), used: 0 }; +} + +fn "StrCharIter^IntoIterator::into_iter"(self: &StrCharIter) -> StrCharIter { + return *self; +} + pub fn "StrCharIter^Iterator::map"(self: &StrCharIter, f: fn(char) -> char) -> IterMap { return IterMap { inner: *self, f: f }; } @@ -11316,7 +15485,7 @@ pub fn "String::from_iter>"(iter: IterMap = __iter_2."IterMap^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let c: char = __variant_payload(__pattern_temp_0, case=0); - s.String::append_char(c); + s.String::push(c); } else { break; } @@ -11338,7 +15507,7 @@ fn "IterMap^IntoIterator::into_iter"(self: &IterMap::append"(self: &mut Array, value: char) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: char) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -11380,7 +15549,7 @@ pub fn "Array::with_capacity"(capacity: i32) -> Array { return Array { repr: core::builtin::array_new::(capacity), used: 0 }; } -pub fn "Array::append"(self: &mut Array, value: u8) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: u8) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -11445,6 +15614,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -11522,6 +15791,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -11542,6 +15819,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -11618,6 +15911,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11638,6 +15939,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -11714,6 +16031,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11734,6 +16059,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -11810,6 +16151,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -11830,6 +16179,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -11866,25 +16231,125 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: core:prelude/types.wado --- +pub struct WaitEvent { + pub code: i32, + pub handle: Waitable, + pub payload: u32, +} + +pub struct "ArrayIter" { + repr: builtin::array, + used: i32, + index: i32, +} + +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -// --- Module: core:prelude/types.wado --- -pub struct WaitEvent { - pub code: i32, - pub handle: Waitable, - pub payload: u32, +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -pub struct "ArrayIter" { - repr: builtin::array, - used: i32, - index: i32, +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } pub struct "IterMap" { @@ -12001,6 +16466,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -12021,6 +16494,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -12114,6 +16603,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12134,6 +16631,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -12214,6 +16727,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12234,6 +16755,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -12314,6 +16851,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -12334,6 +16879,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -12410,6 +16971,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -12561,82 +17222,82 @@ fn string_literals() { fn template_strings(name: String, pi: f64, n: i32) { let a: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(24); - __r.String::append("Hello, "); - __r.String::append(name); - __r.String::append("!"); + __r.String::push_str("Hello, "); + __r.String::push_str(name); + __r.String::push_str("!"); break __tmpl: __r; }; let b: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); - __r.String::append("Pi is approximately "); + __r.String::push_str("Pi is approximately "); let mut __f: Formatter = Formatter { fill: ' ', align: Alignment::Right, sign_plus: false, zero_pad: false, width: 0, precision: 2, indent: 0, buf: &mut __r }; Box { value: pi }."f64^Display::fmt"(&mut __f); break __tmpl: __r; }; let c: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(27); - __r.String::append("Hex value: "); + __r.String::push_str("Hex value: "); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: n }."i32^LowerHex::fmt"(&mut __f); break __tmpl: __r; }; let d: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(31); - __r.String::append("Right-aligned: "); + __r.String::push_str("Right-aligned: "); let mut __f: Formatter = Formatter { fill: ' ', align: Alignment::Right, sign_plus: false, zero_pad: false, width: 10, precision: -1, indent: 0, buf: &mut __r }; Box { value: n }."i32^Display::fmt"(&mut __f); break __tmpl: __r; }; let e: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(29); - __r.String::append("Zero-padded: "); + __r.String::push_str("Zero-padded: "); let mut __f: Formatter = Formatter { fill: '0', align: Alignment::Right, sign_plus: false, zero_pad: true, width: 8, precision: -1, indent: 0, buf: &mut __r }; Box { value: n }."i32^Display::fmt"(&mut __f); break __tmpl: __r; }; let f: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(24); - __r.String::append("Signed: "); + __r.String::push_str("Signed: "); let mut __f: Formatter = Formatter { fill: ' ', align: Alignment::Right, sign_plus: true, zero_pad: false, width: -1, precision: -1, indent: 0, buf: &mut __r }; Box { value: n }."i32^Display::fmt"(&mut __f); break __tmpl: __r; }; let g: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(25); - __r.String::append("Alt hex: "); + __r.String::push_str("Alt hex: "); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: n }."i32^LowerHexAlt::fmt_alt"(&mut __f); break __tmpl: __r; }; let h: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(40); - __r.String::append(name); - __r.String::append(": "); + __r.String::push_str(name); + __r.String::push_str(": "); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: n }."i32^Display::fmt"(&mut __f); - __r.String::append(" items"); + __r.String::push_str(" items"); break __tmpl: __r; }; let i: String = "no interpolation here"; let j: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(23); - __r.String::append("debug: "); + __r.String::push_str("debug: "); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: n }."i32^Inspect::inspect"(&mut __f); break __tmpl: __r; }; let k: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(35); - __r.String::append("multiline\ntemplate "); - __r.String::append(name); + __r.String::push_str("multiline\ntemplate "); + __r.String::push_str(name); break __tmpl: __r; }; let l: String = "{\"key\": \"value\"}"; let m: String = __tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(43); - __r.String::append("prefix {literal} and "); - __r.String::append(name); - __r.String::append(" mixed"); + __r.String::push_str("prefix {literal} and "); + __r.String::push_str(name); + __r.String::push_str(" mixed"); break __tmpl: __r; }; let n2: String = "{\"name\":\"Alice\",\"age\":30}"; @@ -12649,18 +17310,18 @@ fn asserts(x: i32, s: String) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(111); - __r.String::append("Assertion failed in "); - __r.String::append("asserts"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("asserts"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 224 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: x > 0\n"); - __r.String::append("x: "); + __r.String::push_str("\ncondition: x > 0\n"); + __r.String::push_str("x: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -12671,20 +17332,20 @@ fn asserts(x: i32, s: String) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(131); - __r.String::append("Assertion failed in "); - __r.String::append("asserts"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("asserts"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 225 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("x must be less than 100"); - __r.String::append("\ncondition: x < 100\n"); - __r.String::append("x: "); + __r.String::push_str(": "); + __r.String::push_str("x must be less than 100"); + __r.String::push_str("\ncondition: x < 100\n"); + __r.String::push_str("x: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -12695,27 +17356,27 @@ fn asserts(x: i32, s: String) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(130); - __r.String::append("Assertion failed in "); - __r.String::append("asserts"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("asserts"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 226 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append(__tmpl: { + __r.String::push_str(": "); + __r.String::push_str(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(44); - __r.String::append("x is "); + __r.String::push_str("x is "); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: x }."i32^Display::fmt"(&mut __f); - __r.String::append(" but should not be zero"); + __r.String::push_str(" but should not be zero"); break __tmpl: __r; }); - __r.String::append("\ncondition: x != 0\n"); - __r.String::append("x: "); + __r.String::push_str("\ncondition: x != 0\n"); + __r.String::push_str("x: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -12726,18 +17387,18 @@ fn asserts(x: i32, s: String) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(123); - __r.String::append("Assertion failed in "); - __r.String::append("asserts"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("asserts"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 227 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: s.len() > 0\n"); - __r.String::append("s.len(): "); + __r.String::push_str("\ncondition: s.len() > 0\n"); + __r.String::push_str("s.len(): "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -13215,6 +17876,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -13235,6 +17904,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -13397,6 +18082,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -13417,6 +18110,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -13529,6 +18238,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -13549,6 +18266,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -13661,6 +18394,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -13681,6 +18422,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -13747,7 +18504,7 @@ fn __cm_binding__Environment_get_environment() -> Array<[String, String]> { let __elem_addr: i32 = (__base + (__i * 16)); let __lifted_result_6: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4))); let __lifted_result_7: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4))); - __result."Array>::append"([__lifted_result_6, __lifted_result_7]); + __result."Array>::push"([__lifted_result_6, __lifted_result_7]); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4)), 1, 0); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4)), 1, 0); __i = (__i + 1); @@ -13771,7 +18528,7 @@ fn __cm_binding__Environment_get_arguments() -> Array { break; } let __elem_addr: i32 = (__base + (__i * 8)); - __result."Array::append"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); + __result."Array::push"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); core::builtin::realloc(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)), 1, 0); __i = (__i + 1); } @@ -13813,7 +18570,7 @@ export fn __cm_export__run() { cm_raw_call task-return(0); } -pub fn "Array::append"(self: &mut Array, value: String) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: String) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -13847,7 +18604,7 @@ pub fn "Array::with_capacity"(capacity: i32) -> Array { return Array { repr: core::builtin::array_new::(capacity), used: 0 }; } -pub fn "Array>::append"(self: &mut Array<[String, String]>, value: [String, String]) with stores[value] { +pub fn "Array>::push"(self: &mut Array<[String, String]>, value: [String, String]) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array>::grow"(); @@ -13979,10 +18736,10 @@ fn "Array>^SequenceLiteralBuilder::build"(self: &Array>) - } fn "Array>^SequenceLiteralBuilder::push_literal"(self: &mut Array>, value: Array) with stores[value] { - self."Array>::append"(value); + self."Array>::push"(value); } -pub fn "Array>::append"(self: &mut Array>, value: Array) with stores[value] { +pub fn "Array>::push"(self: &mut Array>, value: Array) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array>::grow"(); @@ -14025,10 +18782,10 @@ fn "Array^SequenceLiteralBuilder::build"(self: &Array) -> Array { } fn "Array^SequenceLiteralBuilder::push_literal"(self: &mut Array, value: i32) with stores[value] { - self."Array::append"(value); + self."Array::push"(value); } -pub fn "Array::append"(self: &mut Array, value: i32) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: i32) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -14087,36 +18844,136 @@ fn __Closure_4::__call(self: &__Closure_4, x: i32) -> i32 { return (doubled + x); } -fn __Closure_5::__call(self: &__Closure_5, name: String) -> String { - return __tmpl: { - let mut __r: String = "core::prelude/string.wado::String::with_capacity"(24); - __r.String::append("Hello, "); - __r.String::append(name); - __r.String::append("!"); - break __tmpl: __r; - }; +fn __Closure_5::__call(self: &__Closure_5, name: String) -> String { + return __tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(24); + __r.String::push_str("Hello, "); + __r.String::push_str(name); + __r.String::push_str("!"); + break __tmpl: __r; + }; +} + +fn __Closure_6::__call(self: &__Closure_6, x: i32) -> i32 { + return (x * self.__capture_0); +} + +fn __Closure_7::__call(self: &__Closure_7) { + self.__capture_0.value = (self.__capture_0.value + 1); +} + +fn __initialize_modules() { + if __modules_initialized { + return; + } + __modules_initialized = true; +} + +// --- Module: wasi:cli --- +pub struct "ArrayIter" { + repr: builtin::array, + used: i32, + index: i32, +} + +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -fn __Closure_6::__call(self: &__Closure_6, x: i32) -> i32 { - return (x * self.__capture_0); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -fn __Closure_7::__call(self: &__Closure_7) { - self.__capture_0.value = (self.__capture_0.value + 1); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -fn __initialize_modules() { - if __modules_initialized { - return; - } - __modules_initialized = true; +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -// --- Module: wasi:cli --- -pub struct "ArrayIter" { - repr: builtin::array, - used: i32, - index: i32, +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } pub struct "IterMap" { @@ -14196,6 +19053,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -14216,6 +19081,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -14292,6 +19173,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -14312,6 +19201,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -14388,6 +19293,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -14408,6 +19321,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -14484,6 +19413,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -14504,6 +19441,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -14555,6 +19508,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -14632,6 +19685,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -14652,6 +19713,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -14728,6 +19805,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -14748,6 +19833,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -14824,6 +19925,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -14844,6 +19953,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -14920,6 +20045,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -14940,6 +20073,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -14964,31 +20113,131 @@ pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { - self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { + self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: wasi:cli/exit.wado --- +pub struct "ArrayIter" { + repr: builtin::array, + used: i32, + index: i32, +} + +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -// --- Module: wasi:cli/exit.wado --- -pub struct "ArrayIter" { - repr: builtin::array, - used: i32, - index: i32, +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } pub struct "IterMap" { @@ -15068,6 +20317,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -15088,6 +20345,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -15164,6 +20437,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -15184,6 +20465,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -15260,6 +20557,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -15280,6 +20585,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -15356,6 +20677,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -15376,6 +20705,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -15427,6 +20772,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -15504,6 +20949,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -15524,6 +20977,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -15600,6 +21069,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -15620,6 +21097,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -15696,6 +21189,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -15716,6 +21217,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -15792,6 +21309,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -15812,6 +21337,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -15832,35 +21373,135 @@ pub fn "Fn<0,unit>^DisplayAlt::fmt_alt"(self: &fn() -> (), f: &mut Formatter) { self."Fn<0,unit>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { - self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { + self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { + self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: wasi:cli/stderr.wado --- +pub struct "ArrayIter" { + repr: builtin::array, + used: i32, + index: i32, +} + +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, } -pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { - self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -// --- Module: wasi:cli/stderr.wado --- -pub struct "ArrayIter" { - repr: builtin::array, - used: i32, - index: i32, +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } pub struct "IterMap" { @@ -15940,6 +21581,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -15960,6 +21609,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -16036,6 +21701,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -16056,6 +21729,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -16132,6 +21821,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -16152,6 +21849,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -16228,6 +21941,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -16248,6 +21969,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -16299,6 +22036,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -16376,6 +22213,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -16396,6 +22241,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -16472,6 +22333,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -16492,6 +22361,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -16568,6 +22453,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -16588,6 +22481,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -16664,6 +22573,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -16684,6 +22601,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -16712,27 +22645,127 @@ pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Ite self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: wasi:cli/stdout.wado --- +pub struct "ArrayIter" { + repr: builtin::array, + used: i32, + index: i32, +} + +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -// --- Module: wasi:cli/stdout.wado --- -pub struct "ArrayIter" { - repr: builtin::array, - used: i32, - index: i32, +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } pub struct "IterMap" { @@ -16812,6 +22845,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -16832,6 +22873,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -16908,6 +22965,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -16928,6 +22993,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -17004,6 +23085,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -17024,6 +23113,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -17100,6 +23205,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -17120,6 +23233,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -17171,6 +23300,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -17248,6 +23477,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -17268,6 +23505,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -17344,6 +23597,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -17364,6 +23625,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -17440,6 +23717,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -17460,6 +23745,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -17536,6 +23837,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -17556,55 +23865,171 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { + self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,i32>^DisplayAlt::fmt_alt"(self: &fn(i32, i32) -> i32, f: &mut Formatter) { + self."Fn<2,i32>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(i32) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,String>^DisplayAlt::fmt_alt"(self: &fn(String) -> String, f: &mut Formatter) { + self."Fn<1,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<0,unit>^DisplayAlt::fmt_alt"(self: &fn() -> (), f: &mut Formatter) { + self."Fn<0,unit>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<2,i32>^DisplayAlt::fmt_alt"(self: &fn(i32, i32) -> i32, f: &mut Formatter) { - self."Fn<2,i32>^InspectAlt::inspect_alt"(f); +pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { + self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: wasi:cli/terminal-output.wado --- +pub struct "ArrayIter" { + repr: builtin::array, + used: i32, + index: i32, +} + +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(i32) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, } -pub fn "Fn<1,String>^DisplayAlt::fmt_alt"(self: &fn(String) -> String, f: &mut Formatter) { - self."Fn<1,String>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<0,unit>^DisplayAlt::fmt_alt"(self: &fn() -> (), f: &mut Formatter) { - self."Fn<0,unit>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, } -pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { - self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, } -pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { - self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -// --- Module: wasi:cli/terminal-output.wado --- -pub struct "ArrayIter" { - repr: builtin::array, - used: i32, - index: i32, +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } pub struct "IterMap" { @@ -17684,6 +24109,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -17704,6 +24137,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -17780,6 +24229,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -17800,6 +24257,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -17876,6 +24349,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -17896,6 +24377,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -17972,6 +24469,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -17992,6 +24497,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -18043,6 +24564,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -18120,6 +24741,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -18140,6 +24769,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -18216,6 +24861,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -18236,6 +24889,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -18312,6 +24981,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -18332,6 +25009,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -18408,6 +25101,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -18428,6 +25129,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -18479,6 +25196,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -18556,6 +25373,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -18576,6 +25401,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -18652,6 +25493,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -18672,6 +25521,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -18748,6 +25613,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -18768,6 +25641,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -18844,6 +25733,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -18864,6 +25761,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -18915,6 +25828,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -18992,6 +26005,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -19012,6 +26033,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -19088,6 +26125,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -19108,6 +26153,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -19184,6 +26245,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -19204,6 +26273,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -19280,6 +26365,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -19300,6 +26393,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -19351,6 +26460,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -19464,6 +26673,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -19484,6 +26701,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -19564,6 +26797,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -19580,8 +26821,24 @@ pub fn "Fn<2,char>^InspectAlt::inspect_alt"(self: &fn(char, char) -> char, f: &m self."Fn<2,char>^Inspect::inspect"(f); } -pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^Inspect::inspect"(f); +pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); } pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { @@ -19664,6 +26921,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -19684,6 +26949,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -19764,6 +27045,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -19784,6 +27073,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -19839,6 +27144,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -19975,6 +27380,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -19995,6 +27408,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -20084,6 +27513,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -20104,6 +27541,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -20188,6 +27641,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -20208,6 +27669,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -20292,6 +27769,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -20312,6 +27797,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -20374,6 +27875,106 @@ pub struct "ArrayIter" { index: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -20430,11 +28031,11 @@ pub fn Formatter::new(buf: &mut String) -> Formatter with stores[buf] { } pub fn Formatter::write_str(self: &mut Formatter, s: String) { - self.buf.String::append(s); + self.buf.String::push_str(s); } pub fn Formatter::write_char(self: &mut Formatter, c: char) { - self.buf.String::append_char(c); + self.buf.String::push(c); } pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { @@ -20445,7 +28046,7 @@ pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { break __for_0; } __for_0_body: { - self.buf.String::append_char(c); + self.buf.String::push(c); } i = (i + 1); } @@ -20455,7 +28056,7 @@ pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { pub fn Formatter::pad(self: &mut Formatter, content: String) { let content_len: i32 = content.String::len(); if ((self.width <= 0) || (content_len >= self.width)) { - self.buf.String::append(content); + self.buf.String::push_str(content); return; } let padding: i32 = (self.width - content_len); @@ -20464,7 +28065,7 @@ pub fn Formatter::pad(self: &mut Formatter, content: String) { Left => true, _ => false, } { - self.buf.String::append(content); + self.buf.String::push_str(content); self.Formatter::write_char_n(self.fill, padding); } else { if match align { @@ -20474,11 +28075,11 @@ pub fn Formatter::pad(self: &mut Formatter, content: String) { let left_pad: i32 = (padding / 2); let right_pad: i32 = (padding - left_pad); self.Formatter::write_char_n(self.fill, left_pad); - self.buf.String::append(content); + self.buf.String::push_str(content); self.Formatter::write_char_n(self.fill, right_pad); } else { self.Formatter::write_char_n(self.fill, padding); - self.buf.String::append(content); + self.buf.String::push_str(content); } } } @@ -20591,20 +28192,20 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre let content_len: i32 = ((sign_len + prefix_len) + digit_count); if ((self.width <= 0) || (content_len >= self.width)) { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } return self.buf.String::internal_reserve_uninit(digit_count); } let padding: i32 = (self.width - content_len); if self.zero_pad { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } self.Formatter::write_char_n('0', padding); return self.buf.String::internal_reserve_uninit(digit_count); @@ -20615,10 +28216,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre _ => false, } { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } let offset: i32 = self.buf.String::internal_reserve_uninit(digit_count); self.Formatter::write_char_n(self.fill, padding); @@ -20632,10 +28233,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre let right_pad: i32 = (padding - left_pad); self.Formatter::write_char_n(self.fill, left_pad); if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } let offset: i32 = self.buf.String::internal_reserve_uninit(digit_count); self.Formatter::write_char_n(self.fill, right_pad); @@ -20643,10 +28244,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre } else { self.Formatter::write_char_n(self.fill, padding); if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } return self.buf.String::internal_reserve_uninit(digit_count); } @@ -20836,6 +28437,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -20856,6 +28465,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -20936,6 +28561,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -20956,6 +28589,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -21036,6 +28685,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -21056,6 +28713,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -21136,6 +28809,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -21156,6 +28837,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } diff --git a/wado-compiler/tests/format.fixtures.golden/all.optimize.wado b/wado-compiler/tests/format.fixtures.golden/all.optimize.wado index 9f4fa31dc..ec8c4f850 100644 --- a/wado-compiler/tests/format.fixtures.golden/all.optimize.wado +++ b/wado-compiler/tests/format.fixtures.golden/all.optimize.wado @@ -44,7 +44,7 @@ fn __cm_binding__Environment_get_environment() -> Array<[String, String]> { let __elem_addr: i32 = (__base + (__i * 16)); let __lifted_result_6: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4))); let __lifted_result_7: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4))); - __result."Array>::append"([__lifted_result_6, __lifted_result_7]); + __result."Array>::push"([__lifted_result_6, __lifted_result_7]); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4)), 1, 0); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4)), 1, 0); __i = (__i + 1); @@ -68,7 +68,7 @@ fn __cm_binding__Environment_get_arguments() -> Array { break; } let __elem_addr: i32 = (__base + (__i * 8)); - __result."Array::append"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); + __result."Array::push"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); core::builtin::realloc(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)), 1, 0); __i = (__i + 1); } diff --git a/wado-compiler/tests/format.fixtures.golden/all.tir.wado b/wado-compiler/tests/format.fixtures.golden/all.tir.wado index 9f4fa31dc..ec8c4f850 100644 --- a/wado-compiler/tests/format.fixtures.golden/all.tir.wado +++ b/wado-compiler/tests/format.fixtures.golden/all.tir.wado @@ -44,7 +44,7 @@ fn __cm_binding__Environment_get_environment() -> Array<[String, String]> { let __elem_addr: i32 = (__base + (__i * 16)); let __lifted_result_6: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4))); let __lifted_result_7: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4))); - __result."Array>::append"([__lifted_result_6, __lifted_result_7]); + __result."Array>::push"([__lifted_result_6, __lifted_result_7]); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4)), 1, 0); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4)), 1, 0); __i = (__i + 1); @@ -68,7 +68,7 @@ fn __cm_binding__Environment_get_arguments() -> Array { break; } let __elem_addr: i32 = (__base + (__i * 8)); - __result."Array::append"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); + __result."Array::push"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); core::builtin::realloc(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)), 1, 0); __i = (__i + 1); } diff --git a/wado-compiler/tests/format.fixtures.golden/mess.clean.wado b/wado-compiler/tests/format.fixtures.golden/mess.clean.wado index d7ad6bf25..e3ba57b08 100644 --- a/wado-compiler/tests/format.fixtures.golden/mess.clean.wado +++ b/wado-compiler/tests/format.fixtures.golden/mess.clean.wado @@ -194,9 +194,9 @@ fn add(a: i32, b: i32) -> i32 { // Multiline expression statement followed by comment (no extra blank lines) fn multiline_expr_stmt(buf: String, upper: bool) { - buf.append(if upper { "E" } else { "e" }); + buf.push_str(if upper { "E" } else { "e" }); // next statement immediately follows - buf.append("0"); + buf.push_str("0"); } // Multiline return statement followed by comment (no extra blank lines) diff --git a/wado-compiler/tests/format.fixtures.golden/mess.lower.wado b/wado-compiler/tests/format.fixtures.golden/mess.lower.wado index 224f3bea4..9f55a369a 100644 --- a/wado-compiler/tests/format.fixtures.golden/mess.lower.wado +++ b/wado-compiler/tests/format.fixtures.golden/mess.lower.wado @@ -1,6 +1,106 @@ // --- Module: core:allocator --- global mut heap_offset: i32 = 8; +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -123,6 +223,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -143,6 +251,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -199,6 +323,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -219,6 +351,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -275,6 +423,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -295,6 +451,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -351,6 +523,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -371,6 +551,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -396,6 +592,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:builtin --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -1225,6 +1521,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -1245,6 +1549,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -1301,6 +1621,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1321,6 +1649,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -1377,6 +1721,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1397,6 +1749,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -1453,6 +1821,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -1473,6 +1849,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -1498,53 +1890,153 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:cli --- -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, } -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, } -pub struct "IterSkip" { - pub inner: StrUtf8ByteIter, +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrUtf8ByteIter, +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrUtf8ByteIter, +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrUtf8ByteIter, - pub pred: fn(u8) -> bool, +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, } -pub fn write_to_stream(tx: StreamWritable, message: String, add_newline: bool) { - let bytes: builtin::array = message.String::internal_raw_bytes(); +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrUtf8ByteIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrUtf8ByteIter, + pub pred: fn(u8) -> bool, +} + +pub fn write_to_stream(tx: StreamWritable, message: String, add_newline: bool) { + let bytes: builtin::array = message.String::internal_raw_bytes(); let len: i32 = message.String::len(); if add_newline { let new_repr: builtin::array = "core::cli::core/builtin/array_new"((len + 1)); @@ -1675,6 +2167,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -1695,6 +2195,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -1751,6 +2267,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1771,6 +2295,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -1827,6 +2367,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1847,6 +2395,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -1903,6 +2467,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -1923,6 +2495,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -1963,6 +2551,106 @@ fn "core/builtin/array_copy"(dst: builtin::array, dst_offset: i32, src: fn "core/builtin/array_new"(len: i32) -> builtin::array; // --- Module: core:internal --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -2358,6 +3046,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -2378,6 +3074,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -2434,6 +3146,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2454,6 +3174,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -2510,6 +3246,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2530,6 +3274,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -2586,6 +3346,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -2606,6 +3374,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -2655,38 +3439,138 @@ fn "core/builtin/array_copy"(dst: builtin::array, dst_offset: i32, src: fn "core/builtin/array_new"(len: i32) -> builtin::array; // --- Module: core:prelude --- -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, -} - -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, } -pub struct "IterSkip" { - pub inner: StrUtf8ByteIter, +pub struct "IterSkip" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrUtf8ByteIter, +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrUtf8ByteIter, pub remaining: i32, } @@ -2732,6 +3616,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -2752,6 +3644,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -2808,6 +3716,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2828,6 +3744,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -2884,6 +3816,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2904,6 +3844,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -2960,6 +3916,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -2980,6 +3944,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -3005,6 +3985,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:prelude/array.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -3090,6 +4170,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -3110,6 +4198,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -3166,6 +4270,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -3186,6 +4298,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -3242,6 +4370,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -3262,6 +4398,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -3318,6 +4470,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -3338,6 +4498,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -3382,29 +4558,129 @@ pub struct FormatResult { pub exponent: i32, } -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, -} - -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, } pub struct "IterSkip" { @@ -3760,20 +5036,20 @@ pub fn fixed_width(f: f64, n: i32) -> FormatResult { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(131); - __r.String::append("Assertion failed in "); - __r.String::append("fixed_width"); - __r.String::append(" at "); - __r.String::append("core:prelude/fpfmt.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("fixed_width"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/fpfmt.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 289 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("digits must be <= 18"); - __r.String::append("\ncondition: n <= 18\n"); - __r.String::append("n: "); + __r.String::push_str(": "); + __r.String::push_str("digits must be <= 18"); + __r.String::push_str("\ncondition: n <= 18\n"); + __r.String::push_str("n: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -4002,7 +5278,7 @@ fn fill_zeros(buf: &mut String, n: i32) { pub fn write_decimal(buf: &mut String, d: u64, p: i32, nd: i32) { let decimal_pos: i32 = (nd + p); if (decimal_pos <= 0) { - buf.String::append("0."); + buf.String::push_str("0."); "core::prelude/fpfmt.wado::fill_zeros"(buf, -decimal_pos); let digit_offset: i32 = buf.String::len(); "core::prelude/fpfmt.wado::fill_zeros"(buf, nd); @@ -4054,13 +5330,13 @@ pub fn write_exp(buf: &mut String, d: u64, p: i32, nd: i32, upper: bool) { "core::prelude/fpfmt.wado::fill_zeros"(buf, 1); "core::prelude/fpfmt.wado::write_digits_at"(buf, start, d, 1); } - buf.String::append(if upper { + buf.String::push_str(if upper { "E"; } else { "e"; }); if (exp < 0) { - buf.String::append("-"); + buf.String::push_str("-"); } let abs_exp: i32 = if (exp < 0) { -exp; @@ -4068,15 +5344,15 @@ pub fn write_exp(buf: &mut String, d: u64, p: i32, nd: i32, upper: bool) { exp; }; if (abs_exp < 10) { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); } else { if (abs_exp < 100) { - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); } else { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); } } } @@ -4095,7 +5371,7 @@ pub fn write_decimal_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: let decimal_pos: i32 = (nd + p); if (decimal_pos <= 0) { let leading_zeros: i32 = -decimal_pos; - buf.String::append("0."); + buf.String::push_str("0."); if (precision <= leading_zeros) { "core::prelude/fpfmt.wado::fill_zeros"(buf, precision); return; @@ -4128,7 +5404,7 @@ pub fn write_decimal_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: "core::prelude/fpfmt.wado::write_digits_at"(buf, start, d, nd); "core::prelude/fpfmt.wado::fill_zeros"(buf, (decimal_pos - nd)); if (precision > 0) { - buf.String::append("."); + buf.String::push_str("."); "core::prelude/fpfmt.wado::fill_zeros"(buf, precision); } } else { @@ -4216,13 +5492,13 @@ pub fn write_exp_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: i32, "core::prelude/fpfmt.wado::write_digits_at"(buf, start, first_d, 1); } let exp: i32 = ((p + nd) - 1); - buf.String::append(if upper { + buf.String::push_str(if upper { "E"; } else { "e"; }); if (exp < 0) { - buf.String::append("-"); + buf.String::push_str("-"); } let abs_exp: i32 = if (exp < 0) { -exp; @@ -4230,15 +5506,15 @@ pub fn write_exp_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: i32, exp; }; if (abs_exp < 10) { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); } else { if (abs_exp < 100) { - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); } else { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); } } } @@ -4580,6 +5856,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -4600,6 +5884,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -4699,6 +5999,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -4719,6 +6027,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -4791,6 +6115,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -4811,6 +6143,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -4883,6 +6231,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -4903,6 +6259,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -4932,10 +6304,10 @@ fn "Array^SequenceLiteralBuilder::build"(self: &Array) -> Array { } fn "Array^SequenceLiteralBuilder::push_literal"(self: &mut Array, value: u64) with stores[value] { - self."Array::append"(value); + self."Array::push"(value); } -pub fn "Array::append"(self: &mut Array, value: u64) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: u64) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -4997,6 +6369,106 @@ pub struct i128 { high: i64, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -5952,6 +7424,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -5972,6 +7452,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -6028,6 +7524,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -6048,6 +7552,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -6104,6 +7624,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -6124,6 +7652,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -6188,6 +7732,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -6208,6 +7760,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -6233,38 +7801,138 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:prelude/primitive.wado --- -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, -} - -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, } -pub struct "IterSkip" { - pub inner: StrUtf8ByteIter, +pub struct "IterSkip" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrUtf8ByteIter, +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrUtf8ByteIter, pub remaining: i32, } @@ -6490,7 +8158,7 @@ pub fn char::from_u32_unchecked(value: u32) -> char { pub fn char::to_string(self: Box) -> String { let mut buf: String = "core::prelude/string.wado::String::with_capacity"(4); - buf.String::append_char(self.value); + buf.String::push(self.value); return buf; } @@ -6893,24 +8561,24 @@ fn fmt_float_special(f: &mut Formatter, is_neg: bool, kind: SpecialKind, zero_re NaN => true, _ => false, } { - f.buf.String::append("NaN"); + f.buf.String::push_str("NaN"); } else { if match kind { Inf => true, _ => false, } { - f.buf.String::append(if is_neg { + f.buf.String::push_str(if is_neg { "-inf"; } else { "inf"; }); } else { - f.buf.String::append(if is_neg { + f.buf.String::push_str(if is_neg { "-"; } else { ""; }); - f.buf.String::append(zero_repr); + f.buf.String::push_str(zero_repr); } } f.Formatter::apply_padding(mark); @@ -6918,10 +8586,10 @@ fn fmt_float_special(f: &mut Formatter, is_neg: bool, kind: SpecialKind, zero_re fn fmt_float_sign(f: &mut Formatter, is_neg: bool) { if is_neg { - f.buf.String::append("-"); + f.buf.String::push_str("-"); } else { if f.sign_plus { - f.buf.String::append("+"); + f.buf.String::push_str("+"); } } } @@ -6984,7 +8652,7 @@ fn f32::inspect_into(self: Box, f: &mut Formatter) { } else { if (p >= 0) { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); - f.buf.String::append(".0"); + f.buf.String::push_str(".0"); } else { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); } @@ -7226,7 +8894,7 @@ fn f64::inspect_into(self: Box, f: &mut Formatter) { } else { if (p >= 0) { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); - f.buf.String::append(".0"); + f.buf.String::push_str(".0"); } else { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); } @@ -7253,9 +8921,9 @@ fn f64::fmt_fixed(self: Box, precision: i32, f: &mut Formatter) { } let mark: i32 = f.Formatter::mark(); "core::prelude/primitive.wado::fmt_float_sign"(f, is_neg); - f.buf.String::append("0"); + f.buf.String::push_str("0"); if (precision > 0) { - f.buf.String::append("."); + f.buf.String::push_str("."); f.buf.String::append_byte_filled('0' as u8, precision); } f.Formatter::apply_padding(mark); @@ -7296,17 +8964,17 @@ fn f64::fmt_exp(self: Box, precision: i32, upper: i32, f: &mut Formatter) { } let mark: i32 = f.Formatter::mark(); "core::prelude/primitive.wado::fmt_float_sign"(f, is_neg); - f.buf.String::append("0"); + f.buf.String::push_str("0"); if (precision > 0) { - f.buf.String::append("."); + f.buf.String::push_str("."); f.buf.String::append_byte_filled('0' as u8, precision); } - f.buf.String::append(if upper_bool { + f.buf.String::push_str(if upper_bool { "E"; } else { "e"; }); - f.buf.String::append("0"); + f.buf.String::push_str("0"); f.Formatter::apply_padding(mark); return; } @@ -7511,7 +9179,7 @@ pub fn "char^Display::fmt"(self: Box, f: &mut Formatter) { f.Formatter::write_char(self.value); } else { let mut s: String = "core::prelude/string.wado::String::with_capacity"(4); - s.String::append_char(self.value); + s.String::push(self.value); f.Formatter::pad(s); } } @@ -8575,7 +10243,7 @@ pub fn "i32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i32"); + __r.String::push_str(" out of range for i32"); break __tmpl: __r; })); } @@ -8588,7 +10256,7 @@ pub fn "i16^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i16"); + __r.String::push_str(" out of range for i16"); break __tmpl: __r; })); } @@ -8601,7 +10269,7 @@ pub fn "i8^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -8614,7 +10282,7 @@ pub fn "i16^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for i16"); + __r.String::push_str(" out of range for i16"); break __tmpl: __r; })); } @@ -8627,7 +10295,7 @@ pub fn "i8^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -8640,7 +10308,7 @@ pub fn "i8^TryFrom::try_from"(value: i16) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i16^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -8653,7 +10321,7 @@ pub fn "u32^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -8666,7 +10334,7 @@ pub fn "u64^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u64"); + __r.String::push_str(" out of range for u64"); break __tmpl: __r; })); } @@ -8679,7 +10347,7 @@ pub fn "u32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -8692,7 +10360,7 @@ pub fn "i64^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i64"); + __r.String::push_str(" out of range for i64"); break __tmpl: __r; })); } @@ -8705,7 +10373,7 @@ pub fn "u32^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -8718,7 +10386,7 @@ pub fn "u16^TryFrom::try_from"(value: u32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u16"); + __r.String::push_str(" out of range for u16"); break __tmpl: __r; })); } @@ -8731,7 +10399,7 @@ pub fn "u8^TryFrom::try_from"(value: u32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u8"); + __r.String::push_str(" out of range for u8"); break __tmpl: __r; })); } @@ -8744,7 +10412,7 @@ pub fn "u8^TryFrom::try_from"(value: u16) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u16^Display::fmt"(&mut __f); - __r.String::append(" out of range for u8"); + __r.String::push_str(" out of range for u8"); break __tmpl: __r; })); } @@ -8758,7 +10426,7 @@ pub fn "f32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f32"); + __r.String::push_str(" cannot be exactly represented as f32"); break __tmpl: __r; })); } @@ -8772,7 +10440,7 @@ pub fn "f64^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f64"); + __r.String::push_str(" cannot be exactly represented as f64"); break __tmpl: __r; })); } @@ -8785,7 +10453,7 @@ pub fn "f64^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f64"); + __r.String::push_str(" cannot be exactly represented as f64"); break __tmpl: __r; })); } @@ -8798,7 +10466,7 @@ pub fn "f32^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f32"); + __r.String::push_str(" cannot be exactly represented as f32"); break __tmpl: __r; })); } @@ -8837,6 +10505,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -8857,6 +10533,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -8913,6 +10605,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -8933,6 +10633,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -8989,6 +10705,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9009,6 +10733,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -9065,6 +10805,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -9085,6 +10833,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -9145,6 +10909,144 @@ pub struct StrCharIter { byte_index: i32, } +pub struct StrSplitIter { + repr: builtin::array, + used: i32, + pos: i32, + sep_repr: builtin::array, + sep_len: i32, + finished: bool, +} + +pub struct StrSplitNIter { + repr: builtin::array, + used: i32, + pos: i32, + sep_repr: builtin::array, + sep_len: i32, + remaining: i32, + finished: bool, +} + +pub struct StrSplitWhitespaceIter { + repr: builtin::array, + used: i32, + pos: i32, +} + +pub struct StrLinesIter { + repr: builtin::array, + used: i32, + pos: i32, + finished: bool, +} + +pub struct StrCharIndicesIter { + repr: builtin::array, + used: i32, + byte_index: i32, +} + +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -9288,7 +11190,7 @@ pub fn String::append_byte_filled(self: &mut String, byte: u8, n: i32) { self.used = new_used; } -pub fn String::append(self: &mut String, other: String) { +pub fn String::push_str(self: &mut String, other: String) { let other_len: i32 = other.String::len(); if (other_len == 0) { return; @@ -9301,6 +11203,10 @@ pub fn String::append(self: &mut String, other: String) { self.used = new_used; } +pub fn String::append(self: &mut String, other: String) { + self.String::push_str(other); +} + pub fn String::concat(a: String, b: String) -> String { let len_a: i32 = a.String::len(); let len_b: i32 = b.String::len(); @@ -9394,7 +11300,7 @@ pub fn "StrUtf8ByteIter^Iterator::collect"(self: &mut StrUtf8ByteIter) -> Array< let __pattern_temp_0: Option = self."StrUtf8ByteIter^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let item: u8 = __variant_payload(__pattern_temp_0, case=0); - result."Array::append"(item); + result."Array::push"(item); } else { break; } @@ -9582,7 +11488,7 @@ pub fn "StrCharIter^Iterator::collect"(self: &mut StrCharIter) -> Array { let __pattern_temp_0: Option = self."StrCharIter^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let item: char = __variant_payload(__pattern_temp_0, case=0); - result."Array::append"(item); + result."Array::push"(item); } else { break; } @@ -9739,7 +11645,7 @@ pub fn String::chars(self: &String) -> StrCharIter { return StrCharIter { repr: self.repr, used: self.used, byte_index: 0 }; } -pub fn String::append_char(self: &mut String, c: char) { +pub fn String::push(self: &mut String, c: char) { let code: u32 = c as u32; if core::builtin::unlikely(((self.used + 4) > core::builtin::array_len(self.repr))) { self.String::grow((self.used + 4)); @@ -9769,7 +11675,11 @@ pub fn String::append_char(self: &mut String, c: char) { } } -pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { +pub fn String::append_char(self: &mut String, c: char) { + self.String::push(c); +} + +pub fn String::truncate(self: &mut String, byte_len: i32) { if (byte_len >= self.used) { return; } @@ -9779,20 +11689,20 @@ pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(144); - __r.String::append("Assertion failed in "); - __r.String::append("String::truncate_bytes"); - __r.String::append(" at "); - __r.String::append("core:prelude/string.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::truncate"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); - Box { value: 355 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("negative length"); - __r.String::append("\ncondition: byte_len >= 0\n"); - __r.String::append("byte_len: "); + Box { value: 365 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("negative length"); + __r.String::push_str("\ncondition: byte_len >= 0\n"); + __r.String::push_str("byte_len: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -9808,32 +11718,32 @@ pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); - __r.String::append("Assertion failed in "); - __r.String::append("String::truncate_bytes"); - __r.String::append(" at "); - __r.String::append("core:prelude/string.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::truncate"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); - Box { value: 360 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("not on a UTF-8 character boundary"); - __r.String::append("\ncondition: b < 0x80 || b >= 0xC0\n"); - __r.String::append("b: "); + Box { value: 370 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b < 0x80: "); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b: "); + __r.String::push_str("\n"); + __r.String::push_str("b: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b >= 0xC0: "); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -9868,6 +11778,78 @@ pub fn String::truncate_chars(self: &mut String, char_count: i32) { self.used = byte_pos; } +pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { + self.String::truncate(byte_len); +} + +pub fn String::pop(self: &mut String) -> Option { + if (self.used == 0) { + return null; + } + let mut pos: i32 = (self.used - 1); + loop { + if !(pos > 0) { + break; + } + let b: u8 = core::builtin::array_get_u8(self.repr, pos); + if ((b >= 0x80) && (b < 0xC0)) { + pos = (pos - 1); + } else { + break; + } + } + let b0: u32 = core::builtin::array_get_u8(self.repr, pos) as u32; + let code: u32 = if (b0 < 0x80) { + b0; + } else { + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + (((b0 & 0x1F) << 6) | (b1 & 0x3F)); + } else { + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (pos + 2)) as u32; + ((((b0 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + } else { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (pos + 2)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (pos + 3)) as u32; + (((((b0 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + }; + }; + }; + self.used = pos; + return Option::Some("core::prelude/primitive.wado::char::from_u32_unchecked"(code)); +} + +pub fn String::clear(self: &mut String) { + self.used = 0; +} + +pub fn String::capacity(self: &String) -> i32 { + return core::builtin::array_len(self.repr); +} + +pub fn String::reserve(self: &mut String, additional: i32) { + let required: i32 = (self.used + additional); + if (required > core::builtin::array_len(self.repr)) { + self.String::grow(required); + } +} + +pub fn String::shrink_to_fit(self: &mut String) { + let capacity: i32 = core::builtin::array_len(self.repr); + if (capacity > self.used) { + let new_repr: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(self.used); + "core::prelude/string.wado::core/builtin/array_copy"(new_repr, 0, self.repr, 0, self.used); + self.repr = new_repr; + } +} + +pub fn String::as_bytes(self: &String) -> Array { + return self.String::bytes()."StrUtf8ByteIter^Iterator::collect"(); +} + pub fn String::trim_ascii_start(self: &String) -> String { let mut start: i32 = 0; loop { @@ -10006,21 +11988,1754 @@ fn String::internal_substr_bytes(self: &String, start: i32, end: i32) -> String return String { repr: repr, used: len }; } -pub fn "String^Default::default"() -> String { - return ""; +pub fn String::contains(self: &String, pat: String) -> bool { + return match self.String::find(pat) { + Some(_) => true, + _ => false, + }; +} + +pub fn String::starts_with(self: &String, pat: String) -> bool { + let pat_len: i32 = pat.String::len(); + if (pat_len > self.used) { + return false; + } + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + __for_3: { + let mut i: i32 = 0; + loop { + if !(i < pat_len) { + break __for_3; + } + __for_3_body: { + if (core::builtin::array_get_u8(self.repr, i) != core::builtin::array_get_u8(pat_repr, i)) { + return false; + } + } + i = (i + 1); + } + } + return true; +} + +pub fn String::ends_with(self: &String, pat: String) -> bool { + let pat_len: i32 = pat.String::len(); + if (pat_len > self.used) { + return false; + } + let offset: i32 = (self.used - pat_len); + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + __for_4: { + let mut i: i32 = 0; + loop { + if !(i < pat_len) { + break __for_4; + } + __for_4_body: { + if (core::builtin::array_get_u8(self.repr, (offset + i)) != core::builtin::array_get_u8(pat_repr, i)) { + return false; + } + } + i = (i + 1); + } + } + return true; +} + +pub fn String::find(self: &String, pat: String) -> Option { + let pat_len: i32 = pat.String::len(); + if (pat_len == 0) { + return Option::Some(0); + } + if (pat_len > self.used) { + return null; + } + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + let limit: i32 = (self.used - pat_len); + __for_5: { + let mut i: i32 = 0; + loop { + if !(i <= limit) { + break __for_5; + } + __for_5_body: { + let mut matched: bool = true; + __for_6: { + let mut j: i32 = 0; + loop { + if !(j < pat_len) { + break __for_6; + } + __for_6_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(pat_repr, j)) { + matched = false; + break __for_6; + } + } + j = (j + 1); + } + } + if matched { + return Option::Some(i); + } + } + i = (i + 1); + } + } + return null; +} + +pub fn String::rfind(self: &String, pat: String) -> Option { + let pat_len: i32 = pat.String::len(); + if (pat_len == 0) { + return Option::Some(self.used); + } + if (pat_len > self.used) { + return null; + } + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + let mut i: i32 = (self.used - pat_len); + loop { + let mut matched: bool = true; + __for_7: { + let mut j: i32 = 0; + loop { + if !(j < pat_len) { + break __for_7; + } + __for_7_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(pat_repr, j)) { + matched = false; + break __for_7; + } + } + j = (j + 1); + } + } + if matched { + return Option::Some(i); + } + if (i == 0) { + break; + } + i = (i - 1); + } + return null; +} + +pub fn String::contains_char(self: &String, ch: char) -> bool { + __for_of_2: { + let mut __iter_2: StrCharIter = self.String::chars()."StrCharIter^IntoIterator::into_iter"(); + loop { + let __pattern_temp_0: Option = __iter_2."StrCharIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let c: char = __variant_payload(__pattern_temp_0, case=0); + if (c == ch) { + return true; + } + } else { + break; + } + } + } + return false; +} + +pub fn String::find_char(self: &String, pred: fn(char) -> bool) -> Option { + let mut byte_index: i32 = 0; + let mut iter: StrCharIter = self.String::chars(); + loop { + let __pattern_temp_0: Option = iter."StrCharIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let c: char = __variant_payload(__pattern_temp_0, case=0); + if pred(c) { + return Option::Some(byte_index); + } + let code: u32 = c as u32; + if (code < 0x80) { + byte_index = (byte_index + 1); + } else { + if (code < 0x800) { + byte_index = (byte_index + 2); + } else { + if (code < 0x10000) { + byte_index = (byte_index + 3); + } else { + byte_index = (byte_index + 4); + } + } + } + } else { + break; + } + } + return null; +} + +pub fn String::insert(self: &mut String, byte_index: i32, ch: char) { + __assert_2: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index <= self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(308); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 726 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index <= self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index <= self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + if ((byte_index > 0) && (byte_index < self.used)) { + let b: u8 = core::builtin::array_get_u8(self.repr, byte_index); + __assert_3: { + let __v0: u8 = b; + let __v1: bool = (b < 0x80); + let __v2: u8 = b; + let __v3: bool = (b >= 0xC0); + let __cond: bool = (__v1 || __v3); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 729 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + } + let code: u32 = ch as u32; + let char_len: i32 = if (code < 0x80) { + 1; + } else { + if (code < 0x800) { + 2; + } else { + if (code < 0x10000) { + 3; + } else { + 4; + }; + }; + }; + let new_used: i32 = (self.used + char_len); + if (new_used > core::builtin::array_len(self.repr)) { + self.String::grow(new_used); + } + let mut i: i32 = (self.used - 1); + loop { + if !(i >= byte_index) { + break; + } + core::builtin::array_set_u8(self.repr, (i + char_len), core::builtin::array_get_u8(self.repr, i)); + if (i == 0) { + break; + } + i = (i - 1); + } + if (code < 0x80) { + core::builtin::array_set_u8(self.repr, byte_index, code as u8); + } else { + if (code < 0x800) { + core::builtin::array_set_u8(self.repr, byte_index, (0xC0 | (code >> 6)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | (code & 0x3F)) as u8); + } else { + if (code < 0x10000) { + core::builtin::array_set_u8(self.repr, byte_index, (0xE0 | (code >> 12)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | ((code >> 6) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 2), (0x80 | (code & 0x3F)) as u8); + } else { + core::builtin::array_set_u8(self.repr, byte_index, (0xF0 | (code >> 18)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | ((code >> 12) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 2), (0x80 | ((code >> 6) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 3), (0x80 | (code & 0x3F)) as u8); + } + } + } + self.used = new_used; +} + +pub fn String::insert_str(self: &mut String, byte_index: i32, s: String) { + let s_len: i32 = s.String::len(); + if (s_len == 0) { + return; + } + __assert_4: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index <= self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(308); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert_str"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 771 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index <= self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index <= self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + if ((byte_index > 0) && (byte_index < self.used)) { + let b: u8 = core::builtin::array_get_u8(self.repr, byte_index); + __assert_5: { + let __v0: u8 = b; + let __v1: bool = (b < 0x80); + let __v2: u8 = b; + let __v3: bool = (b >= 0xC0); + let __cond: bool = (__v1 || __v3); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert_str"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 774 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + } + let new_used: i32 = (self.used + s_len); + if (new_used > core::builtin::array_len(self.repr)) { + self.String::grow(new_used); + } + let mut i: i32 = (self.used - 1); + loop { + if !(i >= byte_index) { + break; + } + core::builtin::array_set_u8(self.repr, (i + s_len), core::builtin::array_get_u8(self.repr, i)); + if (i == 0) { + break; + } + i = (i - 1); + } + "core::prelude/string.wado::core/builtin/array_copy"(self.repr, byte_index, s.String::internal_raw_bytes(), 0, s_len); + self.used = new_used; +} + +pub fn String::remove(self: &mut String, byte_index: i32) -> char { + __assert_6: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index < self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(306); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::remove"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 795 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index < self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index < self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + let b0: u32 = core::builtin::array_get_u8(self.repr, byte_index) as u32; + let char_len: i32 = if (b0 < 0x80) { + 1; + } else { + if (b0 < 0xE0) { + 2; + } else { + if (b0 < 0xF0) { + 3; + } else { + 4; + }; + }; + }; + let code: u32 = if (b0 < 0x80) { + b0; + } else { + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + (((b0 & 0x1F) << 6) | (b1 & 0x3F)); + } else { + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 2)) as u32; + ((((b0 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + } else { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 2)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 3)) as u32; + (((((b0 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + }; + }; + }; + let src: i32 = (byte_index + char_len); + __for_8: { + let mut i: i32 = src; + loop { + if !(i < self.used) { + break __for_8; + } + __for_8_body: { + core::builtin::array_set_u8(self.repr, (i - char_len), core::builtin::array_get_u8(self.repr, i)); + } + i = (i + 1); + } + } + self.used = (self.used - char_len); + return "core::prelude/primitive.wado::char::from_u32_unchecked"(code); +} + +pub fn String::repeat(self: &String, n: i32) -> String { + if ((n <= 0) || (self.used == 0)) { + return "core::prelude/string.wado::String::with_capacity"(0); + } + let total: i32 = (self.used * n); + let repr: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(total); + __for_9: { + let mut r: i32 = 0; + loop { + if !(r < n) { + break __for_9; + } + __for_9_body: { + "core::prelude/string.wado::core/builtin/array_copy"(repr, (r * self.used), self.repr, 0, self.used); + } + r = (r + 1); + } + } + return String { repr: repr, used: total }; +} + +pub fn String::replace(self: &String, from: String, to: String) -> String { + return self.String::replacen(from, to, -1); +} + +pub fn String::replacen(self: &String, from: String, to: String, count: i32) -> String { + let from_len: i32 = from.String::len(); + if (from_len == 0) { + return *self; + } + let to_len: i32 = to.String::len(); + let from_repr: builtin::array = from.String::internal_raw_bytes(); + let to_repr: builtin::array = to.String::internal_raw_bytes(); + let mut result: String = "core::prelude/string.wado::String::with_capacity"(self.used); + let mut pos: i32 = 0; + let mut replacements: i32 = 0; + let limit: i32 = (self.used - from_len); + loop { + if !(pos <= limit) { + break; + } + if ((count >= 0) && (replacements >= count)) { + break; + } + let mut matched: bool = true; + __for_10: { + let mut j: i32 = 0; + loop { + if !(j < from_len) { + break __for_10; + } + __for_10_body: { + if (core::builtin::array_get_u8(self.repr, (pos + j)) != core::builtin::array_get_u8(from_repr, j)) { + matched = false; + break __for_10; + } + } + j = (j + 1); + } + } + if matched { + if (to_len > 0) { + let new_used: i32 = (result.used + to_len); + if (new_used > core::builtin::array_len(result.repr)) { + result.String::grow(new_used); + } + "core::prelude/string.wado::core/builtin/array_copy"(result.repr, result.used, to_repr, 0, to_len); + result.used = new_used; + } + pos = (pos + from_len); + replacements = (replacements + 1); + } else { + if (result.used >= core::builtin::array_len(result.repr)) { + result.String::grow((result.used + 1)); + } + core::builtin::array_set_u8(result.repr, result.used, core::builtin::array_get_u8(self.repr, pos)); + result.used = (result.used + 1); + pos = (pos + 1); + } + } + loop { + if !(pos < self.used) { + break; + } + if (result.used >= core::builtin::array_len(result.repr)) { + result.String::grow((result.used + 1)); + } + core::builtin::array_set_u8(result.repr, result.used, core::builtin::array_get_u8(self.repr, pos)); + result.used = (result.used + 1); + pos = (pos + 1); + } + return result; +} + +pub fn "String^Default::default"() -> String { + return ""; } pub fn "String^From::from"(value: char) -> String { let mut s: String = "core::prelude/string.wado::String::with_capacity"(4); - s.String::append_char(value); + s.String::push(value); return s; } -pub fn "StrUtf8ByteIter^Eq::eq"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> bool { - return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.index }."i32^Eq::eq"(Box { value: other.index })); +pub fn "StrSplitIter^Iterator::next"(self: &mut StrSplitIter) -> Option { + if self.finished { + return null; + } + let limit: i32 = (self.used - self.sep_len); + let mut i: i32 = self.pos; + loop { + if !(i <= limit) { + break; + } + let mut matched: bool = true; + __for_11: { + let mut j: i32 = 0; + loop { + if !(j < self.sep_len) { + break __for_11; + } + __for_11_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(self.sep_repr, j)) { + matched = false; + break __for_11; + } + } + j = (j + 1); + } + } + if matched { + let len: i32 = (i - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.pos = (i + self.sep_len); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + i = (i + 1); + } + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitIter^Iterator::collect"(self: &mut StrSplitIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitIter^Iterator::count"(self: &mut StrSplitIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitIter^Iterator::find"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::any"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitIter^Iterator::all"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitIter^Iterator::last"(self: &mut StrSplitIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitIter^Iterator::nth"(self: &mut StrSplitIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::position"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::reduce"(self: &mut StrSplitIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitIter^Iterator::filter"(self: &StrSplitIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitIter^Iterator::enumerate"(self: &StrSplitIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitIter^Iterator::take"(self: &StrSplitIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitIter^Iterator::skip"(self: &StrSplitIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrSplitNIter^Iterator::next"(self: &mut StrSplitNIter) -> Option { + if self.finished { + return null; + } + if (self.remaining <= 1) { + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + let limit: i32 = (self.used - self.sep_len); + let mut i: i32 = self.pos; + loop { + if !(i <= limit) { + break; + } + let mut matched: bool = true; + __for_12: { + let mut j: i32 = 0; + loop { + if !(j < self.sep_len) { + break __for_12; + } + __for_12_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(self.sep_repr, j)) { + matched = false; + break __for_12; + } + } + j = (j + 1); + } + } + if matched { + let len: i32 = (i - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.pos = (i + self.sep_len); + self.remaining = (self.remaining - 1); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + i = (i + 1); + } + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitNIter^Iterator::collect"(self: &mut StrSplitNIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitNIter^Iterator::count"(self: &mut StrSplitNIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitNIter^Iterator::find"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::any"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitNIter^Iterator::all"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitNIter^Iterator::last"(self: &mut StrSplitNIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitNIter^Iterator::nth"(self: &mut StrSplitNIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::position"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::reduce"(self: &mut StrSplitNIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitNIter^Iterator::filter"(self: &StrSplitNIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitNIter^Iterator::enumerate"(self: &StrSplitNIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitNIter^Iterator::take"(self: &StrSplitNIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitNIter^Iterator::skip"(self: &StrSplitNIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +fn is_ascii_whitespace_byte(b: u8) -> bool { + return (((((b == 0x20) || (b == 0x09)) || (b == 0x0A)) || (b == 0x0D)) || (b == 0x0C)); +} + +pub fn "StrSplitWhitespaceIter^Iterator::next"(self: &mut StrSplitWhitespaceIter) -> Option { + loop { + if !((self.pos < self.used) && "core::prelude/string.wado::is_ascii_whitespace_byte"(core::builtin::array_get_u8(self.repr, self.pos))) { + break; + } + self.pos = (self.pos + 1); + } + if (self.pos >= self.used) { + return null; + } + let start: i32 = self.pos; + loop { + if !((self.pos < self.used) && !"core::prelude/string.wado::is_ascii_whitespace_byte"(core::builtin::array_get_u8(self.repr, self.pos))) { + break; + } + self.pos = (self.pos + 1); + } + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitWhitespaceIter^Iterator::collect"(self: &mut StrSplitWhitespaceIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitWhitespaceIter^Iterator::count"(self: &mut StrSplitWhitespaceIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitWhitespaceIter^Iterator::find"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::any"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitWhitespaceIter^Iterator::all"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitWhitespaceIter^Iterator::last"(self: &mut StrSplitWhitespaceIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitWhitespaceIter^Iterator::nth"(self: &mut StrSplitWhitespaceIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::position"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::reduce"(self: &mut StrSplitWhitespaceIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::filter"(self: &StrSplitWhitespaceIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::enumerate"(self: &StrSplitWhitespaceIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::take"(self: &StrSplitWhitespaceIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::skip"(self: &StrSplitWhitespaceIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrLinesIter^Iterator::next"(self: &mut StrLinesIter) -> Option { + if self.finished { + return null; + } + if (self.pos >= self.used) { + self.finished = true; + return null; + } + let start: i32 = self.pos; + loop { + if !(self.pos < self.used) { + break; + } + let b: u8 = core::builtin::array_get_u8(self.repr, self.pos); + if (b == 0x0A) { + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.pos = (self.pos + 1); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + if (b == 0x0D) { + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.pos = (self.pos + 1); + if ((self.pos < self.used) && (core::builtin::array_get_u8(self.repr, self.pos) == 0x0A)) { + self.pos = (self.pos + 1); + } + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + self.pos = (self.pos + 1); + } + let len: i32 = (self.pos - start); + if (len > 0) { + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + self.finished = true; + return null; +} + +pub fn "StrLinesIter^Iterator::collect"(self: &mut StrLinesIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrLinesIter^Iterator::count"(self: &mut StrLinesIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrLinesIter^Iterator::find"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::any"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrLinesIter^Iterator::all"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrLinesIter^Iterator::last"(self: &mut StrLinesIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrLinesIter^Iterator::nth"(self: &mut StrLinesIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::position"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::reduce"(self: &mut StrLinesIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrLinesIter^Iterator::filter"(self: &StrLinesIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrLinesIter^Iterator::enumerate"(self: &StrLinesIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrLinesIter^Iterator::take"(self: &StrLinesIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrLinesIter^Iterator::skip"(self: &StrLinesIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrCharIndicesIter^Iterator::next"(self: &mut StrCharIndicesIter) -> Option<[i32, char]> { + if (self.byte_index >= self.used) { + return null; + } + let idx: i32 = self.byte_index; + let b0: u8 = core::builtin::array_get_u8(self.repr, self.byte_index); + self.byte_index = (self.byte_index + 1); + if (b0 < 0x80) { + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(b0 as u32)]); + } + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + self.byte_index = (self.byte_index + 1); + let code: u32 = (((b0 as u32 & 0x1F) << 6) | (b1 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); + } + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 1)) as u32; + self.byte_index = (self.byte_index + 2); + let code: u32 = ((((b0 as u32 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); + } + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 1)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 2)) as u32; + self.byte_index = (self.byte_index + 3); + let code: u32 = (((((b0 as u32 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); +} + +pub fn "StrCharIndicesIter^Iterator::collect"(self: &mut StrCharIndicesIter) -> Array<[i32, char]> { + let mut result: Array<[i32, char]> = __seq_lit: { + let mut __b: Array<[i32, char]> = "core::prelude/string.wado::Array>^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array>^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + result."Array>::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrCharIndicesIter^Iterator::count"(self: &mut StrCharIndicesIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrCharIndicesIter^Iterator::find"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> Option<[i32, char]> { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option<[i32, char]>::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::any"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> bool { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrCharIndicesIter^Iterator::all"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> bool { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrCharIndicesIter^Iterator::last"(self: &mut StrCharIndicesIter) -> Option<[i32, char]> { + let mut result: Option<[i32, char]> = null; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + result = Option<[i32, char]>::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrCharIndicesIter^Iterator::nth"(self: &mut StrCharIndicesIter, n: i32) -> Option<[i32, char]> { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option<[i32, char]>::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::position"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::reduce"(self: &mut StrCharIndicesIter, f: fn([i32, char], [i32, char]) -> [i32, char]) -> Option<[i32, char]> { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + let mut acc: [i32, char] = first; + loop { + let __pattern_temp_1: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option<[i32, char]>::Some(acc); + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::filter"(self: &StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrCharIndicesIter^Iterator::enumerate"(self: &StrCharIndicesIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrCharIndicesIter^Iterator::take"(self: &StrCharIndicesIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrCharIndicesIter^Iterator::skip"(self: &StrCharIndicesIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn String::split(self: &String, sep: String) -> StrSplitIter { + return StrSplitIter { repr: self.repr, used: self.used, pos: 0, sep_repr: sep.String::internal_raw_bytes(), sep_len: sep.String::len(), finished: false }; +} + +pub fn String::splitn(self: &String, n: i32, sep: String) -> StrSplitNIter { + return StrSplitNIter { repr: self.repr, used: self.used, pos: 0, sep_repr: sep.String::internal_raw_bytes(), sep_len: sep.String::len(), remaining: n, finished: (n <= 0) }; +} + +pub fn String::split_whitespace(self: &String) -> StrSplitWhitespaceIter { + return StrSplitWhitespaceIter { repr: self.repr, used: self.used, pos: 0 }; +} + +pub fn String::lines(self: &String) -> StrLinesIter { + return StrLinesIter { repr: self.repr, used: self.used, pos: 0, finished: false }; +} + +pub fn String::char_indices(self: &String) -> StrCharIndicesIter { + return StrCharIndicesIter { repr: self.repr, used: self.used, byte_index: 0 }; +} + +pub fn "StrUtf8ByteIter^Eq::eq"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.index }."i32^Eq::eq"(Box { value: other.index })); +} + +pub fn "StrUtf8ByteIter^Ord::cmp"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.index }."i32^Ord::cmp"(Box { value: other.index }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrCharIter^Eq::eq"(self: &StrCharIter, other: &StrCharIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.byte_index }."i32^Eq::eq"(Box { value: other.byte_index })); +} + +pub fn "StrCharIter^Ord::cmp"(self: &StrCharIter, other: &StrCharIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.byte_index }."i32^Ord::cmp"(Box { value: other.byte_index }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitIter^Eq::eq"(self: &StrSplitIter, other: &StrSplitIter) -> bool { + return (((((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && self.sep_repr."builtin::array^Eq::eq"(&other.sep_repr)) && Box { value: self.sep_len }."i32^Eq::eq"(Box { value: other.sep_len })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrSplitIter^Ord::cmp"(self: &StrSplitIter, other: &StrSplitIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = self.sep_repr."builtin::array^Ord::cmp"(&other.sep_repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.sep_len }."i32^Ord::cmp"(Box { value: other.sep_len }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitNIter^Eq::eq"(self: &StrSplitNIter, other: &StrSplitNIter) -> bool { + return ((((((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && self.sep_repr."builtin::array^Eq::eq"(&other.sep_repr)) && Box { value: self.sep_len }."i32^Eq::eq"(Box { value: other.sep_len })) && Box { value: self.remaining }."i32^Eq::eq"(Box { value: other.remaining })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrSplitNIter^Ord::cmp"(self: &StrSplitNIter, other: &StrSplitNIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = self.sep_repr."builtin::array^Ord::cmp"(&other.sep_repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.sep_len }."i32^Ord::cmp"(Box { value: other.sep_len }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.remaining }."i32^Ord::cmp"(Box { value: other.remaining }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitWhitespaceIter^Eq::eq"(self: &StrSplitWhitespaceIter, other: &StrSplitWhitespaceIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })); } -pub fn "StrUtf8ByteIter^Ord::cmp"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> Ordering { +pub fn "StrSplitWhitespaceIter^Ord::cmp"(self: &StrSplitWhitespaceIter, other: &StrSplitWhitespaceIter) -> Ordering { let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); if (c != Ordering::Equal) { return c; @@ -10029,18 +13744,42 @@ pub fn "StrUtf8ByteIter^Ord::cmp"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIte if (c != Ordering::Equal) { return c; } - let c: Ordering = Box { value: self.index }."i32^Ord::cmp"(Box { value: other.index }); + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); if (c != Ordering::Equal) { return c; } return Ordering::Equal; } -pub fn "StrCharIter^Eq::eq"(self: &StrCharIter, other: &StrCharIter) -> bool { +pub fn "StrLinesIter^Eq::eq"(self: &StrLinesIter, other: &StrLinesIter) -> bool { + return (((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrLinesIter^Ord::cmp"(self: &StrLinesIter, other: &StrLinesIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrCharIndicesIter^Eq::eq"(self: &StrCharIndicesIter, other: &StrCharIndicesIter) -> bool { return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.byte_index }."i32^Eq::eq"(Box { value: other.byte_index })); } -pub fn "StrCharIter^Ord::cmp"(self: &StrCharIter, other: &StrCharIter) -> Ordering { +pub fn "StrCharIndicesIter^Ord::cmp"(self: &StrCharIndicesIter, other: &StrCharIndicesIter) -> Ordering { let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); if (c != Ordering::Equal) { return c; @@ -10082,6 +13821,95 @@ pub fn "StrCharIter^Inspect::inspect"(self: &StrCharIter, f: &mut Formatter) { f.Formatter::write_str(" }"); } +pub fn "StrSplitIter^Inspect::inspect"(self: &StrSplitIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrSplitNIter^Inspect::inspect"(self: &StrSplitNIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitNIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("remaining: "); + Box { value: self.remaining }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrSplitWhitespaceIter^Inspect::inspect"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitWhitespaceIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrLinesIter^Inspect::inspect"(self: &StrLinesIter, f: &mut Formatter) { + f.Formatter::write_str("StrLinesIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrCharIndicesIter^Inspect::inspect"(self: &StrCharIndicesIter, f: &mut Formatter) { + f.Formatter::write_str("StrCharIndicesIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("byte_index: "); + Box { value: self.byte_index }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(I::Item) -> bool, f: &mut Formatter) { f.Formatter::write_str("|I::Item| -> bool"); } @@ -10114,6 +13942,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -10134,6 +13970,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -10192,6 +14044,123 @@ pub fn "StrCharIter^InspectAlt::inspect_alt"(self: &StrCharIter, f: &mut Formatt f.Formatter::close_brace("}"); } +pub fn "StrSplitIter^InspectAlt::inspect_alt"(self: &StrSplitIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrSplitNIter^InspectAlt::inspect_alt"(self: &StrSplitNIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitNIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("remaining: "); + Box { value: self.remaining }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrSplitWhitespaceIter^InspectAlt::inspect_alt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitWhitespaceIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrLinesIter^InspectAlt::inspect_alt"(self: &StrLinesIter, f: &mut Formatter) { + f.Formatter::open_brace("StrLinesIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrCharIndicesIter^InspectAlt::inspect_alt"(self: &StrCharIndicesIter, f: &mut Formatter) { + f.Formatter::open_brace("StrCharIndicesIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("byte_index: "); + Box { value: self.byte_index }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10224,6 +14193,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10244,6 +14221,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -10276,6 +14269,26 @@ pub fn "StrCharIter^Display::fmt"(self: &StrCharIter, f: &mut Formatter) { self."StrCharIter^Inspect::inspect"(f); } +pub fn "StrSplitIter^Display::fmt"(self: &StrSplitIter, f: &mut Formatter) { + self."StrSplitIter^Inspect::inspect"(f); +} + +pub fn "StrSplitNIter^Display::fmt"(self: &StrSplitNIter, f: &mut Formatter) { + self."StrSplitNIter^Inspect::inspect"(f); +} + +pub fn "StrSplitWhitespaceIter^Display::fmt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + self."StrSplitWhitespaceIter^Inspect::inspect"(f); +} + +pub fn "StrLinesIter^Display::fmt"(self: &StrLinesIter, f: &mut Formatter) { + self."StrLinesIter^Inspect::inspect"(f); +} + +pub fn "StrCharIndicesIter^Display::fmt"(self: &StrCharIndicesIter, f: &mut Formatter) { + self."StrCharIndicesIter^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10308,6 +14321,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10328,6 +14349,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -10360,6 +14397,26 @@ pub fn "StrCharIter^DisplayAlt::fmt_alt"(self: &StrCharIter, f: &mut Formatter) self."StrCharIter^InspectAlt::inspect_alt"(f); } +pub fn "StrSplitIter^DisplayAlt::fmt_alt"(self: &StrSplitIter, f: &mut Formatter) { + self."StrSplitIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrSplitNIter^DisplayAlt::fmt_alt"(self: &StrSplitNIter, f: &mut Formatter) { + self."StrSplitNIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrSplitWhitespaceIter^DisplayAlt::fmt_alt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + self."StrSplitWhitespaceIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrLinesIter^DisplayAlt::fmt_alt"(self: &StrLinesIter, f: &mut Formatter) { + self."StrLinesIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrCharIndicesIter^DisplayAlt::fmt_alt"(self: &StrCharIndicesIter, f: &mut Formatter) { + self."StrCharIndicesIter^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -10392,6 +14449,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -10404,12 +14469,28 @@ pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(char) -> bool, f: &mut Formatt self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<2,char>^DisplayAlt::fmt_alt"(self: &fn(char, char) -> char, f: &mut Formatter) { - self."Fn<2,char>^InspectAlt::inspect_alt"(f); +pub fn "Fn<2,char>^DisplayAlt::fmt_alt"(self: &fn(char, char) -> char, f: &mut Formatter) { + self."Fn<2,char>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^InspectAlt::inspect_alt"(f); +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); } pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { @@ -10436,6 +14517,94 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); } +pub fn "Array>::push"(self: &mut Array<[i32, char]>, value: [i32, char]) with stores[value] { + let used: i32 = self.used; + if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { + self."Array>::grow"(); + } + core::builtin::array_set::<[i32, char]>(self.repr, used, value); + self.used = (used + 1); +} + +pub fn "Array>::grow"(self: &mut Array<[i32, char]>) { + let capacity: i32 = core::builtin::array_len(self.repr); + let new_capacity: i32 = "core::prelude/array.wado::i32_max"((capacity * 2), 4); + let new_repr: builtin::array<[i32, char]> = core::builtin::array_new::<[i32, char]>(new_capacity); + let old_repr: builtin::array<[i32, char]> = self.repr; + let used: i32 = self.used; + __for_0: { + let mut i: i32 = 0; + loop { + if !(i < used) { + break __for_0; + } + __for_0_body: { + core::builtin::array_set::<[i32, char]>(new_repr, i, core::builtin::array_get::<[i32, char]>(old_repr, i)); + } + i = (i + 1); + } + } + self.repr = new_repr; +} + +fn "Array>^SequenceLiteralBuilder::build"(self: &Array<[i32, char]>) -> Array<[i32, char]> { + return *self; +} + +fn "Array>^SequenceLiteralBuilder::new_literal"(capacity: i32) -> Array<[i32, char]> { + return "core::prelude/string.wado::Array>::with_capacity"(capacity); +} + +pub fn "Array>::with_capacity"(capacity: i32) -> Array<[i32, char]> { + return Array> { repr: core::builtin::array_new::<[i32, char]>(capacity), used: 0 }; +} + +pub fn "Array::push"(self: &mut Array, value: String) with stores[value] { + let used: i32 = self.used; + if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { + self."Array::grow"(); + } + core::builtin::array_set::(self.repr, used, value); + self.used = (used + 1); +} + +pub fn "Array::grow"(self: &mut Array) { + let capacity: i32 = core::builtin::array_len(self.repr); + let new_capacity: i32 = "core::prelude/array.wado::i32_max"((capacity * 2), 4); + let new_repr: builtin::array = core::builtin::array_new::(new_capacity); + let old_repr: builtin::array = self.repr; + let used: i32 = self.used; + __for_0: { + let mut i: i32 = 0; + loop { + if !(i < used) { + break __for_0; + } + __for_0_body: { + core::builtin::array_set::(new_repr, i, core::builtin::array_get::(old_repr, i)); + } + i = (i + 1); + } + } + self.repr = new_repr; +} + +fn "Array^SequenceLiteralBuilder::build"(self: &Array) -> Array { + return *self; +} + +fn "Array^SequenceLiteralBuilder::new_literal"(capacity: i32) -> Array { + return "core::prelude/string.wado::Array::with_capacity"(capacity); +} + +pub fn "Array::with_capacity"(capacity: i32) -> Array { + return Array { repr: core::builtin::array_new::(capacity), used: 0 }; +} + +fn "StrCharIter^IntoIterator::into_iter"(self: &StrCharIter) -> StrCharIter { + return *self; +} + pub fn "StrCharIter^Iterator::map"(self: &StrCharIter, f: fn(char) -> char) -> IterMap { return IterMap { inner: *self, f: f }; } @@ -10448,7 +14617,7 @@ pub fn "String::from_iter>"(iter: IterMap = __iter_2."IterMap^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let c: char = __variant_payload(__pattern_temp_0, case=0); - s.String::append_char(c); + s.String::push(c); } else { break; } @@ -10470,7 +14639,7 @@ fn "IterMap^IntoIterator::into_iter"(self: &IterMap::append"(self: &mut Array, value: char) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: char) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -10512,7 +14681,7 @@ pub fn "Array::with_capacity"(capacity: i32) -> Array { return Array { repr: core::builtin::array_new::(capacity), used: 0 }; } -pub fn "Array::append"(self: &mut Array, value: u8) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: u8) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -10571,6 +14740,106 @@ fn __Closure_1::__call(self: &__Closure_1, c: char) -> char { } // --- Module: core:prelude/tuple.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -10648,6 +14917,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -10668,6 +14945,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -10724,6 +15017,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10744,6 +15045,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -10800,6 +15117,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10820,6 +15145,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -10876,6 +15217,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -10896,35 +15245,151 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { - self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { + self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: core:prelude/types.wado --- +pub struct WaitEvent { + pub code: i32, + pub handle: Waitable, + pub payload: u32, +} + +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -// --- Module: core:prelude/types.wado --- -pub struct WaitEvent { - pub code: i32, - pub handle: Waitable, - pub payload: u32, +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } pub struct "IterMap" { @@ -11041,6 +15506,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -11061,6 +15534,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -11134,6 +15623,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11154,6 +15651,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -11214,6 +15727,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11234,6 +15755,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -11294,6 +15831,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -11314,6 +15859,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -11339,6 +15900,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: wasi:cli --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -11416,6 +16077,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -11436,6 +16105,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -11492,6 +16177,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11512,6 +16205,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -11568,6 +16277,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11588,6 +16305,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -11644,6 +16377,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -11652,43 +16393,159 @@ pub fn "Fn<2,u8>^DisplayAlt::fmt_alt"(self: &fn(u8, u8) -> u8, f: &mut Formatter self."Fn<2,u8>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(char) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(char) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,char>^DisplayAlt::fmt_alt"(self: &fn(char, char) -> char, f: &mut Formatter) { + self."Fn<2,char>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { + self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { + self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: wasi:cli/environment.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<2,char>^DisplayAlt::fmt_alt"(self: &fn(char, char) -> char, f: &mut Formatter) { - self."Fn<2,char>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, } -pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, } -pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { - self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, } -pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { - self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } -// --- Module: wasi:cli/environment.wado --- pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -11766,6 +16623,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -11786,6 +16651,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -11842,6 +16723,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11862,6 +16751,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -11918,6 +16823,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11938,6 +16851,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -11994,6 +16923,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -12014,6 +16951,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -12039,6 +16992,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: wasi:cli/exit.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -12116,6 +17169,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -12136,6 +17197,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -12192,6 +17269,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12212,6 +17297,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -12268,6 +17369,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12288,6 +17397,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -12344,6 +17469,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -12364,31 +17497,147 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { - self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { + self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { + self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: wasi:cli/run.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, } -pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { - self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } -// --- Module: wasi:cli/run.wado --- pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -12466,6 +17715,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -12486,6 +17743,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -12542,6 +17815,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12562,6 +17843,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -12618,6 +17915,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12638,6 +17943,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -12694,6 +18015,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -12714,6 +18043,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -12739,6 +18084,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: wasi:cli/stderr.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -12816,6 +18261,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -12836,6 +18289,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -12892,6 +18361,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12912,6 +18389,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -12968,6 +18461,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12988,6 +18489,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -13044,6 +18561,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -13052,43 +18577,159 @@ pub fn "Fn<2,u8>^DisplayAlt::fmt_alt"(self: &fn(u8, u8) -> u8, f: &mut Formatter self."Fn<2,u8>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(char) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(char) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,char>^DisplayAlt::fmt_alt"(self: &fn(char, char) -> char, f: &mut Formatter) { + self."Fn<2,char>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { + self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { + self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: wasi:cli/stdin.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<2,char>^DisplayAlt::fmt_alt"(self: &fn(char, char) -> char, f: &mut Formatter) { - self."Fn<2,char>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, } -pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, } -pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { - self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, } -pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { - self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } -// --- Module: wasi:cli/stdin.wado --- pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -13166,6 +18807,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -13186,6 +18835,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -13242,6 +18907,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -13262,6 +18935,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -13318,6 +19007,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -13338,6 +19035,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -13394,6 +19107,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -13414,6 +19135,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -13439,6 +19176,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: wasi:cli/stdout.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -13516,6 +19353,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -13536,6 +19381,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -13592,6 +19453,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -13612,6 +19481,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -13668,6 +19553,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -13688,6 +19581,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -13744,6 +19653,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -13764,31 +19681,147 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { - self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { + self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { + self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: wasi:cli/terminal-input.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, } -pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { - self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } -// --- Module: wasi:cli/terminal-input.wado --- pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -13866,6 +19899,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -13886,6 +19927,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -13942,6 +19999,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -13962,6 +20027,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -14018,6 +20099,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -14038,6 +20127,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -14094,6 +20199,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -14114,6 +20227,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -14139,6 +20268,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: wasi:cli/terminal-output.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -14216,6 +20445,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -14236,6 +20473,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -14292,6 +20545,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -14312,6 +20573,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -14368,6 +20645,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -14388,6 +20673,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -14444,51 +20745,175 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<2,u8>^DisplayAlt::fmt_alt"(self: &fn(u8, u8) -> u8, f: &mut Formatter) { - self."Fn<2,u8>^InspectAlt::inspect_alt"(f); +pub fn "Fn<2,u8>^DisplayAlt::fmt_alt"(self: &fn(u8, u8) -> u8, f: &mut Formatter) { + self."Fn<2,u8>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(char) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,char>^DisplayAlt::fmt_alt"(self: &fn(char, char) -> char, f: &mut Formatter) { + self."Fn<2,char>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { + self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { + self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: wasi:cli/terminal-stderr.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(char) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<2,char>^DisplayAlt::fmt_alt"(self: &fn(char, char) -> char, f: &mut Formatter) { - self."Fn<2,char>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, } -pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, } -pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { - self."Fn<1,i32>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, } -pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { - self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, I::Item], [i32, I::Item]) -> [i32, I::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, } -pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f: &mut Formatter) { - self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } -// --- Module: wasi:cli/terminal-stderr.wado --- pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -14566,6 +20991,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -14586,6 +21019,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -14642,6 +21091,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -14662,6 +21119,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -14718,6 +21191,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -14738,6 +21219,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -14794,6 +21291,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -14814,6 +21319,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -14839,6 +21360,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: wasi:cli/terminal-stdin.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -14916,6 +21537,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -14936,6 +21565,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -14992,6 +21637,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -15012,6 +21665,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -15068,6 +21737,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -15088,6 +21765,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -15144,6 +21837,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -15164,6 +21865,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -15184,11 +21901,111 @@ pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item]) -> bool, f self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } -pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { - self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J::Item], [I::Item, J::Item]) -> [I::Item, J::Item], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + +// --- Module: wasi:cli/terminal-stdout.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, } -// --- Module: wasi:cli/terminal-stdout.wado --- pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -15266,6 +22083,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -15286,6 +22111,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -15342,6 +22183,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -15362,6 +22211,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -15418,6 +22283,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -15438,6 +22311,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -15494,6 +22383,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -15514,6 +22411,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -15539,6 +22452,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: wasi:cli/types.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -15652,6 +22665,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -15672,6 +22693,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -15732,6 +22769,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -15752,6 +22797,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -15812,6 +22873,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -15832,6 +22901,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -15892,6 +22977,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -15912,6 +23005,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -15957,6 +23066,106 @@ struct Logger { prefix: String, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -16114,12 +23323,12 @@ fn add(a: i32, b: i32) -> i32 { } fn multiline_expr_stmt(buf: String, upper: bool) { - buf.String::append(if upper { + buf.String::push_str(if upper { "E"; } else { "e"; }); - buf.String::append("0"); + buf.String::push_str("0"); } fn multiline_return_stmt(x: i32) -> i32 { @@ -16136,18 +23345,18 @@ fn multiline_assert_stmt(items: Array) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(131); - __r.String::append("Assertion failed in "); - __r.String::append("multiline_assert_stmt"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("multiline_assert_stmt"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 216 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: items.len() > 0\n"); - __r.String::append("items.len(): "); + __r.String::push_str("\ncondition: items.len() > 0\n"); + __r.String::push_str("items.len(): "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -16392,6 +23601,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -16412,6 +23629,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -16542,6 +23775,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -16558,8 +23799,24 @@ pub fn "Fn<2,char>^InspectAlt::inspect_alt"(self: &fn(char, char) -> char, f: &m self."Fn<2,char>^Inspect::inspect"(f); } -pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^Inspect::inspect"(f); +pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); } pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { @@ -16646,6 +23903,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -16666,6 +23931,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -16750,6 +24031,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -16770,6 +24059,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -16816,7 +24121,7 @@ fn __cm_binding__Environment_get_environment() -> Array<[String, String]> { let __elem_addr: i32 = (__base + (__i * 16)); let __lifted_result_6: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4))); let __lifted_result_7: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4))); - __result."Array>::append"([__lifted_result_6, __lifted_result_7]); + __result."Array>::push"([__lifted_result_6, __lifted_result_7]); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4)), 1, 0); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4)), 1, 0); __i = (__i + 1); @@ -16840,7 +24145,7 @@ fn __cm_binding__Environment_get_arguments() -> Array { break; } let __elem_addr: i32 = (__base + (__i * 8)); - __result."Array::append"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); + __result."Array::push"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); core::builtin::realloc(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)), 1, 0); __i = (__i + 1); } @@ -16882,7 +24187,7 @@ export fn __cm_export__run() { cm_raw_call task-return(0); } -pub fn "Array::append"(self: &mut Array, value: String) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: String) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -16916,7 +24221,7 @@ pub fn "Array::with_capacity"(capacity: i32) -> Array { return Array { repr: core::builtin::array_new::(capacity), used: 0 }; } -pub fn "Array>::append"(self: &mut Array<[String, String]>, value: [String, String]) with stores[value] { +pub fn "Array>::push"(self: &mut Array<[String, String]>, value: [String, String]) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array>::grow"(); @@ -17019,6 +24324,106 @@ pub struct ConvertError { pub message: String, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -17155,6 +24560,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -17175,6 +24588,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -17244,6 +24673,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -17264,6 +24701,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -17328,6 +24781,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -17348,6 +24809,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -17412,6 +24889,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -17432,6 +24917,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } @@ -17468,6 +24969,106 @@ pub struct Formatter { pub buf: &mut String, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -17524,11 +25125,11 @@ pub fn Formatter::new(buf: &mut String) -> Formatter with stores[buf] { } pub fn Formatter::write_str(self: &mut Formatter, s: String) { - self.buf.String::append(s); + self.buf.String::push_str(s); } pub fn Formatter::write_char(self: &mut Formatter, c: char) { - self.buf.String::append_char(c); + self.buf.String::push(c); } pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { @@ -17539,7 +25140,7 @@ pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { break __for_0; } __for_0_body: { - self.buf.String::append_char(c); + self.buf.String::push(c); } i = (i + 1); } @@ -17549,7 +25150,7 @@ pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { pub fn Formatter::pad(self: &mut Formatter, content: String) { let content_len: i32 = content.String::len(); if ((self.width <= 0) || (content_len >= self.width)) { - self.buf.String::append(content); + self.buf.String::push_str(content); return; } let padding: i32 = (self.width - content_len); @@ -17558,7 +25159,7 @@ pub fn Formatter::pad(self: &mut Formatter, content: String) { Left => true, _ => false, } { - self.buf.String::append(content); + self.buf.String::push_str(content); self.Formatter::write_char_n(self.fill, padding); } else { if match align { @@ -17568,11 +25169,11 @@ pub fn Formatter::pad(self: &mut Formatter, content: String) { let left_pad: i32 = (padding / 2); let right_pad: i32 = (padding - left_pad); self.Formatter::write_char_n(self.fill, left_pad); - self.buf.String::append(content); + self.buf.String::push_str(content); self.Formatter::write_char_n(self.fill, right_pad); } else { self.Formatter::write_char_n(self.fill, padding); - self.buf.String::append(content); + self.buf.String::push_str(content); } } } @@ -17685,20 +25286,20 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre let content_len: i32 = ((sign_len + prefix_len) + digit_count); if ((self.width <= 0) || (content_len >= self.width)) { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } return self.buf.String::internal_reserve_uninit(digit_count); } let padding: i32 = (self.width - content_len); if self.zero_pad { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } self.Formatter::write_char_n('0', padding); return self.buf.String::internal_reserve_uninit(digit_count); @@ -17709,10 +25310,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre _ => false, } { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } let offset: i32 = self.buf.String::internal_reserve_uninit(digit_count); self.Formatter::write_char_n(self.fill, padding); @@ -17726,10 +25327,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre let right_pad: i32 = (padding - left_pad); self.Formatter::write_char_n(self.fill, left_pad); if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } let offset: i32 = self.buf.String::internal_reserve_uninit(digit_count); self.Formatter::write_char_n(self.fill, right_pad); @@ -17737,10 +25338,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre } else { self.Formatter::write_char_n(self.fill, padding); if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } return self.buf.String::internal_reserve_uninit(digit_count); } @@ -17930,6 +25531,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -17950,6 +25559,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<1,i32>^Inspect::inspect"(self: &fn(i32) -> i32, f: &mut Formatter) { f.Formatter::write_str("|i32| -> i32"); } @@ -18010,6 +25635,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -18030,6 +25663,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^InspectAlt::inspect_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -18090,6 +25739,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -18110,6 +25767,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<1,i32>^Display::fmt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^Inspect::inspect"(f); } @@ -18170,6 +25843,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -18190,6 +25871,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,i32>^DisplayAlt::fmt_alt"(self: &fn(i32) -> i32, f: &mut Formatter) { self."Fn<1,i32>^InspectAlt::inspect_alt"(f); } diff --git a/wado-compiler/tests/format.fixtures.golden/mess.optimize.wado b/wado-compiler/tests/format.fixtures.golden/mess.optimize.wado index 0e20363be..b7565c3b0 100644 --- a/wado-compiler/tests/format.fixtures.golden/mess.optimize.wado +++ b/wado-compiler/tests/format.fixtures.golden/mess.optimize.wado @@ -45,7 +45,7 @@ fn __cm_binding__Environment_get_environment() -> Array<[String, String]> { let __elem_addr: i32 = (__base + (__i * 16)); let __lifted_result_6: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4))); let __lifted_result_7: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4))); - __result."Array>::append"([__lifted_result_6, __lifted_result_7]); + __result."Array>::push"([__lifted_result_6, __lifted_result_7]); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4)), 1, 0); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4)), 1, 0); __i = (__i + 1); @@ -69,7 +69,7 @@ fn __cm_binding__Environment_get_arguments() -> Array { break; } let __elem_addr: i32 = (__base + (__i * 8)); - __result."Array::append"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); + __result."Array::push"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); core::builtin::realloc(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)), 1, 0); __i = (__i + 1); } diff --git a/wado-compiler/tests/format.fixtures.golden/mess.tir.wado b/wado-compiler/tests/format.fixtures.golden/mess.tir.wado index 0e20363be..b7565c3b0 100644 --- a/wado-compiler/tests/format.fixtures.golden/mess.tir.wado +++ b/wado-compiler/tests/format.fixtures.golden/mess.tir.wado @@ -45,7 +45,7 @@ fn __cm_binding__Environment_get_environment() -> Array<[String, String]> { let __elem_addr: i32 = (__base + (__i * 16)); let __lifted_result_6: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4))); let __lifted_result_7: String = core::internal::memory_to_gc_string(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4))); - __result."Array>::append"([__lifted_result_6, __lifted_result_7]); + __result."Array>::push"([__lifted_result_6, __lifted_result_7]); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 0)), core::builtin::i32_load(((__elem_addr + 0) + 4)), 1, 0); core::builtin::realloc(core::builtin::i32_load((__elem_addr + 8)), core::builtin::i32_load(((__elem_addr + 8) + 4)), 1, 0); __i = (__i + 1); @@ -69,7 +69,7 @@ fn __cm_binding__Environment_get_arguments() -> Array { break; } let __elem_addr: i32 = (__base + (__i * 8)); - __result."Array::append"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); + __result."Array::push"(core::internal::memory_to_gc_string(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)))); core::builtin::realloc(core::builtin::i32_load(__elem_addr), core::builtin::i32_load((__elem_addr + 4)), 1, 0); __i = (__i + 1); } diff --git a/wado-compiler/tests/format.fixtures.golden/ops.all.lower.wado b/wado-compiler/tests/format.fixtures.golden/ops.all.lower.wado index af0584f0c..16fd7a612 100644 --- a/wado-compiler/tests/format.fixtures.golden/ops.all.lower.wado +++ b/wado-compiler/tests/format.fixtures.golden/ops.all.lower.wado @@ -1,6 +1,106 @@ // --- Module: core:allocator --- global mut heap_offset: i32 = 8; +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -119,6 +219,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -139,6 +247,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -187,6 +311,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -207,6 +339,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -255,6 +403,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -275,6 +431,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -323,6 +495,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -343,6 +523,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -364,6 +560,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:builtin --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -1189,6 +1485,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -1209,6 +1513,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -1257,6 +1577,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1277,6 +1605,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -1325,6 +1669,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1345,6 +1697,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -1393,6 +1761,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -1413,6 +1789,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -1434,61 +1826,161 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:internal --- -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, -} - -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, } -pub struct "IterSkip" { - pub inner: StrUtf8ByteIter, +pub struct "IterSkip" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrUtf8ByteIter, +pub struct "IterTake" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrUtf8ByteIter, +pub struct "IterEnumerate" { + pub inner: StrLinesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrUtf8ByteIter, - pub pred: fn(u8) -> bool, +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, } -pub struct "Box" { - value: f64, +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, } -pub struct "Box" { - value: f32, +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, } -pub struct "Box" { - value: bool, +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrUtf8ByteIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrUtf8ByteIter, + pub pred: fn(u8) -> bool, +} + +pub struct "Box" { + value: f64, +} + +pub struct "Box" { + value: f32, +} + +pub struct "Box" { + value: bool, } pub struct "Box" { @@ -1817,6 +2309,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -1837,6 +2337,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -1885,6 +2401,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1905,6 +2429,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -1953,6 +2493,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1973,6 +2521,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -2021,6 +2585,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -2041,6 +2613,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -2086,6 +2674,106 @@ fn "core/builtin/array_copy"(dst: builtin::array, dst_offset: i32, src: fn "core/builtin/array_new"(len: i32) -> builtin::array; // --- Module: core:prelude --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -2159,6 +2847,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -2179,6 +2875,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -2227,6 +2939,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2247,6 +2967,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -2295,6 +3031,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2315,6 +3059,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -2363,6 +3123,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -2383,6 +3151,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -2404,13 +3188,113 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:prelude/array.wado --- -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, } -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, pub remaining: i32, } @@ -2485,6 +3369,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -2505,6 +3397,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -2553,6 +3461,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2573,6 +3489,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -2621,6 +3553,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2641,6 +3581,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -2689,6 +3645,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -2709,6 +3673,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -2749,6 +3729,106 @@ pub struct FormatResult { pub exponent: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -3127,20 +4207,20 @@ pub fn fixed_width(f: f64, n: i32) -> FormatResult { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(131); - __r.String::append("Assertion failed in "); - __r.String::append("fixed_width"); - __r.String::append(" at "); - __r.String::append("core:prelude/fpfmt.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("fixed_width"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/fpfmt.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 289 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("digits must be <= 18"); - __r.String::append("\ncondition: n <= 18\n"); - __r.String::append("n: "); + __r.String::push_str(": "); + __r.String::push_str("digits must be <= 18"); + __r.String::push_str("\ncondition: n <= 18\n"); + __r.String::push_str("n: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -3369,7 +4449,7 @@ fn fill_zeros(buf: &mut String, n: i32) { pub fn write_decimal(buf: &mut String, d: u64, p: i32, nd: i32) { let decimal_pos: i32 = (nd + p); if (decimal_pos <= 0) { - buf.String::append("0."); + buf.String::push_str("0."); "core::prelude/fpfmt.wado::fill_zeros"(buf, -decimal_pos); let digit_offset: i32 = buf.String::len(); "core::prelude/fpfmt.wado::fill_zeros"(buf, nd); @@ -3421,13 +4501,13 @@ pub fn write_exp(buf: &mut String, d: u64, p: i32, nd: i32, upper: bool) { "core::prelude/fpfmt.wado::fill_zeros"(buf, 1); "core::prelude/fpfmt.wado::write_digits_at"(buf, start, d, 1); } - buf.String::append(if upper { + buf.String::push_str(if upper { "E"; } else { "e"; }); if (exp < 0) { - buf.String::append("-"); + buf.String::push_str("-"); } let abs_exp: i32 = if (exp < 0) { -exp; @@ -3435,15 +4515,15 @@ pub fn write_exp(buf: &mut String, d: u64, p: i32, nd: i32, upper: bool) { exp; }; if (abs_exp < 10) { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); } else { if (abs_exp < 100) { - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); } else { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); } } } @@ -3462,7 +4542,7 @@ pub fn write_decimal_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: let decimal_pos: i32 = (nd + p); if (decimal_pos <= 0) { let leading_zeros: i32 = -decimal_pos; - buf.String::append("0."); + buf.String::push_str("0."); if (precision <= leading_zeros) { "core::prelude/fpfmt.wado::fill_zeros"(buf, precision); return; @@ -3495,7 +4575,7 @@ pub fn write_decimal_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: "core::prelude/fpfmt.wado::write_digits_at"(buf, start, d, nd); "core::prelude/fpfmt.wado::fill_zeros"(buf, (decimal_pos - nd)); if (precision > 0) { - buf.String::append("."); + buf.String::push_str("."); "core::prelude/fpfmt.wado::fill_zeros"(buf, precision); } } else { @@ -3583,13 +4663,13 @@ pub fn write_exp_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: i32, "core::prelude/fpfmt.wado::write_digits_at"(buf, start, first_d, 1); } let exp: i32 = ((p + nd) - 1); - buf.String::append(if upper { + buf.String::push_str(if upper { "E"; } else { "e"; }); if (exp < 0) { - buf.String::append("-"); + buf.String::push_str("-"); } let abs_exp: i32 = if (exp < 0) { -exp; @@ -3597,15 +4677,15 @@ pub fn write_exp_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: i32, exp; }; if (abs_exp < 10) { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); } else { if (abs_exp < 100) { - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); } else { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); } } } @@ -3943,6 +5023,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -3963,6 +5051,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -4054,6 +5158,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -4074,6 +5186,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -4138,6 +5266,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -4158,6 +5294,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -4222,6 +5374,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -4242,6 +5402,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -4267,10 +5443,10 @@ fn "Array^SequenceLiteralBuilder::build"(self: &Array) -> Array { } fn "Array^SequenceLiteralBuilder::push_literal"(self: &mut Array, value: u64) with stores[value] { - self."Array::append"(value); + self."Array::push"(value); } -pub fn "Array::append"(self: &mut Array, value: u64) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: u64) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -4355,57 +5531,157 @@ pub struct i128 { high: i64, } -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, -} - -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, } -pub struct "IterSkip" { - pub inner: StrUtf8ByteIter, +pub struct "IterSkip" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrUtf8ByteIter, +pub struct "IterTake" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrUtf8ByteIter, +pub struct "IterEnumerate" { + pub inner: StrLinesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrUtf8ByteIter, - pub pred: fn(u8) -> bool, +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, } -pub fn u128::from_u64(value: u64) -> u128 { - return u128 { low: value, high: 0 }; +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, } -pub fn u128::from_pair(low: u64, high: u64) -> u128 { - return u128 { low: low, high: high }; +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrUtf8ByteIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrUtf8ByteIter, + pub pred: fn(u8) -> bool, +} + +pub fn u128::from_u64(value: u64) -> u128 { + return u128 { low: value, high: 0 }; +} + +pub fn u128::from_pair(low: u64, high: u64) -> u128 { + return u128 { low: low, high: high }; } pub fn u128::from_string(s: String) -> u128 { @@ -5306,6 +6582,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -5326,6 +6610,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -5374,6 +6674,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -5394,6 +6702,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -5442,6 +6766,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -5462,6 +6794,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -5518,6 +6866,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -5538,6 +6894,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -5559,6 +6931,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:prelude/primitive.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -5816,7 +7288,7 @@ pub fn char::from_u32_unchecked(value: u32) -> char { pub fn char::to_string(self: Box) -> String { let mut buf: String = "core::prelude/string.wado::String::with_capacity"(4); - buf.String::append_char(self.value); + buf.String::push(self.value); return buf; } @@ -6219,24 +7691,24 @@ fn fmt_float_special(f: &mut Formatter, is_neg: bool, kind: SpecialKind, zero_re NaN => true, _ => false, } { - f.buf.String::append("NaN"); + f.buf.String::push_str("NaN"); } else { if match kind { Inf => true, _ => false, } { - f.buf.String::append(if is_neg { + f.buf.String::push_str(if is_neg { "-inf"; } else { "inf"; }); } else { - f.buf.String::append(if is_neg { + f.buf.String::push_str(if is_neg { "-"; } else { ""; }); - f.buf.String::append(zero_repr); + f.buf.String::push_str(zero_repr); } } f.Formatter::apply_padding(mark); @@ -6244,10 +7716,10 @@ fn fmt_float_special(f: &mut Formatter, is_neg: bool, kind: SpecialKind, zero_re fn fmt_float_sign(f: &mut Formatter, is_neg: bool) { if is_neg { - f.buf.String::append("-"); + f.buf.String::push_str("-"); } else { if f.sign_plus { - f.buf.String::append("+"); + f.buf.String::push_str("+"); } } } @@ -6310,7 +7782,7 @@ fn f32::inspect_into(self: Box, f: &mut Formatter) { } else { if (p >= 0) { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); - f.buf.String::append(".0"); + f.buf.String::push_str(".0"); } else { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); } @@ -6552,7 +8024,7 @@ fn f64::inspect_into(self: Box, f: &mut Formatter) { } else { if (p >= 0) { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); - f.buf.String::append(".0"); + f.buf.String::push_str(".0"); } else { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); } @@ -6579,9 +8051,9 @@ fn f64::fmt_fixed(self: Box, precision: i32, f: &mut Formatter) { } let mark: i32 = f.Formatter::mark(); "core::prelude/primitive.wado::fmt_float_sign"(f, is_neg); - f.buf.String::append("0"); + f.buf.String::push_str("0"); if (precision > 0) { - f.buf.String::append("."); + f.buf.String::push_str("."); f.buf.String::append_byte_filled('0' as u8, precision); } f.Formatter::apply_padding(mark); @@ -6622,17 +8094,17 @@ fn f64::fmt_exp(self: Box, precision: i32, upper: i32, f: &mut Formatter) { } let mark: i32 = f.Formatter::mark(); "core::prelude/primitive.wado::fmt_float_sign"(f, is_neg); - f.buf.String::append("0"); + f.buf.String::push_str("0"); if (precision > 0) { - f.buf.String::append("."); + f.buf.String::push_str("."); f.buf.String::append_byte_filled('0' as u8, precision); } - f.buf.String::append(if upper_bool { + f.buf.String::push_str(if upper_bool { "E"; } else { "e"; }); - f.buf.String::append("0"); + f.buf.String::push_str("0"); f.Formatter::apply_padding(mark); return; } @@ -6837,7 +8309,7 @@ pub fn "char^Display::fmt"(self: Box, f: &mut Formatter) { f.Formatter::write_char(self.value); } else { let mut s: String = "core::prelude/string.wado::String::with_capacity"(4); - s.String::append_char(self.value); + s.String::push(self.value); f.Formatter::pad(s); } } @@ -7901,7 +9373,7 @@ pub fn "i32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i32"); + __r.String::push_str(" out of range for i32"); break __tmpl: __r; })); } @@ -7914,7 +9386,7 @@ pub fn "i16^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i16"); + __r.String::push_str(" out of range for i16"); break __tmpl: __r; })); } @@ -7927,7 +9399,7 @@ pub fn "i8^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -7940,7 +9412,7 @@ pub fn "i16^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for i16"); + __r.String::push_str(" out of range for i16"); break __tmpl: __r; })); } @@ -7953,7 +9425,7 @@ pub fn "i8^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -7966,7 +9438,7 @@ pub fn "i8^TryFrom::try_from"(value: i16) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i16^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -7979,7 +9451,7 @@ pub fn "u32^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -7992,7 +9464,7 @@ pub fn "u64^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u64"); + __r.String::push_str(" out of range for u64"); break __tmpl: __r; })); } @@ -8005,7 +9477,7 @@ pub fn "u32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -8018,7 +9490,7 @@ pub fn "i64^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i64"); + __r.String::push_str(" out of range for i64"); break __tmpl: __r; })); } @@ -8031,7 +9503,7 @@ pub fn "u32^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -8044,7 +9516,7 @@ pub fn "u16^TryFrom::try_from"(value: u32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u16"); + __r.String::push_str(" out of range for u16"); break __tmpl: __r; })); } @@ -8057,7 +9529,7 @@ pub fn "u8^TryFrom::try_from"(value: u32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u8"); + __r.String::push_str(" out of range for u8"); break __tmpl: __r; })); } @@ -8070,7 +9542,7 @@ pub fn "u8^TryFrom::try_from"(value: u16) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u16^Display::fmt"(&mut __f); - __r.String::append(" out of range for u8"); + __r.String::push_str(" out of range for u8"); break __tmpl: __r; })); } @@ -8084,7 +9556,7 @@ pub fn "f32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f32"); + __r.String::push_str(" cannot be exactly represented as f32"); break __tmpl: __r; })); } @@ -8098,7 +9570,7 @@ pub fn "f64^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f64"); + __r.String::push_str(" cannot be exactly represented as f64"); break __tmpl: __r; })); } @@ -8111,7 +9583,7 @@ pub fn "f64^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f64"); + __r.String::push_str(" cannot be exactly represented as f64"); break __tmpl: __r; })); } @@ -8124,7 +9596,7 @@ pub fn "f32^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f32"); + __r.String::push_str(" cannot be exactly represented as f32"); break __tmpl: __r; })); } @@ -8159,6 +9631,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -8179,6 +9659,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -8227,6 +9723,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -8247,6 +9751,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -8295,6 +9815,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -8315,6 +9843,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -8363,6 +9907,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -8383,6 +9935,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -8439,12 +10007,150 @@ pub struct StrCharIter { byte_index: i32, } -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, +pub struct StrSplitIter { + repr: builtin::array, + used: i32, + pos: i32, + sep_repr: builtin::array, + sep_len: i32, + finished: bool, } -pub struct "IterSkip" { +pub struct StrSplitNIter { + repr: builtin::array, + used: i32, + pos: i32, + sep_repr: builtin::array, + sep_len: i32, + remaining: i32, + finished: bool, +} + +pub struct StrSplitWhitespaceIter { + repr: builtin::array, + used: i32, + pos: i32, +} + +pub struct StrLinesIter { + repr: builtin::array, + used: i32, + pos: i32, + finished: bool, +} + +pub struct StrCharIndicesIter { + repr: builtin::array, + used: i32, + byte_index: i32, +} + +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { pub inner: StrCharIter, pub remaining: i32, } @@ -8582,7 +10288,7 @@ pub fn String::append_byte_filled(self: &mut String, byte: u8, n: i32) { self.used = new_used; } -pub fn String::append(self: &mut String, other: String) { +pub fn String::push_str(self: &mut String, other: String) { let other_len: i32 = other.String::len(); if (other_len == 0) { return; @@ -8595,6 +10301,10 @@ pub fn String::append(self: &mut String, other: String) { self.used = new_used; } +pub fn String::append(self: &mut String, other: String) { + self.String::push_str(other); +} + pub fn String::concat(a: String, b: String) -> String { let len_a: i32 = a.String::len(); let len_b: i32 = b.String::len(); @@ -8688,7 +10398,7 @@ pub fn "StrUtf8ByteIter^Iterator::collect"(self: &mut StrUtf8ByteIter) -> Array< let __pattern_temp_0: Option = self."StrUtf8ByteIter^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let item: u8 = __variant_payload(__pattern_temp_0, case=0); - result."Array::append"(item); + result."Array::push"(item); } else { break; } @@ -8876,7 +10586,7 @@ pub fn "StrCharIter^Iterator::collect"(self: &mut StrCharIter) -> Array { let __pattern_temp_0: Option = self."StrCharIter^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let item: char = __variant_payload(__pattern_temp_0, case=0); - result."Array::append"(item); + result."Array::push"(item); } else { break; } @@ -9033,7 +10743,7 @@ pub fn String::chars(self: &String) -> StrCharIter { return StrCharIter { repr: self.repr, used: self.used, byte_index: 0 }; } -pub fn String::append_char(self: &mut String, c: char) { +pub fn String::push(self: &mut String, c: char) { let code: u32 = c as u32; if core::builtin::unlikely(((self.used + 4) > core::builtin::array_len(self.repr))) { self.String::grow((self.used + 4)); @@ -9063,7 +10773,11 @@ pub fn String::append_char(self: &mut String, c: char) { } } -pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { +pub fn String::append_char(self: &mut String, c: char) { + self.String::push(c); +} + +pub fn String::truncate(self: &mut String, byte_len: i32) { if (byte_len >= self.used) { return; } @@ -9073,20 +10787,20 @@ pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(144); - __r.String::append("Assertion failed in "); - __r.String::append("String::truncate_bytes"); - __r.String::append(" at "); - __r.String::append("core:prelude/string.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::truncate"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); - Box { value: 355 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("negative length"); - __r.String::append("\ncondition: byte_len >= 0\n"); - __r.String::append("byte_len: "); + Box { value: 365 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("negative length"); + __r.String::push_str("\ncondition: byte_len >= 0\n"); + __r.String::push_str("byte_len: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -9102,32 +10816,32 @@ pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); - __r.String::append("Assertion failed in "); - __r.String::append("String::truncate_bytes"); - __r.String::append(" at "); - __r.String::append("core:prelude/string.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::truncate"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); - Box { value: 360 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("not on a UTF-8 character boundary"); - __r.String::append("\ncondition: b < 0x80 || b >= 0xC0\n"); - __r.String::append("b: "); + Box { value: 370 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b < 0x80: "); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b: "); + __r.String::push_str("\n"); + __r.String::push_str("b: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b >= 0xC0: "); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -9162,6 +10876,78 @@ pub fn String::truncate_chars(self: &mut String, char_count: i32) { self.used = byte_pos; } +pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { + self.String::truncate(byte_len); +} + +pub fn String::pop(self: &mut String) -> Option { + if (self.used == 0) { + return null; + } + let mut pos: i32 = (self.used - 1); + loop { + if !(pos > 0) { + break; + } + let b: u8 = core::builtin::array_get_u8(self.repr, pos); + if ((b >= 0x80) && (b < 0xC0)) { + pos = (pos - 1); + } else { + break; + } + } + let b0: u32 = core::builtin::array_get_u8(self.repr, pos) as u32; + let code: u32 = if (b0 < 0x80) { + b0; + } else { + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + (((b0 & 0x1F) << 6) | (b1 & 0x3F)); + } else { + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (pos + 2)) as u32; + ((((b0 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + } else { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (pos + 2)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (pos + 3)) as u32; + (((((b0 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + }; + }; + }; + self.used = pos; + return Option::Some("core::prelude/primitive.wado::char::from_u32_unchecked"(code)); +} + +pub fn String::clear(self: &mut String) { + self.used = 0; +} + +pub fn String::capacity(self: &String) -> i32 { + return core::builtin::array_len(self.repr); +} + +pub fn String::reserve(self: &mut String, additional: i32) { + let required: i32 = (self.used + additional); + if (required > core::builtin::array_len(self.repr)) { + self.String::grow(required); + } +} + +pub fn String::shrink_to_fit(self: &mut String) { + let capacity: i32 = core::builtin::array_len(self.repr); + if (capacity > self.used) { + let new_repr: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(self.used); + "core::prelude/string.wado::core/builtin/array_copy"(new_repr, 0, self.repr, 0, self.used); + self.repr = new_repr; + } +} + +pub fn String::as_bytes(self: &String) -> Array { + return self.String::bytes()."StrUtf8ByteIter^Iterator::collect"(); +} + pub fn String::trim_ascii_start(self: &String) -> String { let mut start: i32 = 0; loop { @@ -9300,84 +11086,1930 @@ fn String::internal_substr_bytes(self: &String, start: i32, end: i32) -> String return String { repr: repr, used: len }; } -pub fn "String^Default::default"() -> String { - return ""; +pub fn String::contains(self: &String, pat: String) -> bool { + return match self.String::find(pat) { + Some(_) => true, + _ => false, + }; } -pub fn "String^From::from"(value: char) -> String { - let mut s: String = "core::prelude/string.wado::String::with_capacity"(4); - s.String::append_char(value); - return s; +pub fn String::starts_with(self: &String, pat: String) -> bool { + let pat_len: i32 = pat.String::len(); + if (pat_len > self.used) { + return false; + } + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + __for_3: { + let mut i: i32 = 0; + loop { + if !(i < pat_len) { + break __for_3; + } + __for_3_body: { + if (core::builtin::array_get_u8(self.repr, i) != core::builtin::array_get_u8(pat_repr, i)) { + return false; + } + } + i = (i + 1); + } + } + return true; } -pub fn "StrUtf8ByteIter^Eq::eq"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> bool { - return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.index }."i32^Eq::eq"(Box { value: other.index })); +pub fn String::ends_with(self: &String, pat: String) -> bool { + let pat_len: i32 = pat.String::len(); + if (pat_len > self.used) { + return false; + } + let offset: i32 = (self.used - pat_len); + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + __for_4: { + let mut i: i32 = 0; + loop { + if !(i < pat_len) { + break __for_4; + } + __for_4_body: { + if (core::builtin::array_get_u8(self.repr, (offset + i)) != core::builtin::array_get_u8(pat_repr, i)) { + return false; + } + } + i = (i + 1); + } + } + return true; } -pub fn "StrUtf8ByteIter^Ord::cmp"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> Ordering { - let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); - if (c != Ordering::Equal) { - return c; +pub fn String::find(self: &String, pat: String) -> Option { + let pat_len: i32 = pat.String::len(); + if (pat_len == 0) { + return Option::Some(0); } - let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); - if (c != Ordering::Equal) { - return c; + if (pat_len > self.used) { + return null; } - let c: Ordering = Box { value: self.index }."i32^Ord::cmp"(Box { value: other.index }); - if (c != Ordering::Equal) { - return c; + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + let limit: i32 = (self.used - pat_len); + __for_5: { + let mut i: i32 = 0; + loop { + if !(i <= limit) { + break __for_5; + } + __for_5_body: { + let mut matched: bool = true; + __for_6: { + let mut j: i32 = 0; + loop { + if !(j < pat_len) { + break __for_6; + } + __for_6_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(pat_repr, j)) { + matched = false; + break __for_6; + } + } + j = (j + 1); + } + } + if matched { + return Option::Some(i); + } + } + i = (i + 1); + } } - return Ordering::Equal; -} - -pub fn "StrCharIter^Eq::eq"(self: &StrCharIter, other: &StrCharIter) -> bool { - return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.byte_index }."i32^Eq::eq"(Box { value: other.byte_index })); + return null; } -pub fn "StrCharIter^Ord::cmp"(self: &StrCharIter, other: &StrCharIter) -> Ordering { - let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); - if (c != Ordering::Equal) { - return c; +pub fn String::rfind(self: &String, pat: String) -> Option { + let pat_len: i32 = pat.String::len(); + if (pat_len == 0) { + return Option::Some(self.used); } - let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); - if (c != Ordering::Equal) { - return c; + if (pat_len > self.used) { + return null; } - let c: Ordering = Box { value: self.byte_index }."i32^Ord::cmp"(Box { value: other.byte_index }); - if (c != Ordering::Equal) { - return c; + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + let mut i: i32 = (self.used - pat_len); + loop { + let mut matched: bool = true; + __for_7: { + let mut j: i32 = 0; + loop { + if !(j < pat_len) { + break __for_7; + } + __for_7_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(pat_repr, j)) { + matched = false; + break __for_7; + } + } + j = (j + 1); + } + } + if matched { + return Option::Some(i); + } + if (i == 0) { + break; + } + i = (i - 1); } - return Ordering::Equal; -} - -pub fn "StrUtf8ByteIter^Inspect::inspect"(self: &StrUtf8ByteIter, f: &mut Formatter) { - f.Formatter::write_str("StrUtf8ByteIter { "); - f.Formatter::write_str("repr: "); - self.repr."builtin::array^Inspect::inspect"(f); - f.Formatter::write_str(", "); - f.Formatter::write_str("used: "); - Box { value: self.used }."i32^Inspect::inspect"(f); - f.Formatter::write_str(", "); - f.Formatter::write_str("index: "); - Box { value: self.index }."i32^Inspect::inspect"(f); - f.Formatter::write_str(" }"); -} - -pub fn "StrCharIter^Inspect::inspect"(self: &StrCharIter, f: &mut Formatter) { - f.Formatter::write_str("StrCharIter { "); - f.Formatter::write_str("repr: "); - self.repr."builtin::array^Inspect::inspect"(f); - f.Formatter::write_str(", "); - f.Formatter::write_str("used: "); - Box { value: self.used }."i32^Inspect::inspect"(f); - f.Formatter::write_str(", "); - f.Formatter::write_str("byte_index: "); - Box { value: self.byte_index }."i32^Inspect::inspect"(f); - f.Formatter::write_str(" }"); + return null; } -pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(I::Item) -> bool, f: &mut Formatter) { - f.Formatter::write_str("|I::Item| -> bool"); +pub fn String::contains_char(self: &String, ch: char) -> bool { + __for_of_2: { + let mut __iter_2: StrCharIter = self.String::chars()."StrCharIter^IntoIterator::into_iter"(); + loop { + let __pattern_temp_0: Option = __iter_2."StrCharIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let c: char = __variant_payload(__pattern_temp_0, case=0); + if (c == ch) { + return true; + } + } else { + break; + } + } + } + return false; +} + +pub fn String::find_char(self: &String, pred: fn(char) -> bool) -> Option { + let mut byte_index: i32 = 0; + let mut iter: StrCharIter = self.String::chars(); + loop { + let __pattern_temp_0: Option = iter."StrCharIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let c: char = __variant_payload(__pattern_temp_0, case=0); + if pred(c) { + return Option::Some(byte_index); + } + let code: u32 = c as u32; + if (code < 0x80) { + byte_index = (byte_index + 1); + } else { + if (code < 0x800) { + byte_index = (byte_index + 2); + } else { + if (code < 0x10000) { + byte_index = (byte_index + 3); + } else { + byte_index = (byte_index + 4); + } + } + } + } else { + break; + } + } + return null; +} + +pub fn String::insert(self: &mut String, byte_index: i32, ch: char) { + __assert_2: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index <= self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(308); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 726 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index <= self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index <= self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + if ((byte_index > 0) && (byte_index < self.used)) { + let b: u8 = core::builtin::array_get_u8(self.repr, byte_index); + __assert_3: { + let __v0: u8 = b; + let __v1: bool = (b < 0x80); + let __v2: u8 = b; + let __v3: bool = (b >= 0xC0); + let __cond: bool = (__v1 || __v3); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 729 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + } + let code: u32 = ch as u32; + let char_len: i32 = if (code < 0x80) { + 1; + } else { + if (code < 0x800) { + 2; + } else { + if (code < 0x10000) { + 3; + } else { + 4; + }; + }; + }; + let new_used: i32 = (self.used + char_len); + if (new_used > core::builtin::array_len(self.repr)) { + self.String::grow(new_used); + } + let mut i: i32 = (self.used - 1); + loop { + if !(i >= byte_index) { + break; + } + core::builtin::array_set_u8(self.repr, (i + char_len), core::builtin::array_get_u8(self.repr, i)); + if (i == 0) { + break; + } + i = (i - 1); + } + if (code < 0x80) { + core::builtin::array_set_u8(self.repr, byte_index, code as u8); + } else { + if (code < 0x800) { + core::builtin::array_set_u8(self.repr, byte_index, (0xC0 | (code >> 6)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | (code & 0x3F)) as u8); + } else { + if (code < 0x10000) { + core::builtin::array_set_u8(self.repr, byte_index, (0xE0 | (code >> 12)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | ((code >> 6) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 2), (0x80 | (code & 0x3F)) as u8); + } else { + core::builtin::array_set_u8(self.repr, byte_index, (0xF0 | (code >> 18)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | ((code >> 12) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 2), (0x80 | ((code >> 6) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 3), (0x80 | (code & 0x3F)) as u8); + } + } + } + self.used = new_used; +} + +pub fn String::insert_str(self: &mut String, byte_index: i32, s: String) { + let s_len: i32 = s.String::len(); + if (s_len == 0) { + return; + } + __assert_4: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index <= self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(308); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert_str"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 771 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index <= self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index <= self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + if ((byte_index > 0) && (byte_index < self.used)) { + let b: u8 = core::builtin::array_get_u8(self.repr, byte_index); + __assert_5: { + let __v0: u8 = b; + let __v1: bool = (b < 0x80); + let __v2: u8 = b; + let __v3: bool = (b >= 0xC0); + let __cond: bool = (__v1 || __v3); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert_str"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 774 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + } + let new_used: i32 = (self.used + s_len); + if (new_used > core::builtin::array_len(self.repr)) { + self.String::grow(new_used); + } + let mut i: i32 = (self.used - 1); + loop { + if !(i >= byte_index) { + break; + } + core::builtin::array_set_u8(self.repr, (i + s_len), core::builtin::array_get_u8(self.repr, i)); + if (i == 0) { + break; + } + i = (i - 1); + } + "core::prelude/string.wado::core/builtin/array_copy"(self.repr, byte_index, s.String::internal_raw_bytes(), 0, s_len); + self.used = new_used; +} + +pub fn String::remove(self: &mut String, byte_index: i32) -> char { + __assert_6: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index < self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(306); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::remove"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 795 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index < self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index < self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + let b0: u32 = core::builtin::array_get_u8(self.repr, byte_index) as u32; + let char_len: i32 = if (b0 < 0x80) { + 1; + } else { + if (b0 < 0xE0) { + 2; + } else { + if (b0 < 0xF0) { + 3; + } else { + 4; + }; + }; + }; + let code: u32 = if (b0 < 0x80) { + b0; + } else { + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + (((b0 & 0x1F) << 6) | (b1 & 0x3F)); + } else { + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 2)) as u32; + ((((b0 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + } else { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 2)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 3)) as u32; + (((((b0 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + }; + }; + }; + let src: i32 = (byte_index + char_len); + __for_8: { + let mut i: i32 = src; + loop { + if !(i < self.used) { + break __for_8; + } + __for_8_body: { + core::builtin::array_set_u8(self.repr, (i - char_len), core::builtin::array_get_u8(self.repr, i)); + } + i = (i + 1); + } + } + self.used = (self.used - char_len); + return "core::prelude/primitive.wado::char::from_u32_unchecked"(code); +} + +pub fn String::repeat(self: &String, n: i32) -> String { + if ((n <= 0) || (self.used == 0)) { + return "core::prelude/string.wado::String::with_capacity"(0); + } + let total: i32 = (self.used * n); + let repr: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(total); + __for_9: { + let mut r: i32 = 0; + loop { + if !(r < n) { + break __for_9; + } + __for_9_body: { + "core::prelude/string.wado::core/builtin/array_copy"(repr, (r * self.used), self.repr, 0, self.used); + } + r = (r + 1); + } + } + return String { repr: repr, used: total }; +} + +pub fn String::replace(self: &String, from: String, to: String) -> String { + return self.String::replacen(from, to, -1); +} + +pub fn String::replacen(self: &String, from: String, to: String, count: i32) -> String { + let from_len: i32 = from.String::len(); + if (from_len == 0) { + return *self; + } + let to_len: i32 = to.String::len(); + let from_repr: builtin::array = from.String::internal_raw_bytes(); + let to_repr: builtin::array = to.String::internal_raw_bytes(); + let mut result: String = "core::prelude/string.wado::String::with_capacity"(self.used); + let mut pos: i32 = 0; + let mut replacements: i32 = 0; + let limit: i32 = (self.used - from_len); + loop { + if !(pos <= limit) { + break; + } + if ((count >= 0) && (replacements >= count)) { + break; + } + let mut matched: bool = true; + __for_10: { + let mut j: i32 = 0; + loop { + if !(j < from_len) { + break __for_10; + } + __for_10_body: { + if (core::builtin::array_get_u8(self.repr, (pos + j)) != core::builtin::array_get_u8(from_repr, j)) { + matched = false; + break __for_10; + } + } + j = (j + 1); + } + } + if matched { + if (to_len > 0) { + let new_used: i32 = (result.used + to_len); + if (new_used > core::builtin::array_len(result.repr)) { + result.String::grow(new_used); + } + "core::prelude/string.wado::core/builtin/array_copy"(result.repr, result.used, to_repr, 0, to_len); + result.used = new_used; + } + pos = (pos + from_len); + replacements = (replacements + 1); + } else { + if (result.used >= core::builtin::array_len(result.repr)) { + result.String::grow((result.used + 1)); + } + core::builtin::array_set_u8(result.repr, result.used, core::builtin::array_get_u8(self.repr, pos)); + result.used = (result.used + 1); + pos = (pos + 1); + } + } + loop { + if !(pos < self.used) { + break; + } + if (result.used >= core::builtin::array_len(result.repr)) { + result.String::grow((result.used + 1)); + } + core::builtin::array_set_u8(result.repr, result.used, core::builtin::array_get_u8(self.repr, pos)); + result.used = (result.used + 1); + pos = (pos + 1); + } + return result; +} + +pub fn "String^Default::default"() -> String { + return ""; +} + +pub fn "String^From::from"(value: char) -> String { + let mut s: String = "core::prelude/string.wado::String::with_capacity"(4); + s.String::push(value); + return s; +} + +pub fn "StrSplitIter^Iterator::next"(self: &mut StrSplitIter) -> Option { + if self.finished { + return null; + } + let limit: i32 = (self.used - self.sep_len); + let mut i: i32 = self.pos; + loop { + if !(i <= limit) { + break; + } + let mut matched: bool = true; + __for_11: { + let mut j: i32 = 0; + loop { + if !(j < self.sep_len) { + break __for_11; + } + __for_11_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(self.sep_repr, j)) { + matched = false; + break __for_11; + } + } + j = (j + 1); + } + } + if matched { + let len: i32 = (i - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.pos = (i + self.sep_len); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + i = (i + 1); + } + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitIter^Iterator::collect"(self: &mut StrSplitIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitIter^Iterator::count"(self: &mut StrSplitIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitIter^Iterator::find"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::any"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitIter^Iterator::all"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitIter^Iterator::last"(self: &mut StrSplitIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitIter^Iterator::nth"(self: &mut StrSplitIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::position"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::reduce"(self: &mut StrSplitIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitIter^Iterator::filter"(self: &StrSplitIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitIter^Iterator::enumerate"(self: &StrSplitIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitIter^Iterator::take"(self: &StrSplitIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitIter^Iterator::skip"(self: &StrSplitIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrSplitNIter^Iterator::next"(self: &mut StrSplitNIter) -> Option { + if self.finished { + return null; + } + if (self.remaining <= 1) { + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + let limit: i32 = (self.used - self.sep_len); + let mut i: i32 = self.pos; + loop { + if !(i <= limit) { + break; + } + let mut matched: bool = true; + __for_12: { + let mut j: i32 = 0; + loop { + if !(j < self.sep_len) { + break __for_12; + } + __for_12_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(self.sep_repr, j)) { + matched = false; + break __for_12; + } + } + j = (j + 1); + } + } + if matched { + let len: i32 = (i - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.pos = (i + self.sep_len); + self.remaining = (self.remaining - 1); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + i = (i + 1); + } + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitNIter^Iterator::collect"(self: &mut StrSplitNIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitNIter^Iterator::count"(self: &mut StrSplitNIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitNIter^Iterator::find"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::any"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitNIter^Iterator::all"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitNIter^Iterator::last"(self: &mut StrSplitNIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitNIter^Iterator::nth"(self: &mut StrSplitNIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::position"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::reduce"(self: &mut StrSplitNIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitNIter^Iterator::filter"(self: &StrSplitNIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitNIter^Iterator::enumerate"(self: &StrSplitNIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitNIter^Iterator::take"(self: &StrSplitNIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitNIter^Iterator::skip"(self: &StrSplitNIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +fn is_ascii_whitespace_byte(b: u8) -> bool { + return (((((b == 0x20) || (b == 0x09)) || (b == 0x0A)) || (b == 0x0D)) || (b == 0x0C)); +} + +pub fn "StrSplitWhitespaceIter^Iterator::next"(self: &mut StrSplitWhitespaceIter) -> Option { + loop { + if !((self.pos < self.used) && "core::prelude/string.wado::is_ascii_whitespace_byte"(core::builtin::array_get_u8(self.repr, self.pos))) { + break; + } + self.pos = (self.pos + 1); + } + if (self.pos >= self.used) { + return null; + } + let start: i32 = self.pos; + loop { + if !((self.pos < self.used) && !"core::prelude/string.wado::is_ascii_whitespace_byte"(core::builtin::array_get_u8(self.repr, self.pos))) { + break; + } + self.pos = (self.pos + 1); + } + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitWhitespaceIter^Iterator::collect"(self: &mut StrSplitWhitespaceIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitWhitespaceIter^Iterator::count"(self: &mut StrSplitWhitespaceIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitWhitespaceIter^Iterator::find"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::any"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitWhitespaceIter^Iterator::all"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitWhitespaceIter^Iterator::last"(self: &mut StrSplitWhitespaceIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitWhitespaceIter^Iterator::nth"(self: &mut StrSplitWhitespaceIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::position"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::reduce"(self: &mut StrSplitWhitespaceIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::filter"(self: &StrSplitWhitespaceIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::enumerate"(self: &StrSplitWhitespaceIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::take"(self: &StrSplitWhitespaceIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::skip"(self: &StrSplitWhitespaceIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrLinesIter^Iterator::next"(self: &mut StrLinesIter) -> Option { + if self.finished { + return null; + } + if (self.pos >= self.used) { + self.finished = true; + return null; + } + let start: i32 = self.pos; + loop { + if !(self.pos < self.used) { + break; + } + let b: u8 = core::builtin::array_get_u8(self.repr, self.pos); + if (b == 0x0A) { + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.pos = (self.pos + 1); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + if (b == 0x0D) { + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.pos = (self.pos + 1); + if ((self.pos < self.used) && (core::builtin::array_get_u8(self.repr, self.pos) == 0x0A)) { + self.pos = (self.pos + 1); + } + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + self.pos = (self.pos + 1); + } + let len: i32 = (self.pos - start); + if (len > 0) { + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + self.finished = true; + return null; +} + +pub fn "StrLinesIter^Iterator::collect"(self: &mut StrLinesIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrLinesIter^Iterator::count"(self: &mut StrLinesIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrLinesIter^Iterator::find"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::any"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrLinesIter^Iterator::all"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrLinesIter^Iterator::last"(self: &mut StrLinesIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrLinesIter^Iterator::nth"(self: &mut StrLinesIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::position"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::reduce"(self: &mut StrLinesIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrLinesIter^Iterator::filter"(self: &StrLinesIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrLinesIter^Iterator::enumerate"(self: &StrLinesIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrLinesIter^Iterator::take"(self: &StrLinesIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrLinesIter^Iterator::skip"(self: &StrLinesIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrCharIndicesIter^Iterator::next"(self: &mut StrCharIndicesIter) -> Option<[i32, char]> { + if (self.byte_index >= self.used) { + return null; + } + let idx: i32 = self.byte_index; + let b0: u8 = core::builtin::array_get_u8(self.repr, self.byte_index); + self.byte_index = (self.byte_index + 1); + if (b0 < 0x80) { + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(b0 as u32)]); + } + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + self.byte_index = (self.byte_index + 1); + let code: u32 = (((b0 as u32 & 0x1F) << 6) | (b1 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); + } + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 1)) as u32; + self.byte_index = (self.byte_index + 2); + let code: u32 = ((((b0 as u32 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); + } + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 1)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 2)) as u32; + self.byte_index = (self.byte_index + 3); + let code: u32 = (((((b0 as u32 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); +} + +pub fn "StrCharIndicesIter^Iterator::collect"(self: &mut StrCharIndicesIter) -> Array<[i32, char]> { + let mut result: Array<[i32, char]> = __seq_lit: { + let mut __b: Array<[i32, char]> = "core::prelude/string.wado::Array>^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array>^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + result."Array>::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrCharIndicesIter^Iterator::count"(self: &mut StrCharIndicesIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrCharIndicesIter^Iterator::find"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> Option<[i32, char]> { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option<[i32, char]>::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::any"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> bool { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrCharIndicesIter^Iterator::all"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> bool { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrCharIndicesIter^Iterator::last"(self: &mut StrCharIndicesIter) -> Option<[i32, char]> { + let mut result: Option<[i32, char]> = null; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + result = Option<[i32, char]>::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrCharIndicesIter^Iterator::nth"(self: &mut StrCharIndicesIter, n: i32) -> Option<[i32, char]> { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option<[i32, char]>::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::position"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::reduce"(self: &mut StrCharIndicesIter, f: fn([i32, char], [i32, char]) -> [i32, char]) -> Option<[i32, char]> { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + let mut acc: [i32, char] = first; + loop { + let __pattern_temp_1: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option<[i32, char]>::Some(acc); + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::filter"(self: &StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrCharIndicesIter^Iterator::enumerate"(self: &StrCharIndicesIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrCharIndicesIter^Iterator::take"(self: &StrCharIndicesIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrCharIndicesIter^Iterator::skip"(self: &StrCharIndicesIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn String::split(self: &String, sep: String) -> StrSplitIter { + return StrSplitIter { repr: self.repr, used: self.used, pos: 0, sep_repr: sep.String::internal_raw_bytes(), sep_len: sep.String::len(), finished: false }; +} + +pub fn String::splitn(self: &String, n: i32, sep: String) -> StrSplitNIter { + return StrSplitNIter { repr: self.repr, used: self.used, pos: 0, sep_repr: sep.String::internal_raw_bytes(), sep_len: sep.String::len(), remaining: n, finished: (n <= 0) }; +} + +pub fn String::split_whitespace(self: &String) -> StrSplitWhitespaceIter { + return StrSplitWhitespaceIter { repr: self.repr, used: self.used, pos: 0 }; +} + +pub fn String::lines(self: &String) -> StrLinesIter { + return StrLinesIter { repr: self.repr, used: self.used, pos: 0, finished: false }; +} + +pub fn String::char_indices(self: &String) -> StrCharIndicesIter { + return StrCharIndicesIter { repr: self.repr, used: self.used, byte_index: 0 }; +} + +pub fn "StrUtf8ByteIter^Eq::eq"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.index }."i32^Eq::eq"(Box { value: other.index })); +} + +pub fn "StrUtf8ByteIter^Ord::cmp"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.index }."i32^Ord::cmp"(Box { value: other.index }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrCharIter^Eq::eq"(self: &StrCharIter, other: &StrCharIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.byte_index }."i32^Eq::eq"(Box { value: other.byte_index })); +} + +pub fn "StrCharIter^Ord::cmp"(self: &StrCharIter, other: &StrCharIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.byte_index }."i32^Ord::cmp"(Box { value: other.byte_index }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitIter^Eq::eq"(self: &StrSplitIter, other: &StrSplitIter) -> bool { + return (((((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && self.sep_repr."builtin::array^Eq::eq"(&other.sep_repr)) && Box { value: self.sep_len }."i32^Eq::eq"(Box { value: other.sep_len })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrSplitIter^Ord::cmp"(self: &StrSplitIter, other: &StrSplitIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = self.sep_repr."builtin::array^Ord::cmp"(&other.sep_repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.sep_len }."i32^Ord::cmp"(Box { value: other.sep_len }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitNIter^Eq::eq"(self: &StrSplitNIter, other: &StrSplitNIter) -> bool { + return ((((((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && self.sep_repr."builtin::array^Eq::eq"(&other.sep_repr)) && Box { value: self.sep_len }."i32^Eq::eq"(Box { value: other.sep_len })) && Box { value: self.remaining }."i32^Eq::eq"(Box { value: other.remaining })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrSplitNIter^Ord::cmp"(self: &StrSplitNIter, other: &StrSplitNIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = self.sep_repr."builtin::array^Ord::cmp"(&other.sep_repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.sep_len }."i32^Ord::cmp"(Box { value: other.sep_len }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.remaining }."i32^Ord::cmp"(Box { value: other.remaining }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitWhitespaceIter^Eq::eq"(self: &StrSplitWhitespaceIter, other: &StrSplitWhitespaceIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })); +} + +pub fn "StrSplitWhitespaceIter^Ord::cmp"(self: &StrSplitWhitespaceIter, other: &StrSplitWhitespaceIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrLinesIter^Eq::eq"(self: &StrLinesIter, other: &StrLinesIter) -> bool { + return (((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrLinesIter^Ord::cmp"(self: &StrLinesIter, other: &StrLinesIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrCharIndicesIter^Eq::eq"(self: &StrCharIndicesIter, other: &StrCharIndicesIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.byte_index }."i32^Eq::eq"(Box { value: other.byte_index })); +} + +pub fn "StrCharIndicesIter^Ord::cmp"(self: &StrCharIndicesIter, other: &StrCharIndicesIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.byte_index }."i32^Ord::cmp"(Box { value: other.byte_index }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrUtf8ByteIter^Inspect::inspect"(self: &StrUtf8ByteIter, f: &mut Formatter) { + f.Formatter::write_str("StrUtf8ByteIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("index: "); + Box { value: self.index }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrCharIter^Inspect::inspect"(self: &StrCharIter, f: &mut Formatter) { + f.Formatter::write_str("StrCharIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("byte_index: "); + Box { value: self.byte_index }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrSplitIter^Inspect::inspect"(self: &StrSplitIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrSplitNIter^Inspect::inspect"(self: &StrSplitNIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitNIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("remaining: "); + Box { value: self.remaining }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrSplitWhitespaceIter^Inspect::inspect"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitWhitespaceIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrLinesIter^Inspect::inspect"(self: &StrLinesIter, f: &mut Formatter) { + f.Formatter::write_str("StrLinesIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrCharIndicesIter^Inspect::inspect"(self: &StrCharIndicesIter, f: &mut Formatter) { + f.Formatter::write_str("StrCharIndicesIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("byte_index: "); + Box { value: self.byte_index }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(I::Item) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|I::Item| -> bool"); } pub fn "StreamWritable^Inspect::inspect"(self: &StreamWritable, f: &mut Formatter) { @@ -9404,6 +13036,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -9424,6 +13064,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -9478,6 +13134,123 @@ pub fn "StrCharIter^InspectAlt::inspect_alt"(self: &StrCharIter, f: &mut Formatt f.Formatter::close_brace("}"); } +pub fn "StrSplitIter^InspectAlt::inspect_alt"(self: &StrSplitIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrSplitNIter^InspectAlt::inspect_alt"(self: &StrSplitNIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitNIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("remaining: "); + Box { value: self.remaining }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrSplitWhitespaceIter^InspectAlt::inspect_alt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitWhitespaceIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrLinesIter^InspectAlt::inspect_alt"(self: &StrLinesIter, f: &mut Formatter) { + f.Formatter::open_brace("StrLinesIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrCharIndicesIter^InspectAlt::inspect_alt"(self: &StrCharIndicesIter, f: &mut Formatter) { + f.Formatter::open_brace("StrCharIndicesIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("byte_index: "); + Box { value: self.byte_index }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9506,6 +13279,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9526,6 +13307,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -9554,6 +13351,26 @@ pub fn "StrCharIter^Display::fmt"(self: &StrCharIter, f: &mut Formatter) { self."StrCharIter^Inspect::inspect"(f); } +pub fn "StrSplitIter^Display::fmt"(self: &StrSplitIter, f: &mut Formatter) { + self."StrSplitIter^Inspect::inspect"(f); +} + +pub fn "StrSplitNIter^Display::fmt"(self: &StrSplitNIter, f: &mut Formatter) { + self."StrSplitNIter^Inspect::inspect"(f); +} + +pub fn "StrSplitWhitespaceIter^Display::fmt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + self."StrSplitWhitespaceIter^Inspect::inspect"(f); +} + +pub fn "StrLinesIter^Display::fmt"(self: &StrLinesIter, f: &mut Formatter) { + self."StrLinesIter^Inspect::inspect"(f); +} + +pub fn "StrCharIndicesIter^Display::fmt"(self: &StrCharIndicesIter, f: &mut Formatter) { + self."StrCharIndicesIter^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9582,6 +13399,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9598,8 +13423,24 @@ pub fn "Fn<2,char>^Display::fmt"(self: &fn(char, char) -> char, f: &mut Formatte self."Fn<2,char>^Inspect::inspect"(f); } -pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^Inspect::inspect"(f); +pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); } pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { @@ -9630,6 +13471,26 @@ pub fn "StrCharIter^DisplayAlt::fmt_alt"(self: &StrCharIter, f: &mut Formatter) self."StrCharIter^InspectAlt::inspect_alt"(f); } +pub fn "StrSplitIter^DisplayAlt::fmt_alt"(self: &StrSplitIter, f: &mut Formatter) { + self."StrSplitIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrSplitNIter^DisplayAlt::fmt_alt"(self: &StrSplitNIter, f: &mut Formatter) { + self."StrSplitNIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrSplitWhitespaceIter^DisplayAlt::fmt_alt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + self."StrSplitWhitespaceIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrLinesIter^DisplayAlt::fmt_alt"(self: &StrLinesIter, f: &mut Formatter) { + self."StrLinesIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrCharIndicesIter^DisplayAlt::fmt_alt"(self: &StrCharIndicesIter, f: &mut Formatter) { + self."StrCharIndicesIter^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -9658,6 +13519,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -9678,6 +13547,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -9698,6 +13583,94 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); } +pub fn "Array>::push"(self: &mut Array<[i32, char]>, value: [i32, char]) with stores[value] { + let used: i32 = self.used; + if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { + self."Array>::grow"(); + } + core::builtin::array_set::<[i32, char]>(self.repr, used, value); + self.used = (used + 1); +} + +pub fn "Array>::grow"(self: &mut Array<[i32, char]>) { + let capacity: i32 = core::builtin::array_len(self.repr); + let new_capacity: i32 = "core::prelude/array.wado::i32_max"((capacity * 2), 4); + let new_repr: builtin::array<[i32, char]> = core::builtin::array_new::<[i32, char]>(new_capacity); + let old_repr: builtin::array<[i32, char]> = self.repr; + let used: i32 = self.used; + __for_0: { + let mut i: i32 = 0; + loop { + if !(i < used) { + break __for_0; + } + __for_0_body: { + core::builtin::array_set::<[i32, char]>(new_repr, i, core::builtin::array_get::<[i32, char]>(old_repr, i)); + } + i = (i + 1); + } + } + self.repr = new_repr; +} + +fn "Array>^SequenceLiteralBuilder::build"(self: &Array<[i32, char]>) -> Array<[i32, char]> { + return *self; +} + +fn "Array>^SequenceLiteralBuilder::new_literal"(capacity: i32) -> Array<[i32, char]> { + return "core::prelude/string.wado::Array>::with_capacity"(capacity); +} + +pub fn "Array>::with_capacity"(capacity: i32) -> Array<[i32, char]> { + return Array> { repr: core::builtin::array_new::<[i32, char]>(capacity), used: 0 }; +} + +pub fn "Array::push"(self: &mut Array, value: String) with stores[value] { + let used: i32 = self.used; + if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { + self."Array::grow"(); + } + core::builtin::array_set::(self.repr, used, value); + self.used = (used + 1); +} + +pub fn "Array::grow"(self: &mut Array) { + let capacity: i32 = core::builtin::array_len(self.repr); + let new_capacity: i32 = "core::prelude/array.wado::i32_max"((capacity * 2), 4); + let new_repr: builtin::array = core::builtin::array_new::(new_capacity); + let old_repr: builtin::array = self.repr; + let used: i32 = self.used; + __for_0: { + let mut i: i32 = 0; + loop { + if !(i < used) { + break __for_0; + } + __for_0_body: { + core::builtin::array_set::(new_repr, i, core::builtin::array_get::(old_repr, i)); + } + i = (i + 1); + } + } + self.repr = new_repr; +} + +fn "Array^SequenceLiteralBuilder::build"(self: &Array) -> Array { + return *self; +} + +fn "Array^SequenceLiteralBuilder::new_literal"(capacity: i32) -> Array { + return "core::prelude/string.wado::Array::with_capacity"(capacity); +} + +pub fn "Array::with_capacity"(capacity: i32) -> Array { + return Array { repr: core::builtin::array_new::(capacity), used: 0 }; +} + +fn "StrCharIter^IntoIterator::into_iter"(self: &StrCharIter) -> StrCharIter { + return *self; +} + pub fn "StrCharIter^Iterator::map"(self: &StrCharIter, f: fn(char) -> char) -> IterMap { return IterMap { inner: *self, f: f }; } @@ -9710,7 +13683,7 @@ pub fn "String::from_iter>"(iter: IterMap = __iter_2."IterMap^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let c: char = __variant_payload(__pattern_temp_0, case=0); - s.String::append_char(c); + s.String::push(c); } else { break; } @@ -9732,7 +13705,7 @@ fn "IterMap^IntoIterator::into_iter"(self: &IterMap::append"(self: &mut Array, value: char) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: char) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -9774,7 +13747,7 @@ pub fn "Array::with_capacity"(capacity: i32) -> Array { return Array { repr: core::builtin::array_new::(capacity), used: 0 }; } -pub fn "Array::append"(self: &mut Array, value: u8) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: u8) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -9833,6 +13806,106 @@ fn __Closure_1::__call(self: &__Closure_1, c: char) -> char { } // --- Module: core:prelude/tuple.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -9906,6 +13979,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -9926,6 +14007,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -9974,6 +14071,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9994,6 +14099,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -10042,6 +14163,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10062,6 +14191,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -10110,6 +14255,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -10130,6 +14283,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -10157,6 +14326,106 @@ pub struct WaitEvent { pub payload: u32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -10267,6 +14536,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -10287,6 +14564,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -10352,6 +14645,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10372,6 +14673,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -10424,6 +14741,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10444,6 +14769,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -10496,6 +14837,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -10516,6 +14865,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -10539,6 +14904,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: // --- Module: wado-compiler/tests/format.fixtures/ops.all.dirty.wado --- global mut __modules_initialized: bool = false; +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -10593,22 +15058,22 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(152); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 3 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 + 2 * 3 == 7\n"); - __r.String::append("2 * 3: "); + __r.String::push_str("\ncondition: 1 + 2 * 3 == 7\n"); + __r.String::push_str("2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 + 2 * 3: "); + __r.String::push_str("\n"); + __r.String::push_str("1 + 2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10620,22 +15085,22 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(152); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 4 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 + 2 * 3 == 9\n"); - __r.String::append("1 + 2: "); + __r.String::push_str("\ncondition: 1 + 2 * 3 == 9\n"); + __r.String::push_str("1 + 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 + 2 * 3: "); + __r.String::push_str("\n"); + __r.String::push_str("1 + 2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10647,22 +15112,22 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(153); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 5 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 2 * 3 + 4 == 14\n"); - __r.String::append("3 + 4: "); + __r.String::push_str("\ncondition: 2 * 3 + 4 == 14\n"); + __r.String::push_str("3 + 4: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("2 * 3 + 4: "); + __r.String::push_str("\n"); + __r.String::push_str("2 * 3 + 4: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10675,26 +15140,26 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(185); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 6 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 2 * 3 + 4 * 5 == 26\n"); - __r.String::append("2 * 3: "); + __r.String::push_str("\ncondition: 2 * 3 + 4 * 5 == 26\n"); + __r.String::push_str("2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("4 * 5: "); + __r.String::push_str("\n"); + __r.String::push_str("4 * 5: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("2 * 3 + 4 * 5: "); + __r.String::push_str("\n"); + __r.String::push_str("2 * 3 + 4 * 5: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10706,22 +15171,22 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(156); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 7 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 10 - 2 * 3 == 24\n"); - __r.String::append("10 - 2: "); + __r.String::push_str("\ncondition: 10 - 2 * 3 == 24\n"); + __r.String::push_str("10 - 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("10 - 2 * 3: "); + __r.String::push_str("\n"); + __r.String::push_str("10 - 2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10733,22 +15198,22 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(154); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 8 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 10 - 2 * 3 == 4\n"); - __r.String::append("2 * 3: "); + __r.String::push_str("\ncondition: 10 - 2 * 3 == 4\n"); + __r.String::push_str("2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("10 - 2 * 3: "); + __r.String::push_str("\n"); + __r.String::push_str("10 - 2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10764,22 +15229,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(155); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 13 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 10 - 3 - 2 == 5\n"); - __r.String::append("10 - 3: "); + __r.String::push_str("\ncondition: 10 - 3 - 2 == 5\n"); + __r.String::push_str("10 - 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("10 - 3 - 2: "); + __r.String::push_str("\n"); + __r.String::push_str("10 - 3 - 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10791,22 +15256,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(154); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 14 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 10 - 3 - 2 == 9\n"); - __r.String::append("3 - 2: "); + __r.String::push_str("\ncondition: 10 - 3 - 2 == 9\n"); + __r.String::push_str("3 - 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("10 - 3 - 2: "); + __r.String::push_str("\n"); + __r.String::push_str("10 - 3 - 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10818,22 +15283,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(152); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 15 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 8 / 2 / 2 == 2\n"); - __r.String::append("8 / 2: "); + __r.String::push_str("\ncondition: 8 / 2 / 2 == 2\n"); + __r.String::push_str("8 / 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("8 / 2 / 2: "); + __r.String::push_str("\n"); + __r.String::push_str("8 / 2 / 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10845,22 +15310,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(152); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 16 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 8 / 2 / 2 == 8\n"); - __r.String::append("2 / 2: "); + __r.String::push_str("\ncondition: 8 / 2 / 2 == 8\n"); + __r.String::push_str("2 / 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("8 / 2 / 2: "); + __r.String::push_str("\n"); + __r.String::push_str("8 / 2 / 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10872,22 +15337,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(155); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 17 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 15 % 7 % 3 == 1\n"); - __r.String::append("15 % 7: "); + __r.String::push_str("\ncondition: 15 % 7 % 3 == 1\n"); + __r.String::push_str("15 % 7: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("15 % 7 % 3: "); + __r.String::push_str("\n"); + __r.String::push_str("15 % 7 % 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10899,22 +15364,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(154); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 18 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 15 % 7 % 3 == 0\n"); - __r.String::append("7 % 3: "); + __r.String::push_str("\ncondition: 15 % 7 % 3 == 0\n"); + __r.String::push_str("7 % 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("15 % 7 % 3: "); + __r.String::push_str("\n"); + __r.String::push_str("15 % 7 % 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10930,22 +15395,22 @@ fn __test_2_shift() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(155); - __r.String::append("Assertion failed in "); - __r.String::append("__test_2_shift"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_2_shift"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 23 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 + 1 << 3 == 16\n"); - __r.String::append("1 + 1: "); + __r.String::push_str("\ncondition: 1 + 1 << 3 == 16\n"); + __r.String::push_str("1 + 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 + 1 << 3: "); + __r.String::push_str("\n"); + __r.String::push_str("1 + 1 << 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10957,22 +15422,22 @@ fn __test_2_shift() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(155); - __r.String::append("Assertion failed in "); - __r.String::append("__test_2_shift"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_2_shift"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 24 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 << 3 + 1 == 9\n"); - __r.String::append("1 << 3: "); + __r.String::push_str("\ncondition: 1 << 3 + 1 == 9\n"); + __r.String::push_str("1 << 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 << 3 + 1: "); + __r.String::push_str("\n"); + __r.String::push_str("1 << 3 + 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10984,22 +15449,22 @@ fn __test_2_shift() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(154); - __r.String::append("Assertion failed in "); - __r.String::append("__test_2_shift"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_2_shift"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 25 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 << 2 + 1 == 8\n"); - __r.String::append("2 + 1: "); + __r.String::push_str("\ncondition: 1 << 2 + 1 == 8\n"); + __r.String::push_str("2 + 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 << 2 + 1: "); + __r.String::push_str("\n"); + __r.String::push_str("1 << 2 + 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11012,26 +15477,26 @@ fn __test_2_shift() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(190); - __r.String::append("Assertion failed in "); - __r.String::append("__test_2_shift"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_2_shift"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 26 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 << 2 + 1 << 1 == 6\n"); - __r.String::append("1 << 2: "); + __r.String::push_str("\ncondition: 1 << 2 + 1 << 1 == 6\n"); + __r.String::push_str("1 << 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 << 1: "); + __r.String::push_str("\n"); + __r.String::push_str("1 << 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 << 2 + 1 << 1: "); + __r.String::push_str("\n"); + __r.String::push_str("1 << 2 + 1 << 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11043,22 +15508,22 @@ fn __test_2_shift() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(158); - __r.String::append("Assertion failed in "); - __r.String::append("__test_2_shift"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_2_shift"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 27 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 16 >> 1 - 1 == 7\n"); - __r.String::append("16 >> 1: "); + __r.String::push_str("\ncondition: 16 >> 1 - 1 == 7\n"); + __r.String::push_str("16 >> 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("16 >> 1 - 1: "); + __r.String::push_str("\n"); + __r.String::push_str("16 >> 1 - 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11073,18 +15538,18 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(140); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 32 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b1100 & 0b1010 == 8\n"); - __r.String::append("0b1100 & 0b1010: "); + __r.String::push_str("\ncondition: 0b1100 & 0b1010 == 8\n"); + __r.String::push_str("0b1100 & 0b1010: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11096,22 +15561,22 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(192); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 33 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b0111 | 0b1010 & 0b0101 == 7\n"); - __r.String::append("0b1010 & 0b0101: "); + __r.String::push_str("\ncondition: 0b0111 | 0b1010 & 0b0101 == 7\n"); + __r.String::push_str("0b1010 & 0b0101: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("0b0111 | 0b1010 & 0b0101: "); + __r.String::push_str("\n"); + __r.String::push_str("0b0111 | 0b1010 & 0b0101: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11123,22 +15588,22 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(193); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 34 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b1100 | 0b0011 & 0b1010 == 10\n"); - __r.String::append("0b1100 | 0b0011: "); + __r.String::push_str("\ncondition: 0b1100 | 0b0011 & 0b1010 == 10\n"); + __r.String::push_str("0b1100 | 0b0011: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("0b1100 | 0b0011 & 0b1010: "); + __r.String::push_str("\n"); + __r.String::push_str("0b1100 | 0b0011 & 0b1010: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11150,22 +15615,22 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(192); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 35 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b1010 ^ 0b1100 & 0b1111 == 6\n"); - __r.String::append("0b1100 & 0b1111: "); + __r.String::push_str("\ncondition: 0b1010 ^ 0b1100 & 0b1111 == 6\n"); + __r.String::push_str("0b1100 & 0b1111: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("0b1010 ^ 0b1100 & 0b1111: "); + __r.String::push_str("\n"); + __r.String::push_str("0b1010 ^ 0b1100 & 0b1111: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11177,22 +15642,22 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(192); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 36 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b1010 ^ 0b1100 & 0b1111 == 6\n"); - __r.String::append("0b1010 ^ 0b1100: "); + __r.String::push_str("\ncondition: 0b1010 ^ 0b1100 & 0b1111 == 6\n"); + __r.String::push_str("0b1010 ^ 0b1100: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("0b1010 ^ 0b1100 & 0b1111: "); + __r.String::push_str("\n"); + __r.String::push_str("0b1010 ^ 0b1100 & 0b1111: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11204,22 +15669,22 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(193); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 37 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b1010 | 0b0110 ^ 0b0001 == 15\n"); - __r.String::append("0b1010 | 0b0110: "); + __r.String::push_str("\ncondition: 0b1010 | 0b0110 ^ 0b0001 == 15\n"); + __r.String::push_str("0b1010 | 0b0110: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("0b1010 | 0b0110 ^ 0b0001: "); + __r.String::push_str("\n"); + __r.String::push_str("0b1010 | 0b0110 ^ 0b0001: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11235,18 +15700,18 @@ fn __test_4_logical() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(115); - __r.String::append("Assertion failed in "); - __r.String::append("__test_4_logical"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_4_logical"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 43 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: a == true\n"); - __r.String::append("a: "); + __r.String::push_str("\ncondition: a == true\n"); + __r.String::push_str("a: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11258,18 +15723,18 @@ fn __test_4_logical() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(115); - __r.String::append("Assertion failed in "); - __r.String::append("__test_4_logical"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_4_logical"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 45 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: b == true\n"); - __r.String::append("b: "); + __r.String::push_str("\ncondition: b == true\n"); + __r.String::push_str("b: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11281,18 +15746,18 @@ fn __test_4_logical() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(116); - __r.String::append("Assertion failed in "); - __r.String::append("__test_4_logical"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_4_logical"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 47 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: c == false\n"); - __r.String::append("c: "); + __r.String::push_str("\ncondition: c == false\n"); + __r.String::push_str("c: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11304,18 +15769,18 @@ fn __test_4_logical() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(115); - __r.String::append("Assertion failed in "); - __r.String::append("__test_4_logical"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_4_logical"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.all.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 49 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: d == true\n"); - __r.String::append("d: "); + __r.String::push_str("\ncondition: d == true\n"); + __r.String::push_str("d: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11350,6 +15815,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -11370,6 +15843,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -11418,6 +15907,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11438,6 +15935,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -11486,6 +15999,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11506,6 +16027,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -11554,6 +16091,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -11574,6 +16119,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -11607,6 +16168,106 @@ fn __initialize_modules() { } // --- Module: wasi:cli/types.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -11716,6 +16377,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -11736,6 +16405,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -11788,6 +16473,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11804,8 +16497,24 @@ pub fn "Fn<2,char>^InspectAlt::inspect_alt"(self: &fn(char, char) -> char, f: &m self."Fn<2,char>^Inspect::inspect"(f); } -pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^Inspect::inspect"(f); +pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); } pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { @@ -11860,6 +16569,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11880,6 +16597,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -11932,6 +16665,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -11952,6 +16693,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -11977,6 +16734,106 @@ pub struct ConvertError { pub message: String, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -12109,6 +16966,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -12129,6 +16994,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -12190,6 +17071,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12210,6 +17099,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -12266,6 +17171,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12286,6 +17199,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -12342,6 +17271,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -12362,6 +17299,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -12394,6 +17347,106 @@ pub struct Formatter { pub buf: &mut String, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -12450,11 +17503,11 @@ pub fn Formatter::new(buf: &mut String) -> Formatter with stores[buf] { } pub fn Formatter::write_str(self: &mut Formatter, s: String) { - self.buf.String::append(s); + self.buf.String::push_str(s); } pub fn Formatter::write_char(self: &mut Formatter, c: char) { - self.buf.String::append_char(c); + self.buf.String::push(c); } pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { @@ -12465,7 +17518,7 @@ pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { break __for_0; } __for_0_body: { - self.buf.String::append_char(c); + self.buf.String::push(c); } i = (i + 1); } @@ -12475,7 +17528,7 @@ pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { pub fn Formatter::pad(self: &mut Formatter, content: String) { let content_len: i32 = content.String::len(); if ((self.width <= 0) || (content_len >= self.width)) { - self.buf.String::append(content); + self.buf.String::push_str(content); return; } let padding: i32 = (self.width - content_len); @@ -12484,7 +17537,7 @@ pub fn Formatter::pad(self: &mut Formatter, content: String) { Left => true, _ => false, } { - self.buf.String::append(content); + self.buf.String::push_str(content); self.Formatter::write_char_n(self.fill, padding); } else { if match align { @@ -12494,11 +17547,11 @@ pub fn Formatter::pad(self: &mut Formatter, content: String) { let left_pad: i32 = (padding / 2); let right_pad: i32 = (padding - left_pad); self.Formatter::write_char_n(self.fill, left_pad); - self.buf.String::append(content); + self.buf.String::push_str(content); self.Formatter::write_char_n(self.fill, right_pad); } else { self.Formatter::write_char_n(self.fill, padding); - self.buf.String::append(content); + self.buf.String::push_str(content); } } } @@ -12611,20 +17664,20 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre let content_len: i32 = ((sign_len + prefix_len) + digit_count); if ((self.width <= 0) || (content_len >= self.width)) { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } return self.buf.String::internal_reserve_uninit(digit_count); } let padding: i32 = (self.width - content_len); if self.zero_pad { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } self.Formatter::write_char_n('0', padding); return self.buf.String::internal_reserve_uninit(digit_count); @@ -12635,10 +17688,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre _ => false, } { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } let offset: i32 = self.buf.String::internal_reserve_uninit(digit_count); self.Formatter::write_char_n(self.fill, padding); @@ -12652,10 +17705,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre let right_pad: i32 = (padding - left_pad); self.Formatter::write_char_n(self.fill, left_pad); if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } let offset: i32 = self.buf.String::internal_reserve_uninit(digit_count); self.Formatter::write_char_n(self.fill, right_pad); @@ -12663,10 +17716,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre } else { self.Formatter::write_char_n(self.fill, padding); if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } return self.buf.String::internal_reserve_uninit(digit_count); } @@ -12852,6 +17905,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -12872,6 +17933,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -12924,6 +18001,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12944,6 +18029,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -12996,6 +18097,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -13016,6 +18125,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -13068,6 +18193,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -13088,6 +18221,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } diff --git a/wado-compiler/tests/format.fixtures.golden/ops.mess.lower.wado b/wado-compiler/tests/format.fixtures.golden/ops.mess.lower.wado index 450d23144..a0a70902a 100644 --- a/wado-compiler/tests/format.fixtures.golden/ops.mess.lower.wado +++ b/wado-compiler/tests/format.fixtures.golden/ops.mess.lower.wado @@ -1,6 +1,106 @@ // --- Module: core:allocator --- global mut heap_offset: i32 = 8; +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -119,6 +219,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -139,6 +247,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -187,6 +311,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -207,6 +339,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -255,6 +403,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -275,6 +431,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -323,6 +495,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -343,6 +523,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -364,6 +560,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:builtin --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -1189,6 +1485,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -1209,6 +1513,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -1257,6 +1577,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1277,6 +1605,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -1325,6 +1669,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1345,6 +1697,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -1393,6 +1761,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -1413,6 +1789,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -1434,61 +1826,161 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:internal --- -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, -} - -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, } -pub struct "IterSkip" { - pub inner: StrUtf8ByteIter, +pub struct "IterSkip" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrUtf8ByteIter, +pub struct "IterTake" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrUtf8ByteIter, +pub struct "IterEnumerate" { + pub inner: StrLinesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrUtf8ByteIter, - pub pred: fn(u8) -> bool, +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, } -pub struct "Box" { - value: f64, +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, } -pub struct "Box" { - value: f32, +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, } -pub struct "Box" { - value: bool, +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrUtf8ByteIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrUtf8ByteIter, + pub pred: fn(u8) -> bool, +} + +pub struct "Box" { + value: f64, +} + +pub struct "Box" { + value: f32, +} + +pub struct "Box" { + value: bool, } pub struct "Box" { @@ -1817,6 +2309,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -1837,6 +2337,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -1885,6 +2401,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1905,6 +2429,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -1953,6 +2493,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -1973,6 +2521,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -2021,6 +2585,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -2041,6 +2613,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -2086,6 +2674,106 @@ fn "core/builtin/array_copy"(dst: builtin::array, dst_offset: i32, src: fn "core/builtin/array_new"(len: i32) -> builtin::array; // --- Module: core:prelude --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -2159,6 +2847,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -2179,6 +2875,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -2227,6 +2939,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2247,6 +2967,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -2295,6 +3031,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2315,6 +3059,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -2363,6 +3123,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -2383,6 +3151,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -2404,13 +3188,113 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:prelude/array.wado --- -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, } -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, pub remaining: i32, } @@ -2485,6 +3369,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -2505,6 +3397,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -2553,6 +3461,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2573,6 +3489,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -2621,6 +3553,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -2641,6 +3581,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -2689,6 +3645,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -2709,6 +3673,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -2749,6 +3729,106 @@ pub struct FormatResult { pub exponent: i32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -3127,20 +4207,20 @@ pub fn fixed_width(f: f64, n: i32) -> FormatResult { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(131); - __r.String::append("Assertion failed in "); - __r.String::append("fixed_width"); - __r.String::append(" at "); - __r.String::append("core:prelude/fpfmt.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("fixed_width"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/fpfmt.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 289 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("digits must be <= 18"); - __r.String::append("\ncondition: n <= 18\n"); - __r.String::append("n: "); + __r.String::push_str(": "); + __r.String::push_str("digits must be <= 18"); + __r.String::push_str("\ncondition: n <= 18\n"); + __r.String::push_str("n: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -3369,7 +4449,7 @@ fn fill_zeros(buf: &mut String, n: i32) { pub fn write_decimal(buf: &mut String, d: u64, p: i32, nd: i32) { let decimal_pos: i32 = (nd + p); if (decimal_pos <= 0) { - buf.String::append("0."); + buf.String::push_str("0."); "core::prelude/fpfmt.wado::fill_zeros"(buf, -decimal_pos); let digit_offset: i32 = buf.String::len(); "core::prelude/fpfmt.wado::fill_zeros"(buf, nd); @@ -3421,13 +4501,13 @@ pub fn write_exp(buf: &mut String, d: u64, p: i32, nd: i32, upper: bool) { "core::prelude/fpfmt.wado::fill_zeros"(buf, 1); "core::prelude/fpfmt.wado::write_digits_at"(buf, start, d, 1); } - buf.String::append(if upper { + buf.String::push_str(if upper { "E"; } else { "e"; }); if (exp < 0) { - buf.String::append("-"); + buf.String::push_str("-"); } let abs_exp: i32 = if (exp < 0) { -exp; @@ -3435,15 +4515,15 @@ pub fn write_exp(buf: &mut String, d: u64, p: i32, nd: i32, upper: bool) { exp; }; if (abs_exp < 10) { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); } else { if (abs_exp < 100) { - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); } else { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); } } } @@ -3462,7 +4542,7 @@ pub fn write_decimal_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: let decimal_pos: i32 = (nd + p); if (decimal_pos <= 0) { let leading_zeros: i32 = -decimal_pos; - buf.String::append("0."); + buf.String::push_str("0."); if (precision <= leading_zeros) { "core::prelude/fpfmt.wado::fill_zeros"(buf, precision); return; @@ -3495,7 +4575,7 @@ pub fn write_decimal_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: "core::prelude/fpfmt.wado::write_digits_at"(buf, start, d, nd); "core::prelude/fpfmt.wado::fill_zeros"(buf, (decimal_pos - nd)); if (precision > 0) { - buf.String::append("."); + buf.String::push_str("."); "core::prelude/fpfmt.wado::fill_zeros"(buf, precision); } } else { @@ -3583,13 +4663,13 @@ pub fn write_exp_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: i32, "core::prelude/fpfmt.wado::write_digits_at"(buf, start, first_d, 1); } let exp: i32 = ((p + nd) - 1); - buf.String::append(if upper { + buf.String::push_str(if upper { "E"; } else { "e"; }); if (exp < 0) { - buf.String::append("-"); + buf.String::push_str("-"); } let abs_exp: i32 = if (exp < 0) { -exp; @@ -3597,15 +4677,15 @@ pub fn write_exp_prec(buf: &mut String, d: u64, p: i32, nd: i32, precision: i32, exp; }; if (abs_exp < 10) { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + abs_exp as u32))); } else { if (abs_exp < 100) { - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"(abs_exp)); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"(abs_exp)); } else { - buf.String::append_char("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); - buf.String::append_char("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); + buf.String::push("core::prelude/primitive.wado::char::from_u32_unchecked"(('0' as u32 + (abs_exp / 100) as u32))); + buf.String::push("core::prelude/fpfmt.wado::i2a_first"((abs_exp % 100))); + buf.String::push("core::prelude/fpfmt.wado::i2a_second"((abs_exp % 100))); } } } @@ -3943,6 +5023,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -3963,6 +5051,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -4054,6 +5158,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -4074,6 +5186,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -4138,6 +5266,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -4158,6 +5294,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -4222,6 +5374,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -4242,6 +5402,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -4267,10 +5443,10 @@ fn "Array^SequenceLiteralBuilder::build"(self: &Array) -> Array { } fn "Array^SequenceLiteralBuilder::push_literal"(self: &mut Array, value: u64) with stores[value] { - self."Array::append"(value); + self."Array::push"(value); } -pub fn "Array::append"(self: &mut Array, value: u64) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: u64) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -4355,57 +5531,157 @@ pub struct i128 { high: i64, } -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, -} - -pub struct "IterSkip" { - pub inner: StrCharIter, +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrCharIter, +pub struct "IterTake" { + pub inner: StrCharIndicesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrCharIter, +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrCharIter, - pub pred: fn(char) -> bool, +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, } -pub struct "IterSkip" { - pub inner: StrUtf8ByteIter, +pub struct "IterSkip" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterTake" { - pub inner: StrUtf8ByteIter, +pub struct "IterTake" { + pub inner: StrLinesIter, pub remaining: i32, } -pub struct "IterEnumerate" { - pub inner: StrUtf8ByteIter, +pub struct "IterEnumerate" { + pub inner: StrLinesIter, pub count: i32, } -pub struct "IterFilter" { - pub inner: StrUtf8ByteIter, - pub pred: fn(u8) -> bool, +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, } -pub fn u128::from_u64(value: u64) -> u128 { - return u128 { low: value, high: 0 }; +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, } -pub fn u128::from_pair(low: u64, high: u64) -> u128 { - return u128 { low: low, high: high }; +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIter, + pub pred: fn(char) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrUtf8ByteIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrUtf8ByteIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrUtf8ByteIter, + pub pred: fn(u8) -> bool, +} + +pub fn u128::from_u64(value: u64) -> u128 { + return u128 { low: value, high: 0 }; +} + +pub fn u128::from_pair(low: u64, high: u64) -> u128 { + return u128 { low: low, high: high }; } pub fn u128::from_string(s: String) -> u128 { @@ -5306,6 +6582,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -5326,6 +6610,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -5374,6 +6674,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -5394,6 +6702,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -5442,6 +6766,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -5462,6 +6794,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -5518,6 +6866,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -5538,6 +6894,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -5559,6 +6931,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: } // --- Module: core:prelude/primitive.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -5816,7 +7288,7 @@ pub fn char::from_u32_unchecked(value: u32) -> char { pub fn char::to_string(self: Box) -> String { let mut buf: String = "core::prelude/string.wado::String::with_capacity"(4); - buf.String::append_char(self.value); + buf.String::push(self.value); return buf; } @@ -6219,24 +7691,24 @@ fn fmt_float_special(f: &mut Formatter, is_neg: bool, kind: SpecialKind, zero_re NaN => true, _ => false, } { - f.buf.String::append("NaN"); + f.buf.String::push_str("NaN"); } else { if match kind { Inf => true, _ => false, } { - f.buf.String::append(if is_neg { + f.buf.String::push_str(if is_neg { "-inf"; } else { "inf"; }); } else { - f.buf.String::append(if is_neg { + f.buf.String::push_str(if is_neg { "-"; } else { ""; }); - f.buf.String::append(zero_repr); + f.buf.String::push_str(zero_repr); } } f.Formatter::apply_padding(mark); @@ -6244,10 +7716,10 @@ fn fmt_float_special(f: &mut Formatter, is_neg: bool, kind: SpecialKind, zero_re fn fmt_float_sign(f: &mut Formatter, is_neg: bool) { if is_neg { - f.buf.String::append("-"); + f.buf.String::push_str("-"); } else { if f.sign_plus { - f.buf.String::append("+"); + f.buf.String::push_str("+"); } } } @@ -6310,7 +7782,7 @@ fn f32::inspect_into(self: Box, f: &mut Formatter) { } else { if (p >= 0) { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); - f.buf.String::append(".0"); + f.buf.String::push_str(".0"); } else { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); } @@ -6552,7 +8024,7 @@ fn f64::inspect_into(self: Box, f: &mut Formatter) { } else { if (p >= 0) { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); - f.buf.String::append(".0"); + f.buf.String::push_str(".0"); } else { "core::prelude/fpfmt.wado::write_decimal"(f.buf, d, p, nd); } @@ -6579,9 +8051,9 @@ fn f64::fmt_fixed(self: Box, precision: i32, f: &mut Formatter) { } let mark: i32 = f.Formatter::mark(); "core::prelude/primitive.wado::fmt_float_sign"(f, is_neg); - f.buf.String::append("0"); + f.buf.String::push_str("0"); if (precision > 0) { - f.buf.String::append("."); + f.buf.String::push_str("."); f.buf.String::append_byte_filled('0' as u8, precision); } f.Formatter::apply_padding(mark); @@ -6622,17 +8094,17 @@ fn f64::fmt_exp(self: Box, precision: i32, upper: i32, f: &mut Formatter) { } let mark: i32 = f.Formatter::mark(); "core::prelude/primitive.wado::fmt_float_sign"(f, is_neg); - f.buf.String::append("0"); + f.buf.String::push_str("0"); if (precision > 0) { - f.buf.String::append("."); + f.buf.String::push_str("."); f.buf.String::append_byte_filled('0' as u8, precision); } - f.buf.String::append(if upper_bool { + f.buf.String::push_str(if upper_bool { "E"; } else { "e"; }); - f.buf.String::append("0"); + f.buf.String::push_str("0"); f.Formatter::apply_padding(mark); return; } @@ -6837,7 +8309,7 @@ pub fn "char^Display::fmt"(self: Box, f: &mut Formatter) { f.Formatter::write_char(self.value); } else { let mut s: String = "core::prelude/string.wado::String::with_capacity"(4); - s.String::append_char(self.value); + s.String::push(self.value); f.Formatter::pad(s); } } @@ -7901,7 +9373,7 @@ pub fn "i32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i32"); + __r.String::push_str(" out of range for i32"); break __tmpl: __r; })); } @@ -7914,7 +9386,7 @@ pub fn "i16^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i16"); + __r.String::push_str(" out of range for i16"); break __tmpl: __r; })); } @@ -7927,7 +9399,7 @@ pub fn "i8^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -7940,7 +9412,7 @@ pub fn "i16^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for i16"); + __r.String::push_str(" out of range for i16"); break __tmpl: __r; })); } @@ -7953,7 +9425,7 @@ pub fn "i8^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -7966,7 +9438,7 @@ pub fn "i8^TryFrom::try_from"(value: i16) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i16^Display::fmt"(&mut __f); - __r.String::append(" out of range for i8"); + __r.String::push_str(" out of range for i8"); break __tmpl: __r; })); } @@ -7979,7 +9451,7 @@ pub fn "u32^TryFrom::try_from"(value: i32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -7992,7 +9464,7 @@ pub fn "u64^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u64"); + __r.String::push_str(" out of range for u64"); break __tmpl: __r; })); } @@ -8005,7 +9477,7 @@ pub fn "u32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -8018,7 +9490,7 @@ pub fn "i64^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" out of range for i64"); + __r.String::push_str(" out of range for i64"); break __tmpl: __r; })); } @@ -8031,7 +9503,7 @@ pub fn "u32^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" out of range for u32"); + __r.String::push_str(" out of range for u32"); break __tmpl: __r; })); } @@ -8044,7 +9516,7 @@ pub fn "u16^TryFrom::try_from"(value: u32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(37); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u16"); + __r.String::push_str(" out of range for u16"); break __tmpl: __r; })); } @@ -8057,7 +9529,7 @@ pub fn "u8^TryFrom::try_from"(value: u32) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u32^Display::fmt"(&mut __f); - __r.String::append(" out of range for u8"); + __r.String::push_str(" out of range for u8"); break __tmpl: __r; })); } @@ -8070,7 +9542,7 @@ pub fn "u8^TryFrom::try_from"(value: u16) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(36); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u16^Display::fmt"(&mut __f); - __r.String::append(" out of range for u8"); + __r.String::push_str(" out of range for u8"); break __tmpl: __r; })); } @@ -8084,7 +9556,7 @@ pub fn "f32^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f32"); + __r.String::push_str(" cannot be exactly represented as f32"); break __tmpl: __r; })); } @@ -8098,7 +9570,7 @@ pub fn "f64^TryFrom::try_from"(value: i64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."i64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f64"); + __r.String::push_str(" cannot be exactly represented as f64"); break __tmpl: __r; })); } @@ -8111,7 +9583,7 @@ pub fn "f64^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f64"); + __r.String::push_str(" cannot be exactly represented as f64"); break __tmpl: __r; })); } @@ -8124,7 +9596,7 @@ pub fn "f32^TryFrom::try_from"(value: u64) -> Result { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(53); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: value }."u64^Display::fmt"(&mut __f); - __r.String::append(" cannot be exactly represented as f32"); + __r.String::push_str(" cannot be exactly represented as f32"); break __tmpl: __r; })); } @@ -8159,6 +9631,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -8179,6 +9659,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -8227,6 +9723,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -8247,6 +9751,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -8295,6 +9815,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -8315,6 +9843,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -8363,6 +9907,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -8383,6 +9935,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -8439,12 +10007,150 @@ pub struct StrCharIter { byte_index: i32, } -pub struct "IterMap" { - pub inner: StrCharIter, - pub f: fn(char) -> char, +pub struct StrSplitIter { + repr: builtin::array, + used: i32, + pos: i32, + sep_repr: builtin::array, + sep_len: i32, + finished: bool, } -pub struct "IterSkip" { +pub struct StrSplitNIter { + repr: builtin::array, + used: i32, + pos: i32, + sep_repr: builtin::array, + sep_len: i32, + remaining: i32, + finished: bool, +} + +pub struct StrSplitWhitespaceIter { + repr: builtin::array, + used: i32, + pos: i32, +} + +pub struct StrLinesIter { + repr: builtin::array, + used: i32, + pos: i32, + finished: bool, +} + +pub struct StrCharIndicesIter { + repr: builtin::array, + used: i32, + byte_index: i32, +} + +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterMap" { + pub inner: StrCharIter, + pub f: fn(char) -> char, +} + +pub struct "IterSkip" { pub inner: StrCharIter, pub remaining: i32, } @@ -8582,7 +10288,7 @@ pub fn String::append_byte_filled(self: &mut String, byte: u8, n: i32) { self.used = new_used; } -pub fn String::append(self: &mut String, other: String) { +pub fn String::push_str(self: &mut String, other: String) { let other_len: i32 = other.String::len(); if (other_len == 0) { return; @@ -8595,6 +10301,10 @@ pub fn String::append(self: &mut String, other: String) { self.used = new_used; } +pub fn String::append(self: &mut String, other: String) { + self.String::push_str(other); +} + pub fn String::concat(a: String, b: String) -> String { let len_a: i32 = a.String::len(); let len_b: i32 = b.String::len(); @@ -8688,7 +10398,7 @@ pub fn "StrUtf8ByteIter^Iterator::collect"(self: &mut StrUtf8ByteIter) -> Array< let __pattern_temp_0: Option = self."StrUtf8ByteIter^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let item: u8 = __variant_payload(__pattern_temp_0, case=0); - result."Array::append"(item); + result."Array::push"(item); } else { break; } @@ -8876,7 +10586,7 @@ pub fn "StrCharIter^Iterator::collect"(self: &mut StrCharIter) -> Array { let __pattern_temp_0: Option = self."StrCharIter^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let item: char = __variant_payload(__pattern_temp_0, case=0); - result."Array::append"(item); + result."Array::push"(item); } else { break; } @@ -9033,7 +10743,7 @@ pub fn String::chars(self: &String) -> StrCharIter { return StrCharIter { repr: self.repr, used: self.used, byte_index: 0 }; } -pub fn String::append_char(self: &mut String, c: char) { +pub fn String::push(self: &mut String, c: char) { let code: u32 = c as u32; if core::builtin::unlikely(((self.used + 4) > core::builtin::array_len(self.repr))) { self.String::grow((self.used + 4)); @@ -9063,7 +10773,11 @@ pub fn String::append_char(self: &mut String, c: char) { } } -pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { +pub fn String::append_char(self: &mut String, c: char) { + self.String::push(c); +} + +pub fn String::truncate(self: &mut String, byte_len: i32) { if (byte_len >= self.used) { return; } @@ -9073,20 +10787,20 @@ pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(144); - __r.String::append("Assertion failed in "); - __r.String::append("String::truncate_bytes"); - __r.String::append(" at "); - __r.String::append("core:prelude/string.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::truncate"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); - Box { value: 355 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("negative length"); - __r.String::append("\ncondition: byte_len >= 0\n"); - __r.String::append("byte_len: "); + Box { value: 365 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("negative length"); + __r.String::push_str("\ncondition: byte_len >= 0\n"); + __r.String::push_str("byte_len: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -9102,32 +10816,32 @@ pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); - __r.String::append("Assertion failed in "); - __r.String::append("String::truncate_bytes"); - __r.String::append(" at "); - __r.String::append("core:prelude/string.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::truncate"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); - Box { value: 360 }."i32^Display::fmt"(&mut __f); - __r.String::append(": "); - __r.String::append("not on a UTF-8 character boundary"); - __r.String::append("\ncondition: b < 0x80 || b >= 0xC0\n"); - __r.String::append("b: "); + Box { value: 370 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b < 0x80: "); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b: "); + __r.String::push_str("\n"); + __r.String::push_str("b: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("b >= 0xC0: "); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -9162,6 +10876,78 @@ pub fn String::truncate_chars(self: &mut String, char_count: i32) { self.used = byte_pos; } +pub fn String::truncate_bytes(self: &mut String, byte_len: i32) { + self.String::truncate(byte_len); +} + +pub fn String::pop(self: &mut String) -> Option { + if (self.used == 0) { + return null; + } + let mut pos: i32 = (self.used - 1); + loop { + if !(pos > 0) { + break; + } + let b: u8 = core::builtin::array_get_u8(self.repr, pos); + if ((b >= 0x80) && (b < 0xC0)) { + pos = (pos - 1); + } else { + break; + } + } + let b0: u32 = core::builtin::array_get_u8(self.repr, pos) as u32; + let code: u32 = if (b0 < 0x80) { + b0; + } else { + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + (((b0 & 0x1F) << 6) | (b1 & 0x3F)); + } else { + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (pos + 2)) as u32; + ((((b0 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + } else { + let b1: u32 = core::builtin::array_get_u8(self.repr, (pos + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (pos + 2)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (pos + 3)) as u32; + (((((b0 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + }; + }; + }; + self.used = pos; + return Option::Some("core::prelude/primitive.wado::char::from_u32_unchecked"(code)); +} + +pub fn String::clear(self: &mut String) { + self.used = 0; +} + +pub fn String::capacity(self: &String) -> i32 { + return core::builtin::array_len(self.repr); +} + +pub fn String::reserve(self: &mut String, additional: i32) { + let required: i32 = (self.used + additional); + if (required > core::builtin::array_len(self.repr)) { + self.String::grow(required); + } +} + +pub fn String::shrink_to_fit(self: &mut String) { + let capacity: i32 = core::builtin::array_len(self.repr); + if (capacity > self.used) { + let new_repr: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(self.used); + "core::prelude/string.wado::core/builtin/array_copy"(new_repr, 0, self.repr, 0, self.used); + self.repr = new_repr; + } +} + +pub fn String::as_bytes(self: &String) -> Array { + return self.String::bytes()."StrUtf8ByteIter^Iterator::collect"(); +} + pub fn String::trim_ascii_start(self: &String) -> String { let mut start: i32 = 0; loop { @@ -9300,84 +11086,1930 @@ fn String::internal_substr_bytes(self: &String, start: i32, end: i32) -> String return String { repr: repr, used: len }; } -pub fn "String^Default::default"() -> String { - return ""; +pub fn String::contains(self: &String, pat: String) -> bool { + return match self.String::find(pat) { + Some(_) => true, + _ => false, + }; } -pub fn "String^From::from"(value: char) -> String { - let mut s: String = "core::prelude/string.wado::String::with_capacity"(4); - s.String::append_char(value); - return s; +pub fn String::starts_with(self: &String, pat: String) -> bool { + let pat_len: i32 = pat.String::len(); + if (pat_len > self.used) { + return false; + } + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + __for_3: { + let mut i: i32 = 0; + loop { + if !(i < pat_len) { + break __for_3; + } + __for_3_body: { + if (core::builtin::array_get_u8(self.repr, i) != core::builtin::array_get_u8(pat_repr, i)) { + return false; + } + } + i = (i + 1); + } + } + return true; } -pub fn "StrUtf8ByteIter^Eq::eq"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> bool { - return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.index }."i32^Eq::eq"(Box { value: other.index })); +pub fn String::ends_with(self: &String, pat: String) -> bool { + let pat_len: i32 = pat.String::len(); + if (pat_len > self.used) { + return false; + } + let offset: i32 = (self.used - pat_len); + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + __for_4: { + let mut i: i32 = 0; + loop { + if !(i < pat_len) { + break __for_4; + } + __for_4_body: { + if (core::builtin::array_get_u8(self.repr, (offset + i)) != core::builtin::array_get_u8(pat_repr, i)) { + return false; + } + } + i = (i + 1); + } + } + return true; } -pub fn "StrUtf8ByteIter^Ord::cmp"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> Ordering { - let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); - if (c != Ordering::Equal) { - return c; +pub fn String::find(self: &String, pat: String) -> Option { + let pat_len: i32 = pat.String::len(); + if (pat_len == 0) { + return Option::Some(0); } - let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); - if (c != Ordering::Equal) { - return c; + if (pat_len > self.used) { + return null; } - let c: Ordering = Box { value: self.index }."i32^Ord::cmp"(Box { value: other.index }); - if (c != Ordering::Equal) { - return c; + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + let limit: i32 = (self.used - pat_len); + __for_5: { + let mut i: i32 = 0; + loop { + if !(i <= limit) { + break __for_5; + } + __for_5_body: { + let mut matched: bool = true; + __for_6: { + let mut j: i32 = 0; + loop { + if !(j < pat_len) { + break __for_6; + } + __for_6_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(pat_repr, j)) { + matched = false; + break __for_6; + } + } + j = (j + 1); + } + } + if matched { + return Option::Some(i); + } + } + i = (i + 1); + } } - return Ordering::Equal; -} - -pub fn "StrCharIter^Eq::eq"(self: &StrCharIter, other: &StrCharIter) -> bool { - return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.byte_index }."i32^Eq::eq"(Box { value: other.byte_index })); + return null; } -pub fn "StrCharIter^Ord::cmp"(self: &StrCharIter, other: &StrCharIter) -> Ordering { - let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); - if (c != Ordering::Equal) { - return c; +pub fn String::rfind(self: &String, pat: String) -> Option { + let pat_len: i32 = pat.String::len(); + if (pat_len == 0) { + return Option::Some(self.used); } - let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); - if (c != Ordering::Equal) { - return c; + if (pat_len > self.used) { + return null; } - let c: Ordering = Box { value: self.byte_index }."i32^Ord::cmp"(Box { value: other.byte_index }); - if (c != Ordering::Equal) { - return c; + let pat_repr: builtin::array = pat.String::internal_raw_bytes(); + let mut i: i32 = (self.used - pat_len); + loop { + let mut matched: bool = true; + __for_7: { + let mut j: i32 = 0; + loop { + if !(j < pat_len) { + break __for_7; + } + __for_7_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(pat_repr, j)) { + matched = false; + break __for_7; + } + } + j = (j + 1); + } + } + if matched { + return Option::Some(i); + } + if (i == 0) { + break; + } + i = (i - 1); } - return Ordering::Equal; -} - -pub fn "StrUtf8ByteIter^Inspect::inspect"(self: &StrUtf8ByteIter, f: &mut Formatter) { - f.Formatter::write_str("StrUtf8ByteIter { "); - f.Formatter::write_str("repr: "); - self.repr."builtin::array^Inspect::inspect"(f); - f.Formatter::write_str(", "); - f.Formatter::write_str("used: "); - Box { value: self.used }."i32^Inspect::inspect"(f); - f.Formatter::write_str(", "); - f.Formatter::write_str("index: "); - Box { value: self.index }."i32^Inspect::inspect"(f); - f.Formatter::write_str(" }"); -} - -pub fn "StrCharIter^Inspect::inspect"(self: &StrCharIter, f: &mut Formatter) { - f.Formatter::write_str("StrCharIter { "); - f.Formatter::write_str("repr: "); - self.repr."builtin::array^Inspect::inspect"(f); - f.Formatter::write_str(", "); - f.Formatter::write_str("used: "); - Box { value: self.used }."i32^Inspect::inspect"(f); - f.Formatter::write_str(", "); - f.Formatter::write_str("byte_index: "); - Box { value: self.byte_index }."i32^Inspect::inspect"(f); - f.Formatter::write_str(" }"); + return null; } -pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(I::Item) -> bool, f: &mut Formatter) { - f.Formatter::write_str("|I::Item| -> bool"); +pub fn String::contains_char(self: &String, ch: char) -> bool { + __for_of_2: { + let mut __iter_2: StrCharIter = self.String::chars()."StrCharIter^IntoIterator::into_iter"(); + loop { + let __pattern_temp_0: Option = __iter_2."StrCharIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let c: char = __variant_payload(__pattern_temp_0, case=0); + if (c == ch) { + return true; + } + } else { + break; + } + } + } + return false; +} + +pub fn String::find_char(self: &String, pred: fn(char) -> bool) -> Option { + let mut byte_index: i32 = 0; + let mut iter: StrCharIter = self.String::chars(); + loop { + let __pattern_temp_0: Option = iter."StrCharIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let c: char = __variant_payload(__pattern_temp_0, case=0); + if pred(c) { + return Option::Some(byte_index); + } + let code: u32 = c as u32; + if (code < 0x80) { + byte_index = (byte_index + 1); + } else { + if (code < 0x800) { + byte_index = (byte_index + 2); + } else { + if (code < 0x10000) { + byte_index = (byte_index + 3); + } else { + byte_index = (byte_index + 4); + } + } + } + } else { + break; + } + } + return null; +} + +pub fn String::insert(self: &mut String, byte_index: i32, ch: char) { + __assert_2: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index <= self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(308); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 726 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index <= self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index <= self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + if ((byte_index > 0) && (byte_index < self.used)) { + let b: u8 = core::builtin::array_get_u8(self.repr, byte_index); + __assert_3: { + let __v0: u8 = b; + let __v1: bool = (b < 0x80); + let __v2: u8 = b; + let __v3: bool = (b >= 0xC0); + let __cond: bool = (__v1 || __v3); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 729 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + } + let code: u32 = ch as u32; + let char_len: i32 = if (code < 0x80) { + 1; + } else { + if (code < 0x800) { + 2; + } else { + if (code < 0x10000) { + 3; + } else { + 4; + }; + }; + }; + let new_used: i32 = (self.used + char_len); + if (new_used > core::builtin::array_len(self.repr)) { + self.String::grow(new_used); + } + let mut i: i32 = (self.used - 1); + loop { + if !(i >= byte_index) { + break; + } + core::builtin::array_set_u8(self.repr, (i + char_len), core::builtin::array_get_u8(self.repr, i)); + if (i == 0) { + break; + } + i = (i - 1); + } + if (code < 0x80) { + core::builtin::array_set_u8(self.repr, byte_index, code as u8); + } else { + if (code < 0x800) { + core::builtin::array_set_u8(self.repr, byte_index, (0xC0 | (code >> 6)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | (code & 0x3F)) as u8); + } else { + if (code < 0x10000) { + core::builtin::array_set_u8(self.repr, byte_index, (0xE0 | (code >> 12)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | ((code >> 6) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 2), (0x80 | (code & 0x3F)) as u8); + } else { + core::builtin::array_set_u8(self.repr, byte_index, (0xF0 | (code >> 18)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 1), (0x80 | ((code >> 12) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 2), (0x80 | ((code >> 6) & 0x3F)) as u8); + core::builtin::array_set_u8(self.repr, (byte_index + 3), (0x80 | (code & 0x3F)) as u8); + } + } + } + self.used = new_used; +} + +pub fn String::insert_str(self: &mut String, byte_index: i32, s: String) { + let s_len: i32 = s.String::len(); + if (s_len == 0) { + return; + } + __assert_4: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index <= self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(308); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert_str"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 771 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index <= self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index <= self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + if ((byte_index > 0) && (byte_index < self.used)) { + let b: u8 = core::builtin::array_get_u8(self.repr, byte_index); + __assert_5: { + let __v0: u8 = b; + let __v1: bool = (b < 0x80); + let __v2: u8 = b; + let __v3: bool = (b >= 0xC0); + let __cond: bool = (__v1 || __v3); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(220); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::insert_str"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 774 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("not on a UTF-8 character boundary"); + __r.String::push_str("\ncondition: b < 0x80 || b >= 0xC0\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b < 0x80: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."u8^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("b >= 0xC0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + } + let new_used: i32 = (self.used + s_len); + if (new_used > core::builtin::array_len(self.repr)) { + self.String::grow(new_used); + } + let mut i: i32 = (self.used - 1); + loop { + if !(i >= byte_index) { + break; + } + core::builtin::array_set_u8(self.repr, (i + s_len), core::builtin::array_get_u8(self.repr, i)); + if (i == 0) { + break; + } + i = (i - 1); + } + "core::prelude/string.wado::core/builtin/array_copy"(self.repr, byte_index, s.String::internal_raw_bytes(), 0, s_len); + self.used = new_used; +} + +pub fn String::remove(self: &mut String, byte_index: i32) -> char { + __assert_6: { + let __v0: i32 = byte_index; + let __v1: bool = (byte_index >= 0); + let __v2: i32 = byte_index; + let __v3: i32 = self.used; + let __v4: bool = (byte_index < self.used); + let __cond: bool = (__v1 && __v4); + if !__cond { + core::internal::panic(__tmpl: { + let mut __r: String = "core::prelude/string.wado::String::with_capacity"(306); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("String::remove"); + __r.String::push_str(" at "); + __r.String::push_str("core:prelude/string.wado"); + __r.String::push_str(":"); + let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: 795 }."i32^Display::fmt"(&mut __f); + __r.String::push_str(": "); + __r.String::push_str("index out of bounds"); + __r.String::push_str("\ncondition: byte_index >= 0 && byte_index < self.used\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index >= 0: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v1 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v3 }."i32^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + __r.String::push_str("byte_index < self.used: "); + __f = "core::prelude/format.wado::Formatter::new"(&mut __r); + Box { value: __v4 }."bool^Inspect::inspect"(&mut __f); + __r.String::push_str("\n"); + break __tmpl: __r; + }); + } + } + let b0: u32 = core::builtin::array_get_u8(self.repr, byte_index) as u32; + let char_len: i32 = if (b0 < 0x80) { + 1; + } else { + if (b0 < 0xE0) { + 2; + } else { + if (b0 < 0xF0) { + 3; + } else { + 4; + }; + }; + }; + let code: u32 = if (b0 < 0x80) { + b0; + } else { + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + (((b0 & 0x1F) << 6) | (b1 & 0x3F)); + } else { + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 2)) as u32; + ((((b0 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + } else { + let b1: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 1)) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 2)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (byte_index + 3)) as u32; + (((((b0 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + }; + }; + }; + let src: i32 = (byte_index + char_len); + __for_8: { + let mut i: i32 = src; + loop { + if !(i < self.used) { + break __for_8; + } + __for_8_body: { + core::builtin::array_set_u8(self.repr, (i - char_len), core::builtin::array_get_u8(self.repr, i)); + } + i = (i + 1); + } + } + self.used = (self.used - char_len); + return "core::prelude/primitive.wado::char::from_u32_unchecked"(code); +} + +pub fn String::repeat(self: &String, n: i32) -> String { + if ((n <= 0) || (self.used == 0)) { + return "core::prelude/string.wado::String::with_capacity"(0); + } + let total: i32 = (self.used * n); + let repr: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(total); + __for_9: { + let mut r: i32 = 0; + loop { + if !(r < n) { + break __for_9; + } + __for_9_body: { + "core::prelude/string.wado::core/builtin/array_copy"(repr, (r * self.used), self.repr, 0, self.used); + } + r = (r + 1); + } + } + return String { repr: repr, used: total }; +} + +pub fn String::replace(self: &String, from: String, to: String) -> String { + return self.String::replacen(from, to, -1); +} + +pub fn String::replacen(self: &String, from: String, to: String, count: i32) -> String { + let from_len: i32 = from.String::len(); + if (from_len == 0) { + return *self; + } + let to_len: i32 = to.String::len(); + let from_repr: builtin::array = from.String::internal_raw_bytes(); + let to_repr: builtin::array = to.String::internal_raw_bytes(); + let mut result: String = "core::prelude/string.wado::String::with_capacity"(self.used); + let mut pos: i32 = 0; + let mut replacements: i32 = 0; + let limit: i32 = (self.used - from_len); + loop { + if !(pos <= limit) { + break; + } + if ((count >= 0) && (replacements >= count)) { + break; + } + let mut matched: bool = true; + __for_10: { + let mut j: i32 = 0; + loop { + if !(j < from_len) { + break __for_10; + } + __for_10_body: { + if (core::builtin::array_get_u8(self.repr, (pos + j)) != core::builtin::array_get_u8(from_repr, j)) { + matched = false; + break __for_10; + } + } + j = (j + 1); + } + } + if matched { + if (to_len > 0) { + let new_used: i32 = (result.used + to_len); + if (new_used > core::builtin::array_len(result.repr)) { + result.String::grow(new_used); + } + "core::prelude/string.wado::core/builtin/array_copy"(result.repr, result.used, to_repr, 0, to_len); + result.used = new_used; + } + pos = (pos + from_len); + replacements = (replacements + 1); + } else { + if (result.used >= core::builtin::array_len(result.repr)) { + result.String::grow((result.used + 1)); + } + core::builtin::array_set_u8(result.repr, result.used, core::builtin::array_get_u8(self.repr, pos)); + result.used = (result.used + 1); + pos = (pos + 1); + } + } + loop { + if !(pos < self.used) { + break; + } + if (result.used >= core::builtin::array_len(result.repr)) { + result.String::grow((result.used + 1)); + } + core::builtin::array_set_u8(result.repr, result.used, core::builtin::array_get_u8(self.repr, pos)); + result.used = (result.used + 1); + pos = (pos + 1); + } + return result; +} + +pub fn "String^Default::default"() -> String { + return ""; +} + +pub fn "String^From::from"(value: char) -> String { + let mut s: String = "core::prelude/string.wado::String::with_capacity"(4); + s.String::push(value); + return s; +} + +pub fn "StrSplitIter^Iterator::next"(self: &mut StrSplitIter) -> Option { + if self.finished { + return null; + } + let limit: i32 = (self.used - self.sep_len); + let mut i: i32 = self.pos; + loop { + if !(i <= limit) { + break; + } + let mut matched: bool = true; + __for_11: { + let mut j: i32 = 0; + loop { + if !(j < self.sep_len) { + break __for_11; + } + __for_11_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(self.sep_repr, j)) { + matched = false; + break __for_11; + } + } + j = (j + 1); + } + } + if matched { + let len: i32 = (i - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.pos = (i + self.sep_len); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + i = (i + 1); + } + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitIter^Iterator::collect"(self: &mut StrSplitIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitIter^Iterator::count"(self: &mut StrSplitIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitIter^Iterator::find"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::any"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitIter^Iterator::all"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitIter^Iterator::last"(self: &mut StrSplitIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitIter^Iterator::nth"(self: &mut StrSplitIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::position"(self: &mut StrSplitIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitIter^Iterator::reduce"(self: &mut StrSplitIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitIter^Iterator::filter"(self: &StrSplitIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitIter^Iterator::enumerate"(self: &StrSplitIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitIter^Iterator::take"(self: &StrSplitIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitIter^Iterator::skip"(self: &StrSplitIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrSplitNIter^Iterator::next"(self: &mut StrSplitNIter) -> Option { + if self.finished { + return null; + } + if (self.remaining <= 1) { + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + let limit: i32 = (self.used - self.sep_len); + let mut i: i32 = self.pos; + loop { + if !(i <= limit) { + break; + } + let mut matched: bool = true; + __for_12: { + let mut j: i32 = 0; + loop { + if !(j < self.sep_len) { + break __for_12; + } + __for_12_body: { + if (core::builtin::array_get_u8(self.repr, (i + j)) != core::builtin::array_get_u8(self.sep_repr, j)) { + matched = false; + break __for_12; + } + } + j = (j + 1); + } + } + if matched { + let len: i32 = (i - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.pos = (i + self.sep_len); + self.remaining = (self.remaining - 1); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + i = (i + 1); + } + let len: i32 = (self.used - self.pos); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, self.pos, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitNIter^Iterator::collect"(self: &mut StrSplitNIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitNIter^Iterator::count"(self: &mut StrSplitNIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitNIter^Iterator::find"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::any"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitNIter^Iterator::all"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitNIter^Iterator::last"(self: &mut StrSplitNIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitNIter^Iterator::nth"(self: &mut StrSplitNIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::position"(self: &mut StrSplitNIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitNIter^Iterator::reduce"(self: &mut StrSplitNIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitNIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitNIter^Iterator::filter"(self: &StrSplitNIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitNIter^Iterator::enumerate"(self: &StrSplitNIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitNIter^Iterator::take"(self: &StrSplitNIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitNIter^Iterator::skip"(self: &StrSplitNIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +fn is_ascii_whitespace_byte(b: u8) -> bool { + return (((((b == 0x20) || (b == 0x09)) || (b == 0x0A)) || (b == 0x0D)) || (b == 0x0C)); +} + +pub fn "StrSplitWhitespaceIter^Iterator::next"(self: &mut StrSplitWhitespaceIter) -> Option { + loop { + if !((self.pos < self.used) && "core::prelude/string.wado::is_ascii_whitespace_byte"(core::builtin::array_get_u8(self.repr, self.pos))) { + break; + } + self.pos = (self.pos + 1); + } + if (self.pos >= self.used) { + return null; + } + let start: i32 = self.pos; + loop { + if !((self.pos < self.used) && !"core::prelude/string.wado::is_ascii_whitespace_byte"(core::builtin::array_get_u8(self.repr, self.pos))) { + break; + } + self.pos = (self.pos + 1); + } + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); +} + +pub fn "StrSplitWhitespaceIter^Iterator::collect"(self: &mut StrSplitWhitespaceIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitWhitespaceIter^Iterator::count"(self: &mut StrSplitWhitespaceIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrSplitWhitespaceIter^Iterator::find"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::any"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrSplitWhitespaceIter^Iterator::all"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrSplitWhitespaceIter^Iterator::last"(self: &mut StrSplitWhitespaceIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrSplitWhitespaceIter^Iterator::nth"(self: &mut StrSplitWhitespaceIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::position"(self: &mut StrSplitWhitespaceIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::reduce"(self: &mut StrSplitWhitespaceIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrSplitWhitespaceIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrSplitWhitespaceIter^Iterator::filter"(self: &StrSplitWhitespaceIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::enumerate"(self: &StrSplitWhitespaceIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::take"(self: &StrSplitWhitespaceIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrSplitWhitespaceIter^Iterator::skip"(self: &StrSplitWhitespaceIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrLinesIter^Iterator::next"(self: &mut StrLinesIter) -> Option { + if self.finished { + return null; + } + if (self.pos >= self.used) { + self.finished = true; + return null; + } + let start: i32 = self.pos; + loop { + if !(self.pos < self.used) { + break; + } + let b: u8 = core::builtin::array_get_u8(self.repr, self.pos); + if (b == 0x0A) { + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.pos = (self.pos + 1); + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + if (b == 0x0D) { + let len: i32 = (self.pos - start); + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.pos = (self.pos + 1); + if ((self.pos < self.used) && (core::builtin::array_get_u8(self.repr, self.pos) == 0x0A)) { + self.pos = (self.pos + 1); + } + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + self.pos = (self.pos + 1); + } + let len: i32 = (self.pos - start); + if (len > 0) { + let part: builtin::array = "core::prelude/string.wado::core/builtin/array_new"(len); + "core::prelude/string.wado::core/builtin/array_copy"(part, 0, self.repr, start, len); + self.finished = true; + return Option::Some("core::prelude/string.wado::String::internal_from_utf8_raw"(part, len)); + } + self.finished = true; + return null; +} + +pub fn "StrLinesIter^Iterator::collect"(self: &mut StrLinesIter) -> Array { + let mut result: Array = __seq_lit: { + let mut __b: Array = "core::prelude/string.wado::Array^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result."Array::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrLinesIter^Iterator::count"(self: &mut StrLinesIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrLinesIter^Iterator::find"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> Option { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::any"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrLinesIter^Iterator::all"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> bool { + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrLinesIter^Iterator::last"(self: &mut StrLinesIter) -> Option { + let mut result: Option = null; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + result = Option::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrLinesIter^Iterator::nth"(self: &mut StrLinesIter, n: i32) -> Option { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::position"(self: &mut StrLinesIter, pred: fn(String) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrLinesIter^Iterator::reduce"(self: &mut StrLinesIter, f: fn(String, String) -> String) -> Option { + let __pattern_temp_0: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: String = __variant_payload(__pattern_temp_0, case=0); + let mut acc: String = first; + loop { + let __pattern_temp_1: Option = self."StrLinesIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: String = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option::Some(acc); + } + return null; +} + +pub fn "StrLinesIter^Iterator::filter"(self: &StrLinesIter, pred: fn(String) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrLinesIter^Iterator::enumerate"(self: &StrLinesIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrLinesIter^Iterator::take"(self: &StrLinesIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrLinesIter^Iterator::skip"(self: &StrLinesIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn "StrCharIndicesIter^Iterator::next"(self: &mut StrCharIndicesIter) -> Option<[i32, char]> { + if (self.byte_index >= self.used) { + return null; + } + let idx: i32 = self.byte_index; + let b0: u8 = core::builtin::array_get_u8(self.repr, self.byte_index); + self.byte_index = (self.byte_index + 1); + if (b0 < 0x80) { + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(b0 as u32)]); + } + if (b0 < 0xE0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + self.byte_index = (self.byte_index + 1); + let code: u32 = (((b0 as u32 & 0x1F) << 6) | (b1 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); + } + if (b0 < 0xF0) { + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 1)) as u32; + self.byte_index = (self.byte_index + 2); + let code: u32 = ((((b0 as u32 & 0x0F) << 12) | ((b1 & 0x3F) << 6)) | (b2 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); + } + let b1: u32 = core::builtin::array_get_u8(self.repr, self.byte_index) as u32; + let b2: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 1)) as u32; + let b3: u32 = core::builtin::array_get_u8(self.repr, (self.byte_index + 2)) as u32; + self.byte_index = (self.byte_index + 3); + let code: u32 = (((((b0 as u32 & 0x07) << 18) | ((b1 & 0x3F) << 12)) | ((b2 & 0x3F) << 6)) | (b3 & 0x3F)); + return Option<[i32, char]>::Some([idx, "core::prelude/primitive.wado::char::from_u32_unchecked"(code)]); +} + +pub fn "StrCharIndicesIter^Iterator::collect"(self: &mut StrCharIndicesIter) -> Array<[i32, char]> { + let mut result: Array<[i32, char]> = __seq_lit: { + let mut __b: Array<[i32, char]> = "core::prelude/string.wado::Array>^SequenceLiteralBuilder::new_literal"(0); + break __seq_lit: __b."Array>^SequenceLiteralBuilder::build"(); + }; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + result."Array>::push"(item); + } else { + break; + } + } + return result; +} + +pub fn "StrCharIndicesIter^Iterator::count"(self: &mut StrCharIndicesIter) -> i32 { + let mut n: i32 = 0; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + n = (n + 1); + } else { + break; + } + } + return n; +} + +pub fn "StrCharIndicesIter^Iterator::find"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> Option<[i32, char]> { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option<[i32, char]>::Some(item); + } + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::any"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> bool { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return true; + } + } else { + break; + } + } + return false; +} + +pub fn "StrCharIndicesIter^Iterator::all"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> bool { + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if !pred(item) { + return false; + } + } else { + break; + } + } + return true; +} + +pub fn "StrCharIndicesIter^Iterator::last"(self: &mut StrCharIndicesIter) -> Option<[i32, char]> { + let mut result: Option<[i32, char]> = null; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + result = Option<[i32, char]>::Some(item); + } else { + break; + } + } + return result; +} + +pub fn "StrCharIndicesIter^Iterator::nth"(self: &mut StrCharIndicesIter, n: i32) -> Option<[i32, char]> { + let mut remaining: i32 = n; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if (remaining <= 0) { + return Option<[i32, char]>::Some(item); + } + remaining = (remaining - 1); + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::position"(self: &mut StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> Option { + let mut idx: i32 = 0; + loop { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + if pred(item) { + return Option::Some(idx); + } + idx = (idx + 1); + } else { + break; + } + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::reduce"(self: &mut StrCharIndicesIter, f: fn([i32, char], [i32, char]) -> [i32, char]) -> Option<[i32, char]> { + let __pattern_temp_0: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_0, case=0, name=Some) { + let first: [i32, char] = __variant_payload(__pattern_temp_0, case=0); + let mut acc: [i32, char] = first; + loop { + let __pattern_temp_1: Option<[i32, char]> = self."StrCharIndicesIter^Iterator::next"(); + if __variant_test(__pattern_temp_1, case=0, name=Some) { + let item: [i32, char] = __variant_payload(__pattern_temp_1, case=0); + acc = f(acc, item); + } else { + break; + } + } + return Option<[i32, char]>::Some(acc); + } + return null; +} + +pub fn "StrCharIndicesIter^Iterator::filter"(self: &StrCharIndicesIter, pred: fn([i32, char]) -> bool) -> IterFilter { + return IterFilter { inner: *self, pred: pred }; +} + +pub fn "StrCharIndicesIter^Iterator::enumerate"(self: &StrCharIndicesIter) -> IterEnumerate { + return IterEnumerate { inner: *self, count: 0 }; +} + +pub fn "StrCharIndicesIter^Iterator::take"(self: &StrCharIndicesIter, n: i32) -> IterTake { + return IterTake { inner: *self, remaining: n }; +} + +pub fn "StrCharIndicesIter^Iterator::skip"(self: &StrCharIndicesIter, n: i32) -> IterSkip { + return IterSkip { inner: *self, remaining: n }; +} + +pub fn String::split(self: &String, sep: String) -> StrSplitIter { + return StrSplitIter { repr: self.repr, used: self.used, pos: 0, sep_repr: sep.String::internal_raw_bytes(), sep_len: sep.String::len(), finished: false }; +} + +pub fn String::splitn(self: &String, n: i32, sep: String) -> StrSplitNIter { + return StrSplitNIter { repr: self.repr, used: self.used, pos: 0, sep_repr: sep.String::internal_raw_bytes(), sep_len: sep.String::len(), remaining: n, finished: (n <= 0) }; +} + +pub fn String::split_whitespace(self: &String) -> StrSplitWhitespaceIter { + return StrSplitWhitespaceIter { repr: self.repr, used: self.used, pos: 0 }; +} + +pub fn String::lines(self: &String) -> StrLinesIter { + return StrLinesIter { repr: self.repr, used: self.used, pos: 0, finished: false }; +} + +pub fn String::char_indices(self: &String) -> StrCharIndicesIter { + return StrCharIndicesIter { repr: self.repr, used: self.used, byte_index: 0 }; +} + +pub fn "StrUtf8ByteIter^Eq::eq"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.index }."i32^Eq::eq"(Box { value: other.index })); +} + +pub fn "StrUtf8ByteIter^Ord::cmp"(self: &StrUtf8ByteIter, other: &StrUtf8ByteIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.index }."i32^Ord::cmp"(Box { value: other.index }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrCharIter^Eq::eq"(self: &StrCharIter, other: &StrCharIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.byte_index }."i32^Eq::eq"(Box { value: other.byte_index })); +} + +pub fn "StrCharIter^Ord::cmp"(self: &StrCharIter, other: &StrCharIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.byte_index }."i32^Ord::cmp"(Box { value: other.byte_index }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitIter^Eq::eq"(self: &StrSplitIter, other: &StrSplitIter) -> bool { + return (((((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && self.sep_repr."builtin::array^Eq::eq"(&other.sep_repr)) && Box { value: self.sep_len }."i32^Eq::eq"(Box { value: other.sep_len })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrSplitIter^Ord::cmp"(self: &StrSplitIter, other: &StrSplitIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = self.sep_repr."builtin::array^Ord::cmp"(&other.sep_repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.sep_len }."i32^Ord::cmp"(Box { value: other.sep_len }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitNIter^Eq::eq"(self: &StrSplitNIter, other: &StrSplitNIter) -> bool { + return ((((((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && self.sep_repr."builtin::array^Eq::eq"(&other.sep_repr)) && Box { value: self.sep_len }."i32^Eq::eq"(Box { value: other.sep_len })) && Box { value: self.remaining }."i32^Eq::eq"(Box { value: other.remaining })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrSplitNIter^Ord::cmp"(self: &StrSplitNIter, other: &StrSplitNIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = self.sep_repr."builtin::array^Ord::cmp"(&other.sep_repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.sep_len }."i32^Ord::cmp"(Box { value: other.sep_len }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.remaining }."i32^Ord::cmp"(Box { value: other.remaining }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrSplitWhitespaceIter^Eq::eq"(self: &StrSplitWhitespaceIter, other: &StrSplitWhitespaceIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })); +} + +pub fn "StrSplitWhitespaceIter^Ord::cmp"(self: &StrSplitWhitespaceIter, other: &StrSplitWhitespaceIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrLinesIter^Eq::eq"(self: &StrLinesIter, other: &StrLinesIter) -> bool { + return (((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.pos }."i32^Eq::eq"(Box { value: other.pos })) && Box { value: self.finished }."bool^Eq::eq"(Box { value: other.finished })); +} + +pub fn "StrLinesIter^Ord::cmp"(self: &StrLinesIter, other: &StrLinesIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.pos }."i32^Ord::cmp"(Box { value: other.pos }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.finished }."bool^Ord::cmp"(Box { value: other.finished }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrCharIndicesIter^Eq::eq"(self: &StrCharIndicesIter, other: &StrCharIndicesIter) -> bool { + return ((self.repr."builtin::array^Eq::eq"(&other.repr) && Box { value: self.used }."i32^Eq::eq"(Box { value: other.used })) && Box { value: self.byte_index }."i32^Eq::eq"(Box { value: other.byte_index })); +} + +pub fn "StrCharIndicesIter^Ord::cmp"(self: &StrCharIndicesIter, other: &StrCharIndicesIter) -> Ordering { + let c: Ordering = self.repr."builtin::array^Ord::cmp"(&other.repr); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.used }."i32^Ord::cmp"(Box { value: other.used }); + if (c != Ordering::Equal) { + return c; + } + let c: Ordering = Box { value: self.byte_index }."i32^Ord::cmp"(Box { value: other.byte_index }); + if (c != Ordering::Equal) { + return c; + } + return Ordering::Equal; +} + +pub fn "StrUtf8ByteIter^Inspect::inspect"(self: &StrUtf8ByteIter, f: &mut Formatter) { + f.Formatter::write_str("StrUtf8ByteIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("index: "); + Box { value: self.index }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrCharIter^Inspect::inspect"(self: &StrCharIter, f: &mut Formatter) { + f.Formatter::write_str("StrCharIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("byte_index: "); + Box { value: self.byte_index }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrSplitIter^Inspect::inspect"(self: &StrSplitIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrSplitNIter^Inspect::inspect"(self: &StrSplitNIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitNIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("remaining: "); + Box { value: self.remaining }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrSplitWhitespaceIter^Inspect::inspect"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + f.Formatter::write_str("StrSplitWhitespaceIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrLinesIter^Inspect::inspect"(self: &StrLinesIter, f: &mut Formatter) { + f.Formatter::write_str("StrLinesIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "StrCharIndicesIter^Inspect::inspect"(self: &StrCharIndicesIter, f: &mut Formatter) { + f.Formatter::write_str("StrCharIndicesIter { "); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^Inspect::inspect"(f); + f.Formatter::write_str(", "); + f.Formatter::write_str("byte_index: "); + Box { value: self.byte_index }."i32^Inspect::inspect"(f); + f.Formatter::write_str(" }"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(I::Item) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|I::Item| -> bool"); } pub fn "StreamWritable^Inspect::inspect"(self: &StreamWritable, f: &mut Formatter) { @@ -9404,6 +13036,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -9424,6 +13064,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -9478,6 +13134,123 @@ pub fn "StrCharIter^InspectAlt::inspect_alt"(self: &StrCharIter, f: &mut Formatt f.Formatter::close_brace("}"); } +pub fn "StrSplitIter^InspectAlt::inspect_alt"(self: &StrSplitIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrSplitNIter^InspectAlt::inspect_alt"(self: &StrSplitNIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitNIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_repr: "); + self.sep_repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("sep_len: "); + Box { value: self.sep_len }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("remaining: "); + Box { value: self.remaining }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrSplitWhitespaceIter^InspectAlt::inspect_alt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + f.Formatter::open_brace("StrSplitWhitespaceIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrLinesIter^InspectAlt::inspect_alt"(self: &StrLinesIter, f: &mut Formatter) { + f.Formatter::open_brace("StrLinesIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("pos: "); + Box { value: self.pos }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("finished: "); + Box { value: self.finished }."bool^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + +pub fn "StrCharIndicesIter^InspectAlt::inspect_alt"(self: &StrCharIndicesIter, f: &mut Formatter) { + f.Formatter::open_brace("StrCharIndicesIter {"); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("repr: "); + self.repr."builtin::array^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("used: "); + Box { value: self.used }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::write_newline_indent(); + f.Formatter::write_str("byte_index: "); + Box { value: self.byte_index }."i32^InspectAlt::inspect_alt"(f); + f.Formatter::write_str(","); + f.Formatter::close_brace("}"); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9506,6 +13279,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9526,6 +13307,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -9554,6 +13351,26 @@ pub fn "StrCharIter^Display::fmt"(self: &StrCharIter, f: &mut Formatter) { self."StrCharIter^Inspect::inspect"(f); } +pub fn "StrSplitIter^Display::fmt"(self: &StrSplitIter, f: &mut Formatter) { + self."StrSplitIter^Inspect::inspect"(f); +} + +pub fn "StrSplitNIter^Display::fmt"(self: &StrSplitNIter, f: &mut Formatter) { + self."StrSplitNIter^Inspect::inspect"(f); +} + +pub fn "StrSplitWhitespaceIter^Display::fmt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + self."StrSplitWhitespaceIter^Inspect::inspect"(f); +} + +pub fn "StrLinesIter^Display::fmt"(self: &StrLinesIter, f: &mut Formatter) { + self."StrLinesIter^Inspect::inspect"(f); +} + +pub fn "StrCharIndicesIter^Display::fmt"(self: &StrCharIndicesIter, f: &mut Formatter) { + self."StrCharIndicesIter^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9582,6 +13399,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9598,8 +13423,24 @@ pub fn "Fn<2,char>^Display::fmt"(self: &fn(char, char) -> char, f: &mut Formatte self."Fn<2,char>^Inspect::inspect"(f); } -pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^Inspect::inspect"(f); +pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); } pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { @@ -9630,6 +13471,26 @@ pub fn "StrCharIter^DisplayAlt::fmt_alt"(self: &StrCharIter, f: &mut Formatter) self."StrCharIter^InspectAlt::inspect_alt"(f); } +pub fn "StrSplitIter^DisplayAlt::fmt_alt"(self: &StrSplitIter, f: &mut Formatter) { + self."StrSplitIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrSplitNIter^DisplayAlt::fmt_alt"(self: &StrSplitNIter, f: &mut Formatter) { + self."StrSplitNIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrSplitWhitespaceIter^DisplayAlt::fmt_alt"(self: &StrSplitWhitespaceIter, f: &mut Formatter) { + self."StrSplitWhitespaceIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrLinesIter^DisplayAlt::fmt_alt"(self: &StrLinesIter, f: &mut Formatter) { + self."StrLinesIter^InspectAlt::inspect_alt"(f); +} + +pub fn "StrCharIndicesIter^DisplayAlt::fmt_alt"(self: &StrCharIndicesIter, f: &mut Formatter) { + self."StrCharIndicesIter^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(I::Item) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -9658,6 +13519,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -9678,6 +13547,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -9698,6 +13583,94 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); } +pub fn "Array>::push"(self: &mut Array<[i32, char]>, value: [i32, char]) with stores[value] { + let used: i32 = self.used; + if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { + self."Array>::grow"(); + } + core::builtin::array_set::<[i32, char]>(self.repr, used, value); + self.used = (used + 1); +} + +pub fn "Array>::grow"(self: &mut Array<[i32, char]>) { + let capacity: i32 = core::builtin::array_len(self.repr); + let new_capacity: i32 = "core::prelude/array.wado::i32_max"((capacity * 2), 4); + let new_repr: builtin::array<[i32, char]> = core::builtin::array_new::<[i32, char]>(new_capacity); + let old_repr: builtin::array<[i32, char]> = self.repr; + let used: i32 = self.used; + __for_0: { + let mut i: i32 = 0; + loop { + if !(i < used) { + break __for_0; + } + __for_0_body: { + core::builtin::array_set::<[i32, char]>(new_repr, i, core::builtin::array_get::<[i32, char]>(old_repr, i)); + } + i = (i + 1); + } + } + self.repr = new_repr; +} + +fn "Array>^SequenceLiteralBuilder::build"(self: &Array<[i32, char]>) -> Array<[i32, char]> { + return *self; +} + +fn "Array>^SequenceLiteralBuilder::new_literal"(capacity: i32) -> Array<[i32, char]> { + return "core::prelude/string.wado::Array>::with_capacity"(capacity); +} + +pub fn "Array>::with_capacity"(capacity: i32) -> Array<[i32, char]> { + return Array> { repr: core::builtin::array_new::<[i32, char]>(capacity), used: 0 }; +} + +pub fn "Array::push"(self: &mut Array, value: String) with stores[value] { + let used: i32 = self.used; + if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { + self."Array::grow"(); + } + core::builtin::array_set::(self.repr, used, value); + self.used = (used + 1); +} + +pub fn "Array::grow"(self: &mut Array) { + let capacity: i32 = core::builtin::array_len(self.repr); + let new_capacity: i32 = "core::prelude/array.wado::i32_max"((capacity * 2), 4); + let new_repr: builtin::array = core::builtin::array_new::(new_capacity); + let old_repr: builtin::array = self.repr; + let used: i32 = self.used; + __for_0: { + let mut i: i32 = 0; + loop { + if !(i < used) { + break __for_0; + } + __for_0_body: { + core::builtin::array_set::(new_repr, i, core::builtin::array_get::(old_repr, i)); + } + i = (i + 1); + } + } + self.repr = new_repr; +} + +fn "Array^SequenceLiteralBuilder::build"(self: &Array) -> Array { + return *self; +} + +fn "Array^SequenceLiteralBuilder::new_literal"(capacity: i32) -> Array { + return "core::prelude/string.wado::Array::with_capacity"(capacity); +} + +pub fn "Array::with_capacity"(capacity: i32) -> Array { + return Array { repr: core::builtin::array_new::(capacity), used: 0 }; +} + +fn "StrCharIter^IntoIterator::into_iter"(self: &StrCharIter) -> StrCharIter { + return *self; +} + pub fn "StrCharIter^Iterator::map"(self: &StrCharIter, f: fn(char) -> char) -> IterMap { return IterMap { inner: *self, f: f }; } @@ -9710,7 +13683,7 @@ pub fn "String::from_iter>"(iter: IterMap = __iter_2."IterMap^Iterator::next"(); if __variant_test(__pattern_temp_0, case=0, name=Some) { let c: char = __variant_payload(__pattern_temp_0, case=0); - s.String::append_char(c); + s.String::push(c); } else { break; } @@ -9732,7 +13705,7 @@ fn "IterMap^IntoIterator::into_iter"(self: &IterMap::append"(self: &mut Array, value: char) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: char) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -9774,7 +13747,7 @@ pub fn "Array::with_capacity"(capacity: i32) -> Array { return Array { repr: core::builtin::array_new::(capacity), used: 0 }; } -pub fn "Array::append"(self: &mut Array, value: u8) with stores[value] { +pub fn "Array::push"(self: &mut Array, value: u8) with stores[value] { let used: i32 = self.used; if core::builtin::unlikely((used >= core::builtin::array_len(self.repr))) { self."Array::grow"(); @@ -9833,6 +13806,106 @@ fn __Closure_1::__call(self: &__Closure_1, c: char) -> char { } // --- Module: core:prelude/tuple.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -9906,6 +13979,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -9926,6 +14007,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -9974,6 +14071,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -9994,6 +14099,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -10042,6 +14163,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10062,6 +14191,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -10110,6 +14255,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -10130,6 +14283,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -10157,6 +14326,106 @@ pub struct WaitEvent { pub payload: u32, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -10267,6 +14536,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -10287,6 +14564,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -10352,6 +14645,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10372,6 +14673,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -10424,6 +14741,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -10444,6 +14769,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -10496,6 +14837,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -10516,6 +14865,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -10539,6 +14904,106 @@ pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([I::Item, J: // --- Module: wado-compiler/tests/format.fixtures/ops.mess.dirty.wado --- global mut __modules_initialized: bool = false; +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -10593,22 +15058,22 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(152); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 8 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 + 2 * 3 == 7\n"); - __r.String::append("2 * 3: "); + __r.String::push_str("\ncondition: 1 + 2 * 3 == 7\n"); + __r.String::push_str("2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 + 2 * 3: "); + __r.String::push_str("\n"); + __r.String::push_str("1 + 2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10620,22 +15085,22 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(152); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 12 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 + 2 * 3 == 9\n"); - __r.String::append("1 + 2: "); + __r.String::push_str("\ncondition: 1 + 2 * 3 == 9\n"); + __r.String::push_str("1 + 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 + 2 * 3: "); + __r.String::push_str("\n"); + __r.String::push_str("1 + 2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10647,22 +15112,22 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(153); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 15 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 2 * 3 + 4 == 14\n"); - __r.String::append("3 + 4: "); + __r.String::push_str("\ncondition: 2 * 3 + 4 == 14\n"); + __r.String::push_str("3 + 4: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("2 * 3 + 4: "); + __r.String::push_str("\n"); + __r.String::push_str("2 * 3 + 4: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10675,26 +15140,26 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(185); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 18 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 2 * 3 + 4 * 5 == 26\n"); - __r.String::append("2 * 3: "); + __r.String::push_str("\ncondition: 2 * 3 + 4 * 5 == 26\n"); + __r.String::push_str("2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("4 * 5: "); + __r.String::push_str("\n"); + __r.String::push_str("4 * 5: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("2 * 3 + 4 * 5: "); + __r.String::push_str("\n"); + __r.String::push_str("2 * 3 + 4 * 5: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10706,22 +15171,22 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(156); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 20 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 10 - 2 * 3 == 24\n"); - __r.String::append("10 - 2: "); + __r.String::push_str("\ncondition: 10 - 2 * 3 == 24\n"); + __r.String::push_str("10 - 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("10 - 2 * 3: "); + __r.String::push_str("\n"); + __r.String::push_str("10 - 2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10733,22 +15198,22 @@ fn __test_0_arithmetic() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(154); - __r.String::append("Assertion failed in "); - __r.String::append("__test_0_arithmetic"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_0_arithmetic"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 23 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 10 - 2 * 3 == 4\n"); - __r.String::append("2 * 3: "); + __r.String::push_str("\ncondition: 10 - 2 * 3 == 4\n"); + __r.String::push_str("2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("10 - 2 * 3: "); + __r.String::push_str("\n"); + __r.String::push_str("10 - 2 * 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10764,22 +15229,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(155); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 30 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 10 - 3 - 2 == 5\n"); - __r.String::append("10 - 3: "); + __r.String::push_str("\ncondition: 10 - 3 - 2 == 5\n"); + __r.String::push_str("10 - 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("10 - 3 - 2: "); + __r.String::push_str("\n"); + __r.String::push_str("10 - 3 - 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10791,22 +15256,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(154); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 33 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 10 - 3 - 2 == 9\n"); - __r.String::append("3 - 2: "); + __r.String::push_str("\ncondition: 10 - 3 - 2 == 9\n"); + __r.String::push_str("3 - 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("10 - 3 - 2: "); + __r.String::push_str("\n"); + __r.String::push_str("10 - 3 - 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10818,22 +15283,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(152); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 36 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 8 / 2 / 2 == 2\n"); - __r.String::append("8 / 2: "); + __r.String::push_str("\ncondition: 8 / 2 / 2 == 2\n"); + __r.String::push_str("8 / 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("8 / 2 / 2: "); + __r.String::push_str("\n"); + __r.String::push_str("8 / 2 / 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10845,22 +15310,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(152); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 37 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 8 / 2 / 2 == 8\n"); - __r.String::append("2 / 2: "); + __r.String::push_str("\ncondition: 8 / 2 / 2 == 8\n"); + __r.String::push_str("2 / 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("8 / 2 / 2: "); + __r.String::push_str("\n"); + __r.String::push_str("8 / 2 / 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10872,22 +15337,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(155); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 40 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 15 % 7 % 3 == 1\n"); - __r.String::append("15 % 7: "); + __r.String::push_str("\ncondition: 15 % 7 % 3 == 1\n"); + __r.String::push_str("15 % 7: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("15 % 7 % 3: "); + __r.String::push_str("\n"); + __r.String::push_str("15 % 7 % 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10899,22 +15364,22 @@ fn __test_1_left_assoc() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(154); - __r.String::append("Assertion failed in "); - __r.String::append("__test_1_left_assoc"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_1_left_assoc"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 41 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 15 % 7 % 3 == 0\n"); - __r.String::append("7 % 3: "); + __r.String::push_str("\ncondition: 15 % 7 % 3 == 0\n"); + __r.String::push_str("7 % 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("15 % 7 % 3: "); + __r.String::push_str("\n"); + __r.String::push_str("15 % 7 % 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10930,22 +15395,22 @@ fn __test_2_shift() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(155); - __r.String::append("Assertion failed in "); - __r.String::append("__test_2_shift"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_2_shift"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 49 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 + 1 << 3 == 16\n"); - __r.String::append("1 + 1: "); + __r.String::push_str("\ncondition: 1 + 1 << 3 == 16\n"); + __r.String::push_str("1 + 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 + 1 << 3: "); + __r.String::push_str("\n"); + __r.String::push_str("1 + 1 << 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10957,22 +15422,22 @@ fn __test_2_shift() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(155); - __r.String::append("Assertion failed in "); - __r.String::append("__test_2_shift"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_2_shift"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 52 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 << 3 + 1 == 9\n"); - __r.String::append("1 << 3: "); + __r.String::push_str("\ncondition: 1 << 3 + 1 == 9\n"); + __r.String::push_str("1 << 3: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 << 3 + 1: "); + __r.String::push_str("\n"); + __r.String::push_str("1 << 3 + 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -10984,22 +15449,22 @@ fn __test_2_shift() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(154); - __r.String::append("Assertion failed in "); - __r.String::append("__test_2_shift"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_2_shift"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 55 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 << 2 + 1 == 8\n"); - __r.String::append("2 + 1: "); + __r.String::push_str("\ncondition: 1 << 2 + 1 == 8\n"); + __r.String::push_str("2 + 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 << 2 + 1: "); + __r.String::push_str("\n"); + __r.String::push_str("1 << 2 + 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11012,26 +15477,26 @@ fn __test_2_shift() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(190); - __r.String::append("Assertion failed in "); - __r.String::append("__test_2_shift"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_2_shift"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 58 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 1 << 2 + 1 << 1 == 6\n"); - __r.String::append("1 << 2: "); + __r.String::push_str("\ncondition: 1 << 2 + 1 << 1 == 6\n"); + __r.String::push_str("1 << 2: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 << 1: "); + __r.String::push_str("\n"); + __r.String::push_str("1 << 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("1 << 2 + 1 << 1: "); + __r.String::push_str("\n"); + __r.String::push_str("1 << 2 + 1 << 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v2 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11043,22 +15508,22 @@ fn __test_2_shift() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(158); - __r.String::append("Assertion failed in "); - __r.String::append("__test_2_shift"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_2_shift"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 61 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 16 >> 1 - 1 == 7\n"); - __r.String::append("16 >> 1: "); + __r.String::push_str("\ncondition: 16 >> 1 - 1 == 7\n"); + __r.String::push_str("16 >> 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("16 >> 1 - 1: "); + __r.String::push_str("\n"); + __r.String::push_str("16 >> 1 - 1: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11073,18 +15538,18 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(140); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 69 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b1100 & 0b1010 == 8\n"); - __r.String::append("0b1100 & 0b1010: "); + __r.String::push_str("\ncondition: 0b1100 & 0b1010 == 8\n"); + __r.String::push_str("0b1100 & 0b1010: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11096,22 +15561,22 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(192); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 72 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b0111 | 0b1010 & 0b0101 == 7\n"); - __r.String::append("0b1010 & 0b0101: "); + __r.String::push_str("\ncondition: 0b0111 | 0b1010 & 0b0101 == 7\n"); + __r.String::push_str("0b1010 & 0b0101: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("0b0111 | 0b1010 & 0b0101: "); + __r.String::push_str("\n"); + __r.String::push_str("0b0111 | 0b1010 & 0b0101: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11123,22 +15588,22 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(193); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 75 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b1100 | 0b0011 & 0b1010 == 10\n"); - __r.String::append("0b1100 | 0b0011: "); + __r.String::push_str("\ncondition: 0b1100 | 0b0011 & 0b1010 == 10\n"); + __r.String::push_str("0b1100 | 0b0011: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("0b1100 | 0b0011 & 0b1010: "); + __r.String::push_str("\n"); + __r.String::push_str("0b1100 | 0b0011 & 0b1010: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11150,22 +15615,22 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(192); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 78 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b1010 ^ 0b1100 & 0b1111 == 6\n"); - __r.String::append("0b1100 & 0b1111: "); + __r.String::push_str("\ncondition: 0b1010 ^ 0b1100 & 0b1111 == 6\n"); + __r.String::push_str("0b1100 & 0b1111: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("0b1010 ^ 0b1100 & 0b1111: "); + __r.String::push_str("\n"); + __r.String::push_str("0b1010 ^ 0b1100 & 0b1111: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11177,22 +15642,22 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(192); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 81 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b1010 ^ 0b1100 & 0b1111 == 6\n"); - __r.String::append("0b1010 ^ 0b1100: "); + __r.String::push_str("\ncondition: 0b1010 ^ 0b1100 & 0b1111 == 6\n"); + __r.String::push_str("0b1010 ^ 0b1100: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("0b1010 ^ 0b1100 & 0b1111: "); + __r.String::push_str("\n"); + __r.String::push_str("0b1010 ^ 0b1100 & 0b1111: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11204,22 +15669,22 @@ fn __test_3_bitwise() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(193); - __r.String::append("Assertion failed in "); - __r.String::append("__test_3_bitwise"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_3_bitwise"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 84 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: 0b1010 | 0b0110 ^ 0b0001 == 15\n"); - __r.String::append("0b1010 | 0b0110: "); + __r.String::push_str("\ncondition: 0b1010 | 0b0110 ^ 0b0001 == 15\n"); + __r.String::push_str("0b1010 | 0b0110: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); - __r.String::append("0b1010 | 0b0110 ^ 0b0001: "); + __r.String::push_str("\n"); + __r.String::push_str("0b1010 | 0b0110 ^ 0b0001: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v1 }."i32^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11235,18 +15700,18 @@ fn __test_4_logical() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(115); - __r.String::append("Assertion failed in "); - __r.String::append("__test_4_logical"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_4_logical"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 93 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: a == true\n"); - __r.String::append("a: "); + __r.String::push_str("\ncondition: a == true\n"); + __r.String::push_str("a: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11258,18 +15723,18 @@ fn __test_4_logical() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(115); - __r.String::append("Assertion failed in "); - __r.String::append("__test_4_logical"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_4_logical"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 97 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: b == true\n"); - __r.String::append("b: "); + __r.String::push_str("\ncondition: b == true\n"); + __r.String::push_str("b: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11281,18 +15746,18 @@ fn __test_4_logical() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(116); - __r.String::append("Assertion failed in "); - __r.String::append("__test_4_logical"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_4_logical"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 101 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: c == false\n"); - __r.String::append("c: "); + __r.String::push_str("\ncondition: c == false\n"); + __r.String::push_str("c: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11304,18 +15769,18 @@ fn __test_4_logical() { if !__cond { core::internal::panic(__tmpl: { let mut __r: String = "core::prelude/string.wado::String::with_capacity"(115); - __r.String::append("Assertion failed in "); - __r.String::append("__test_4_logical"); - __r.String::append(" at "); - __r.String::append("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); - __r.String::append(":"); + __r.String::push_str("Assertion failed in "); + __r.String::push_str("__test_4_logical"); + __r.String::push_str(" at "); + __r.String::push_str("wado-compiler/tests/format.fixtures/ops.mess.dirty.wado"); + __r.String::push_str(":"); let mut __f: Formatter = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: 105 }."i32^Display::fmt"(&mut __f); - __r.String::append("\ncondition: d == true\n"); - __r.String::append("d: "); + __r.String::push_str("\ncondition: d == true\n"); + __r.String::push_str("d: "); __f = "core::prelude/format.wado::Formatter::new"(&mut __r); Box { value: __v0 }."bool^Inspect::inspect"(&mut __f); - __r.String::append("\n"); + __r.String::push_str("\n"); break __tmpl: __r; }); } @@ -11350,6 +15815,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -11370,6 +15843,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -11418,6 +15907,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11438,6 +15935,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -11486,6 +15999,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11506,6 +16027,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -11554,6 +16091,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -11574,6 +16119,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -11607,6 +16168,106 @@ fn __initialize_modules() { } // --- Module: wasi:cli/types.wado --- +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -11716,6 +16377,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -11736,6 +16405,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -11788,6 +16473,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11804,8 +16497,24 @@ pub fn "Fn<2,char>^InspectAlt::inspect_alt"(self: &fn(char, char) -> char, f: &m self."Fn<2,char>^Inspect::inspect"(f); } -pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut Formatter) { - self."Fn<1,char>^Inspect::inspect"(f); +pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut Formatter) { + self."Fn<1,char>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); } pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { @@ -11860,6 +16569,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -11880,6 +16597,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -11932,6 +16665,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -11952,6 +16693,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -11977,6 +16734,106 @@ pub struct ConvertError { pub message: String, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -12109,6 +16966,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -12129,6 +16994,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -12190,6 +17071,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12210,6 +17099,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -12266,6 +17171,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12286,6 +17199,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -12342,6 +17271,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -12362,6 +17299,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } @@ -12394,6 +17347,106 @@ pub struct Formatter { pub buf: &mut String, } +pub struct "IterSkip" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrCharIndicesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrCharIndicesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrCharIndicesIter, + pub pred: fn([i32, char]) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrLinesIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrLinesIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrLinesIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitWhitespaceIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitWhitespaceIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitWhitespaceIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitNIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitNIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitNIter, + pub pred: fn(String) -> bool, +} + +pub struct "IterSkip" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterTake" { + pub inner: StrSplitIter, + pub remaining: i32, +} + +pub struct "IterEnumerate" { + pub inner: StrSplitIter, + pub count: i32, +} + +pub struct "IterFilter" { + pub inner: StrSplitIter, + pub pred: fn(String) -> bool, +} + pub struct "IterMap" { pub inner: StrCharIter, pub f: fn(char) -> char, @@ -12450,11 +17503,11 @@ pub fn Formatter::new(buf: &mut String) -> Formatter with stores[buf] { } pub fn Formatter::write_str(self: &mut Formatter, s: String) { - self.buf.String::append(s); + self.buf.String::push_str(s); } pub fn Formatter::write_char(self: &mut Formatter, c: char) { - self.buf.String::append_char(c); + self.buf.String::push(c); } pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { @@ -12465,7 +17518,7 @@ pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { break __for_0; } __for_0_body: { - self.buf.String::append_char(c); + self.buf.String::push(c); } i = (i + 1); } @@ -12475,7 +17528,7 @@ pub fn Formatter::write_char_n(self: &mut Formatter, c: char, n: i32) { pub fn Formatter::pad(self: &mut Formatter, content: String) { let content_len: i32 = content.String::len(); if ((self.width <= 0) || (content_len >= self.width)) { - self.buf.String::append(content); + self.buf.String::push_str(content); return; } let padding: i32 = (self.width - content_len); @@ -12484,7 +17537,7 @@ pub fn Formatter::pad(self: &mut Formatter, content: String) { Left => true, _ => false, } { - self.buf.String::append(content); + self.buf.String::push_str(content); self.Formatter::write_char_n(self.fill, padding); } else { if match align { @@ -12494,11 +17547,11 @@ pub fn Formatter::pad(self: &mut Formatter, content: String) { let left_pad: i32 = (padding / 2); let right_pad: i32 = (padding - left_pad); self.Formatter::write_char_n(self.fill, left_pad); - self.buf.String::append(content); + self.buf.String::push_str(content); self.Formatter::write_char_n(self.fill, right_pad); } else { self.Formatter::write_char_n(self.fill, padding); - self.buf.String::append(content); + self.buf.String::push_str(content); } } } @@ -12611,20 +17664,20 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre let content_len: i32 = ((sign_len + prefix_len) + digit_count); if ((self.width <= 0) || (content_len >= self.width)) { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } return self.buf.String::internal_reserve_uninit(digit_count); } let padding: i32 = (self.width - content_len); if self.zero_pad { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } self.Formatter::write_char_n('0', padding); return self.buf.String::internal_reserve_uninit(digit_count); @@ -12635,10 +17688,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre _ => false, } { if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } let offset: i32 = self.buf.String::internal_reserve_uninit(digit_count); self.Formatter::write_char_n(self.fill, padding); @@ -12652,10 +17705,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre let right_pad: i32 = (padding - left_pad); self.Formatter::write_char_n(self.fill, left_pad); if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } let offset: i32 = self.buf.String::internal_reserve_uninit(digit_count); self.Formatter::write_char_n(self.fill, right_pad); @@ -12663,10 +17716,10 @@ pub fn Formatter::prepare_int_write(self: &mut Formatter, is_negative: bool, pre } else { self.Formatter::write_char_n(self.fill, padding); if (sign_len > 0) { - self.buf.String::append(sign); + self.buf.String::push_str(sign); } if (prefix_len > 0) { - self.buf.String::append(prefix); + self.buf.String::push_str(prefix); } return self.buf.String::internal_reserve_uninit(digit_count); } @@ -12852,6 +17905,14 @@ pub fn "Fn<2,Ordering>^Inspect::inspect"(self: &fn(&T, &T) -> Ordering, f: &mut f.Formatter::write_str("|&T, &T| -> Ordering"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice| -> bool"); +} + +pub fn "Fn<2,ArraySlice>^Inspect::inspect"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + f.Formatter::write_str("|ArraySlice, ArraySlice| -> ArraySlice"); +} + pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(u8) -> bool, f: &mut Formatter) { f.Formatter::write_str("|u8| -> bool"); } @@ -12872,6 +17933,22 @@ pub fn "Fn<1,char>^Inspect::inspect"(self: &fn(char) -> char, f: &mut Formatter) f.Formatter::write_str("|char| -> char"); } +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn(String) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|String| -> bool"); +} + +pub fn "Fn<2,String>^Inspect::inspect"(self: &fn(String, String) -> String, f: &mut Formatter) { + f.Formatter::write_str("|String, String| -> String"); +} + +pub fn "Fn<1,bool>^Inspect::inspect"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + f.Formatter::write_str("|[i32, char]| -> bool"); +} + +pub fn "Fn<2,Tuple>^Inspect::inspect"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + f.Formatter::write_str("|[i32, char], [i32, char]| -> [i32, char]"); +} + pub fn "Fn<2,I::Item>^Inspect::inspect"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { f.Formatter::write_str("|I::Item, I::Item| -> I::Item"); } @@ -12924,6 +18001,14 @@ pub fn "Fn<2,Ordering>^InspectAlt::inspect_alt"(self: &fn(&T, &T) -> Ordering, f self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^InspectAlt::inspect_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -12944,6 +18029,22 @@ pub fn "Fn<1,char>^InspectAlt::inspect_alt"(self: &fn(char) -> char, f: &mut For self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^InspectAlt::inspect_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^InspectAlt::inspect_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^InspectAlt::inspect_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^InspectAlt::inspect_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -12996,6 +18097,14 @@ pub fn "Fn<2,Ordering>^Display::fmt"(self: &fn(&T, &T) -> Ordering, f: &mut Form self."Fn<2,Ordering>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,ArraySlice>^Display::fmt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^Inspect::inspect"(f); +} + pub fn "Fn<1,bool>^Display::fmt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^Inspect::inspect"(f); } @@ -13016,6 +18125,22 @@ pub fn "Fn<1,char>^Display::fmt"(self: &fn(char) -> char, f: &mut Formatter) { self."Fn<1,char>^Inspect::inspect"(f); } +pub fn "Fn<1,bool>^Display::fmt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,String>^Display::fmt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^Inspect::inspect"(f); +} + +pub fn "Fn<1,bool>^Display::fmt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^Inspect::inspect"(f); +} + +pub fn "Fn<2,Tuple>^Display::fmt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^Inspect::inspect"(f); +} + pub fn "Fn<2,I::Item>^Display::fmt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^Inspect::inspect"(f); } @@ -13068,6 +18193,14 @@ pub fn "Fn<2,Ordering>^DisplayAlt::fmt_alt"(self: &fn(&T, &T) -> Ordering, f: &m self."Fn<2,Ordering>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,ArraySlice>^DisplayAlt::fmt_alt"(self: &fn(ArraySlice, ArraySlice) -> ArraySlice, f: &mut Formatter) { + self."Fn<2,ArraySlice>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(u8) -> bool, f: &mut Formatter) { self."Fn<1,bool>^InspectAlt::inspect_alt"(f); } @@ -13088,6 +18221,22 @@ pub fn "Fn<1,char>^DisplayAlt::fmt_alt"(self: &fn(char) -> char, f: &mut Formatt self."Fn<1,char>^InspectAlt::inspect_alt"(f); } +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn(String) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,String>^DisplayAlt::fmt_alt"(self: &fn(String, String) -> String, f: &mut Formatter) { + self."Fn<2,String>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<1,bool>^DisplayAlt::fmt_alt"(self: &fn([i32, char]) -> bool, f: &mut Formatter) { + self."Fn<1,bool>^InspectAlt::inspect_alt"(f); +} + +pub fn "Fn<2,Tuple>^DisplayAlt::fmt_alt"(self: &fn([i32, char], [i32, char]) -> [i32, char], f: &mut Formatter) { + self."Fn<2,Tuple>^InspectAlt::inspect_alt"(f); +} + pub fn "Fn<2,I::Item>^DisplayAlt::fmt_alt"(self: &fn(I::Item, I::Item) -> I::Item, f: &mut Formatter) { self."Fn<2,I::Item>^InspectAlt::inspect_alt"(f); } diff --git a/wado-compiler/tests/format.fixtures/mess.dirty.wado b/wado-compiler/tests/format.fixtures/mess.dirty.wado index e44caf2b3..88efd0e4d 100644 --- a/wado-compiler/tests/format.fixtures/mess.dirty.wado +++ b/wado-compiler/tests/format.fixtures/mess.dirty.wado @@ -193,13 +193,13 @@ fn add(a: i32, b: i32) -> i32 { // Multiline expression statement followed by comment (no extra blank lines) fn multiline_expr_stmt(buf: String, upper: bool) { - buf.append(if upper { + buf.push_str(if upper { "E"; } else { "e"; }); // next statement immediately follows - buf.append("0"); + buf.push_str("0"); } // Multiline return statement followed by comment (no extra blank lines)