File tree Expand file tree Collapse file tree 3 files changed +3
-8
lines changed Expand file tree Collapse file tree 3 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,6 @@ static kindStrings := [
103
103
KindMap(.KwThrow, "throw"),
104
104
KindMap(.KwTrait, "trait"),
105
105
KindMap(.KwTrue, "true"),
106
- KindMap(.KwUndefined, "undefined"),
107
106
KindMap(.KwUnsafe, "unsafe"),
108
107
KindMap(.KwWhile, "while")
109
108
];
@@ -202,7 +201,6 @@ public enum Kind < traits.Stringable {
202
201
KwThrow, // throw
203
202
KwTrait, // trait
204
203
KwTrue, // true
205
- KwUndefined, // undefined
206
204
KwUnsafe, // unsafe
207
205
KwWhile, // while
208
206
// ==============================
@@ -297,7 +295,6 @@ public func lookup(str: string) -> Kind {
297
295
"throw" -> .KwThrow,
298
296
"trait" -> .KwTrait,
299
297
"true" -> .KwTrue,
300
- "undefined" -> .KwUndefined,
301
298
"unsafe" -> .KwUnsafe,
302
299
"while" -> .KwWhile,
303
300
else -> .Name
Original file line number Diff line number Diff line change @@ -333,14 +333,14 @@ def gen_inst(self, inst):
333
333
self .write ("--" )
334
334
elif inst .kind in (InstKind .BitNot , InstKind .BooleanNot , InstKind .Neg ):
335
335
if inst .kind == InstKind .BooleanNot :
336
- self .write ("!( " )
336
+ self .write ("!" )
337
337
elif inst .kind == InstKind .Neg :
338
338
self .write ("-" )
339
339
else :
340
340
self .write ("~" )
341
+ self .write ("(" )
341
342
self .gen_expr (inst .args [0 ])
342
- if inst .kind == InstKind .BooleanNot :
343
- self .write (")" )
343
+ self .write (")" )
344
344
elif inst .kind == InstKind .Br :
345
345
if len (inst .args ) == 1 :
346
346
self .write (f"goto { inst .args [0 ].name } " )
Original file line number Diff line number Diff line change @@ -97,7 +97,6 @@ class Kind(Enum):
97
97
KwThrow = auto_enum () # throw
98
98
KwTrait = auto_enum () # trait
99
99
KwTrue = auto_enum () # true
100
- KwUndefined = auto_enum () # undefined
101
100
KwUnsafe = auto_enum () # unsafe
102
101
KwWhile = auto_enum () # while
103
102
# ==============================
@@ -243,7 +242,6 @@ def __str__(self):
243
242
Kind .KwThrow : "throw" ,
244
243
Kind .KwTrait : "trait" ,
245
244
Kind .KwTrue : "true" ,
246
- Kind .KwUndefined : "undefined" ,
247
245
Kind .KwUnsafe : "unsafe" ,
248
246
Kind .KwWhile : "while" ,
249
247
# ==============================
You can’t perform that action at this time.
0 commit comments