Added opcodes to build collection literals
This commit is contained in:
parent
033aac50c2
commit
08f68f09df
|
@ -123,7 +123,11 @@ type
|
|||
BeginTry,
|
||||
FinishTry,
|
||||
Yield,
|
||||
Await
|
||||
Await,
|
||||
BuildList,
|
||||
BuildDict,
|
||||
BuildSet,
|
||||
BuildTuple
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -250,7 +250,9 @@ proc primary(self: Parser): ASTNode =
|
|||
of LeftBrace:
|
||||
let tok = self.step()
|
||||
if self.match(RightBrace):
|
||||
# This yields an empty dictionary
|
||||
# This yields an empty dictionary, not an empty set!
|
||||
# For empty sets, there will be a builtin set() type
|
||||
# that can be instantiated with no arguments
|
||||
result = newDictExpr(@[], @[], tok)
|
||||
else:
|
||||
result = self.expression()
|
||||
|
|
Loading…
Reference in New Issue