Skip to content

Commit bf57d8a

Browse files
committed
typedefpocalypse
closes #314
1 parent bf67427 commit bf57d8a

14 files changed

+334
-620
lines changed

doc/langref.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ TopLevelItem = ErrorValueDecl | CompTimeExpression(Block) | TopLevelDecl | TestD
99
1010
TestDecl = "test" String Block
1111
12-
TopLevelDecl = option(VisibleMod) (FnDef | ExternDecl | GlobalVarDecl | TypeDecl | UseDecl)
13-
14-
TypeDecl = "type" Symbol "=" TypeExpr ";"
12+
TopLevelDecl = option(VisibleMod) (FnDef | ExternDecl | GlobalVarDecl | UseDecl)
1513
1614
ErrorValueDecl = "error" Symbol ";"
1715
@@ -155,7 +153,7 @@ GotoExpression = "goto" Symbol
155153
156154
GroupedExpression = "(" Expression ")"
157155
158-
KeywordLiteral = "true" | "false" | "null" | "break" | "continue" | "undefined" | "error" | "type" | "this" | "unreachable"
156+
KeywordLiteral = "true" | "false" | "null" | "break" | "continue" | "undefined" | "error" | "this" | "unreachable"
159157
160158
ContainerDecl = option("extern" | "packed") ("struct" | "enum" | "union") "{" many(ContainerMember) "}"
161159
```

src/all_types.hpp

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ enum TldId {
254254
TldIdVar,
255255
TldIdFn,
256256
TldIdContainer,
257-
TldIdTypeDef,
258257
TldIdCompTime,
259258
};
260259

@@ -303,12 +302,6 @@ struct TldContainer {
303302
TypeTableEntry *type_entry;
304303
};
305304

306-
struct TldTypeDef {
307-
Tld base;
308-
309-
TypeTableEntry *type_entry;
310-
};
311-
312305
struct TldCompTime {
313306
Tld base;
314307
};
@@ -330,7 +323,6 @@ enum NodeType {
330323
NodeTypeReturnExpr,
331324
NodeTypeDefer,
332325
NodeTypeVariableDeclaration,
333-
NodeTypeTypeDecl,
334326
NodeTypeErrorValueDecl,
335327
NodeTypeTestDecl,
336328
NodeTypeBinOpExpr,
@@ -369,7 +361,6 @@ enum NodeType {
369361
NodeTypeStructValueField,
370362
NodeTypeArrayType,
371363
NodeTypeErrorType,
372-
NodeTypeTypeLiteral,
373364
NodeTypeVarLiteral,
374365
NodeTypeTryExpr,
375366
NodeTypeInlineExpr,
@@ -448,12 +439,6 @@ struct AstNodeVariableDeclaration {
448439
AstNode *expr;
449440
};
450441

451-
struct AstNodeTypeDecl {
452-
VisibMod visib_mod;
453-
Buf *symbol;
454-
AstNode *child_type;
455-
};
456-
457442
struct AstNodeErrorValueDecl {
458443
Buf *name;
459444

@@ -790,9 +775,6 @@ struct AstNodeArrayType {
790775
struct AstNodeErrorType {
791776
};
792777

793-
struct AstNodeTypeLiteral {
794-
};
795-
796778
struct AstNodeVarLiteral {
797779
};
798780

@@ -816,7 +798,6 @@ struct AstNode {
816798
AstNodeReturnExpr return_expr;
817799
AstNodeDefer defer;
818800
AstNodeVariableDeclaration variable_declaration;
819-
AstNodeTypeDecl type_decl;
820801
AstNodeErrorValueDecl error_value_decl;
821802
AstNodeTestDecl test_decl;
822803
AstNodeBinOpExpr bin_op_expr;
@@ -856,7 +837,6 @@ struct AstNode {
856837
AstNodeUnreachableExpr unreachable_expr;
857838
AstNodeArrayType array_type;
858839
AstNodeErrorType error_type;
859-
AstNodeTypeLiteral type_literal;
860840
AstNodeVarLiteral var_literal;
861841
AstNodeInlineExpr inline_expr;
862842
} data;
@@ -1026,11 +1006,6 @@ struct TypeTableEntryBoundFn {
10261006
TypeTableEntry *fn_type;
10271007
};
10281008

1029-
struct TypeTableEntryTypeDecl {
1030-
TypeTableEntry *child_type;
1031-
TypeTableEntry *canonical_type;
1032-
};
1033-
10341009
enum TypeTableEntryId {
10351010
TypeTableEntryIdInvalid,
10361011
TypeTableEntryIdVar,
@@ -1054,11 +1029,11 @@ enum TypeTableEntryId {
10541029
TypeTableEntryIdEnumTag,
10551030
TypeTableEntryIdUnion,
10561031
TypeTableEntryIdFn,
1057-
TypeTableEntryIdTypeDecl,
10581032
TypeTableEntryIdNamespace,
10591033
TypeTableEntryIdBlock,
10601034
TypeTableEntryIdBoundFn,
10611035
TypeTableEntryIdArgTuple,
1036+
TypeTableEntryIdOpaque,
10621037
};
10631038

10641039
struct TypeTableEntry {
@@ -1083,7 +1058,6 @@ struct TypeTableEntry {
10831058
TypeTableEntryEnumTag enum_tag;
10841059
TypeTableEntryUnion unionation;
10851060
TypeTableEntryFn fn;
1086-
TypeTableEntryTypeDecl type_decl;
10871061
TypeTableEntryBoundFn bound_fn;
10881062
} data;
10891063

0 commit comments

Comments
 (0)