Skip to content

Commit

Permalink
Tokenize {u,i}{8,16,32,64}
Browse files Browse the repository at this point in the history
  • Loading branch information
N00byEdge committed Oct 8, 2023
1 parent 2eb1a04 commit c08162f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions selfhost/tokenizer.n
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,18 @@ fn init() void {
else if(context.match_kw("if".&)) {
context.add_token_advance(.if_keyword, 2);
}
else if(context.match_kw("i8".&)) {
context.add_token_advance(.@"i8", 2);
}
else if(context.match_kw("i16".&)) {
context.add_token_advance(.@"i16", 3);
}
else if(context.match_kw("i32".&)) {
context.add_token_advance(.@"i32", 3);
}
else if(context.match_kw("i64".&)) {
context.add_token_advance(.@"i64", 3);
}
else {
ident_handler(context);
}
Expand Down Expand Up @@ -345,6 +357,18 @@ fn init() void {
else if(context.match_kw("unreachable".&)) {
context.add_token_advance(.unreachable_keyword, 11);
}
else if(context.match_kw("u8".&)) {
context.add_token_advance(.@"u8", 2);
}
else if(context.match_kw("u16".&)) {
context.add_token_advance(.@"u16", 3);
}
else if(context.match_kw("u32".&)) {
context.add_token_advance(.@"u32", 3);
}
else if(context.match_kw("u64".&)) {
context.add_token_advance(.@"u64", 3);
}
else {
ident_handler(context);
}
Expand Down

0 comments on commit c08162f

Please sign in to comment.