Skip to content

Commit

Permalink
minor formatting and unnecessary break;s
Browse files Browse the repository at this point in the history
  • Loading branch information
RetroDev256 committed Sep 10, 2024
1 parent dd5d223 commit 0a62c4e
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions lib/std/zig/tokenizer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,12 @@ pub const Tokenizer = struct {
.expect_newline => {
self.index += 1;
switch (self.buffer[self.index]) {
0 => if (self.index == self.buffer.len) {
result.tag = .invalid;
} else {
continue :state .invalid;
0 => {
if (self.index == self.buffer.len) {
result.tag = .invalid;
} else {
continue :state .invalid;
}
},
'\n' => {
self.index += 1;
Expand All @@ -542,10 +544,7 @@ pub const Tokenizer = struct {
.saw_at_sign => {
self.index += 1;
switch (self.buffer[self.index]) {
0, '\n' => {
result.tag = .invalid;
break;
},
0, '\n' => result.tag = .invalid,
'"' => {
result.tag = .identifier;
continue :state .string_literal;
Expand Down Expand Up @@ -625,12 +624,10 @@ pub const Tokenizer = struct {
'=' => {
result.tag = .plus_equal;
self.index += 1;
break;
},
'+' => {
result.tag = .plus_plus;
self.index += 1;
break;
},
'%' => continue :state .plus_percent,
'|' => continue :state .plus_pipe,
Expand Down Expand Up @@ -702,10 +699,12 @@ pub const Tokenizer = struct {
.string_literal => {
self.index += 1;
switch (self.buffer[self.index]) {
0 => if (self.index != self.buffer.len) {
continue :state .invalid;
} else {
result.tag = .invalid;
0 => {
if (self.index != self.buffer.len) {
continue :state .invalid;
} else {
result.tag = .invalid;
}
},
'\n' => result.tag = .invalid,
'\\' => continue :state .string_literal_backslash,
Expand All @@ -728,10 +727,12 @@ pub const Tokenizer = struct {
.char_literal => {
self.index += 1;
switch (self.buffer[self.index]) {
0 => if (self.index != self.buffer.len) {
continue :state .invalid;
} else {
result.tag = .invalid;
0 => {
if (self.index != self.buffer.len) {
continue :state .invalid;
} else {
result.tag = .invalid;
}
},
'\n' => result.tag = .invalid,
'\\' => continue :state .char_literal_backslash,
Expand All @@ -746,10 +747,12 @@ pub const Tokenizer = struct {
.char_literal_backslash => {
self.index += 1;
switch (self.buffer[self.index]) {
0 => if (self.index != self.buffer.len) {
continue :state .invalid;
} else {
result.tag = .invalid;
0 => {
if (self.index != self.buffer.len) {
continue :state .invalid;
} else {
result.tag = .invalid;
}
},
'\n' => result.tag = .invalid,
0x01...0x09, 0x0b...0x1f, 0x7f => {
Expand Down

0 comments on commit 0a62c4e

Please sign in to comment.