mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Str.walkScalars
This commit is contained in:
parent
1de9270ecf
commit
6d7c329698
15 changed files with 109 additions and 2 deletions
|
@ -85,6 +85,7 @@ pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option<Def>
|
|||
STR_SUBSTRING_UNSAFE => str_substring_unsafe,
|
||||
STR_RESERVE => str_reserve,
|
||||
STR_APPEND_SCALAR_UNSAFE => str_append_scalar_unsafe,
|
||||
STR_GET_SCALAR_UNSAFE => str_get_scalar_unsafe,
|
||||
STR_FROM_UTF8 => str_from_utf8,
|
||||
STR_FROM_UTF8_RANGE => str_from_utf8_range,
|
||||
STR_TO_UTF8 => str_to_utf8,
|
||||
|
@ -1749,6 +1750,11 @@ fn str_append_scalar_unsafe(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
|||
lowlevel_2(symbol, LowLevel::StrAppendScalar, var_store)
|
||||
}
|
||||
|
||||
/// Str.getScalarUnsafe : Str, Nat -> { scalar : U32, bytesParsed : Nat }
|
||||
fn str_get_scalar_unsafe(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
||||
lowlevel_2(symbol, LowLevel::StrGetScalarUnsafe, var_store)
|
||||
}
|
||||
|
||||
/// Str.fromUtf8 : List U8 -> Result Str [BadUtf8 { byteIndex : Nat, problem : Utf8Problem } }]*
|
||||
fn str_from_utf8(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
||||
let bytes_var = var_store.fresh();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue