Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephTLyons committed Nov 20, 2024
1 parent 0243d7a commit 766b117
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lenient_parse/internal/parser.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,16 @@ fn form_base_prefix(
specifier specifier: String,
base base: Int,
) -> Result(ParseData(Option(#(#(Int, Int), String, Int))), ParseError) {
let new_rest = case tokens {
let #(start_index, end_index) = index_range
let rest = case tokens {
[] -> []
[_, ..tokens] -> tokens
}

Ok(ParseData(
data: Some(#(#(index_range.0, index_range.1 + 1), "0" <> specifier, base)),
next_index: index_range.1 + 2,
tokens: new_rest,
data: Some(#(#(start_index, end_index + 1), "0" <> specifier, base)),
next_index: end_index + 2,
tokens: rest,
))
}

Expand Down

0 comments on commit 766b117

Please sign in to comment.