@@ -292,7 +292,7 @@ fn void Parser.parseModule(Parser* p) {
292292 p.consumeToken();
293293 if (p.tok.kind == KW_extern) {
294294 p.consumeToken();
295- if (p.tok.kind == Kind. StringLiteral) {
295+ if (p.tok.kind == StringLiteral) {
296296 const char* extern_name = p.pool.idx2str(p.tok.text_idx);
297297 if (p.tok.text_len != 1 || *extern_name != 'C') {
298298 p.error("unsupported extern module language tag '%s'", extern_name);
@@ -600,7 +600,7 @@ fn bool Parser.parseFunctionParams(Parser* p, DeclList* params, bool is_public,
600600 }
601601
602602 // Accept (void) argument list in c_mode
603- if (p.tokenizer.c_mode && p.tok.kind == Kind. KW_void && p.peekToken(1) == Kind. RParen) {
603+ if (p.tokenizer.c_mode && p.tok.kind == KW_void && p.peekToken(1) == RParen) {
604604 p.consumeToken();
605605 p.consumeToken();
606606 return false;
@@ -758,17 +758,17 @@ fn void Parser.parseVarDecl(Parser* p, bool is_public) {
758758 }
759759 p.consumeToken();
760760
761- if (p.tok.kind == Kind. LParen) {
761+ if (p.tok.kind == LParen) {
762762 if (!p.tokenizer.c_mode) {
763763 p.error("function definitions require the 'fn' keyword");
764764 }
765765 p.parseFunctionDecl2(name, loc, is_public, &ref);
766766 return;
767767 }
768768
769- if (p.tok.kind == Kind. Dot) {
770- if (p.peekToken(1) == Kind. Identifier) {
771- if (p.peekToken(2) == Kind. LParen) {
769+ if (p.tok.kind == Dot) {
770+ if (p.peekToken(1) == Identifier) {
771+ if (p.peekToken(2) == LParen) {
772772 // Either a function definition or an init call
773773 if (!p.tokenizer.c_mode)
774774 p.error("global variables cannot have an init call");
@@ -888,32 +888,32 @@ fn Kind Parser.convertCType(Parser* p) {
888888 case KW_char:
889889 if (has_signed == 1) {
890890 has_signed = 0;
891- kind = Kind. KW_i8;
891+ kind = KW_i8;
892892 } else
893893 if (has_unsigned == 1) {
894894 has_unsigned = 0;
895- kind = Kind. KW_u8;
895+ kind = KW_u8;
896896 } else {
897- kind = Kind. KW_char;
897+ kind = KW_char;
898898 }
899899 break;
900900 case KW_int:
901901 break;
902902 case KW_ssize_t:
903- kind = Kind. KW_isize;
903+ kind = KW_isize;
904904 break;
905905 case KW_size_t:
906- kind = Kind. KW_usize;
906+ kind = KW_usize;
907907 break;
908908 case KW_float:
909- kind = Kind. KW_f32;
909+ kind = KW_f32;
910910 break;
911911 case KW_double:
912912 if (has_long == 1) {
913913 // long double -> double
914914 has_long = 0;
915915 }
916- kind = Kind. KW_f64;
916+ kind = KW_f64;
917917 break;
918918 case KW_short:
919919 has_short++;
@@ -931,18 +931,18 @@ fn Kind Parser.convertCType(Parser* p) {
931931 skip--; // no C type, keep last qualifier
932932 break;
933933 }
934- if (kind == Kind. KW_i32) {
934+ if (kind == KW_i32) {
935935 if (has_short == 1) {
936- kind = Kind. KW_i16;
936+ kind = KW_i16;
937937 has_short = 0;
938938 } else
939939 if (has_long == 2) {
940- kind = Kind. KW_i64;
940+ kind = KW_i64;
941941 has_long = 0;
942942 } else
943943 if (has_long == 1) {
944944 if (getWordSize() == 8)
945- kind = Kind. KW_i64;
945+ kind = KW_i64;
946946 has_long = 0;
947947 }
948948 if (has_signed == 1) {
@@ -1131,15 +1131,15 @@ fn void Parser.parseExternDecl(Parser* p) {
11311131 bool was_interface = p.is_interface;
11321132 p.is_interface = true;
11331133
1134- if (p.tok.kind == Kind. StringLiteral) {
1134+ if (p.tok.kind == StringLiteral) {
11351135 if (p.tok.text_len != 1 || *p.pool.idx2str(p.tok.text_idx) != 'C') {
11361136 p.error("extern must be followed by \"C\" and a block");
11371137 }
11381138 p.consumeToken();
11391139 p.tokenizer.c_mode++; // must set before consuming the token
1140- p.expectAndConsume(Kind. LBrace);
1141- while (p.tok.kind != Kind. RBrace) {
1142- if (p.tok.kind == Kind. Eof)
1140+ p.expectAndConsume(LBrace);
1141+ while (p.tok.kind != RBrace) {
1142+ if (p.tok.kind == Eof)
11431143 p.error("unterminated extern \"C\" block");
11441144 p.parseTopLevel();
11451145 }
0 commit comments