mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
Finish first pass of Str.fromUtf8
This commit is contained in:
parent
815f633a58
commit
f3d9c2f2bb
12 changed files with 591 additions and 159 deletions
|
@ -717,15 +717,18 @@ pub fn str_utf8_byte_problem_type() -> SolvedType {
|
|||
|
||||
#[inline(always)]
|
||||
pub fn str_utf8_byte_problem_alias_content() -> SolvedType {
|
||||
// [ InvalidStartByte, UnexpectedEndOfSequence, ExpectedContinuation, OverlongEncoding, CodepointTooLarge, EncodesSurrogateHalf ]
|
||||
// 1. This must have the same values as the Zig struct Utf8ByteProblem in src/str.zig
|
||||
// 2. This must be in alphabetical order
|
||||
//
|
||||
// [ CodepointTooLarge, EncodesSurrogateHalf, OverlongEncoding, InvalidStartByte, UnexpectedEndOfSequence, ExpectedContinuation ]
|
||||
SolvedType::TagUnion(
|
||||
vec![
|
||||
(TagName::Global("InvalidStartByte".into()), vec![]),
|
||||
(TagName::Global("UnexpectedEndOfSequence".into()), vec![]),
|
||||
(TagName::Global("ExpectedContinuation".into()), vec![]),
|
||||
(TagName::Global("OverlongEncoding".into()), vec![]),
|
||||
(TagName::Global("CodepointTooLarge".into()), vec![]),
|
||||
(TagName::Global("EncodesSurrogateHalf".into()), vec![]),
|
||||
(TagName::Global("ExpectedContinuation".into()), vec![]),
|
||||
(TagName::Global("InvalidStartByte".into()), vec![]),
|
||||
(TagName::Global("OverlongEncoding".into()), vec![]),
|
||||
(TagName::Global("UnexpectedEndOfSequence".into()), vec![]),
|
||||
],
|
||||
Box::new(SolvedType::EmptyTagUnion),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue