Support Hex, Binary, and Octal number literals #20
No reviewers
Labels
No labels
I-bug
I-enhancement
S-bug
S-proposal
bikeshedding
help-wanted
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AbleOS/holey-bytes#20
Loading…
Reference in a new issue
No description provided.
Delete branch ":trunk"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I don't think I broke anything ❤️
there are glaring bugs
@ -293,2 +293,4 @@
let kind = match c {
..=b' ' => continue,
b'0' if self.advance_if(b'x') => {
while let Some(b'0'..=b'9') = self.peek() {
this should account for hex digits
@ -295,0 +299,4 @@
T::Number
}
b'0' if self.advance_if(b'b') => {
while let Some(b'0'..=b'9') = self.peek() {
should only accept
[01]
@ -295,0 +305,4 @@
T::Number
}
b'0' if self.advance_if(b'o') => {
while let Some(b'0'..=b'9') = self.peek() {
same here but octal
@ -397,0 +394,4 @@
value: {
let slice = self.lexer.slice(token.range());
let (slice, radix) = match &slice.get(0..2) {
Some("0x") => (slice.trim_start_matches("0x"), 16),
the radixes are wrong