add building the self hosted compiler to the main test suite
This commit is contained in:
@@ -626,3 +626,8 @@ fn findZigLibDir(allocator: &mem.Allocator) -> %[]u8 {
|
||||
|
||||
return error.FileNotFound;
|
||||
}
|
||||
|
||||
test "import tests" {
|
||||
_ = @import("tokenizer.zig");
|
||||
_ = @import("parser.zig");
|
||||
}
|
||||
|
||||
@@ -204,6 +204,7 @@ pub const Tokenizer = struct {
|
||||
LineComment,
|
||||
Zero,
|
||||
IntegerLiteral,
|
||||
IntegerLiteralWithRadix,
|
||||
NumberDot,
|
||||
FloatFraction,
|
||||
FloatExponentUnsigned,
|
||||
@@ -454,7 +455,7 @@ pub const Tokenizer = struct {
|
||||
},
|
||||
State.Zero => switch (c) {
|
||||
'b', 'o', 'x' => {
|
||||
state = State.IntegerLiteral;
|
||||
state = State.IntegerLiteralWithRadix;
|
||||
},
|
||||
else => {
|
||||
// reinterpret as a normal number
|
||||
@@ -469,6 +470,16 @@ pub const Tokenizer = struct {
|
||||
'p', 'P', 'e', 'E' => {
|
||||
state = State.FloatExponentUnsigned;
|
||||
},
|
||||
'0'...'9' => {},
|
||||
else => break,
|
||||
},
|
||||
State.IntegerLiteralWithRadix => switch (c) {
|
||||
'.' => {
|
||||
state = State.NumberDot;
|
||||
},
|
||||
'p', 'P' => {
|
||||
state = State.FloatExponentUnsigned;
|
||||
},
|
||||
'0'...'9', 'a'...'f', 'A'...'F' => {},
|
||||
else => break,
|
||||
},
|
||||
@@ -485,7 +496,7 @@ pub const Tokenizer = struct {
|
||||
},
|
||||
},
|
||||
State.FloatFraction => switch (c) {
|
||||
'p', 'P', 'e', 'E' => {
|
||||
'p', 'P' => {
|
||||
state = State.FloatExponentUnsigned;
|
||||
},
|
||||
'0'...'9', 'a'...'f', 'A'...'F' => {},
|
||||
|
||||
Reference in New Issue
Block a user