make system random work in VM (#17059)

* make system random work in VM
This commit is contained in:
flywind 2021-02-17 04:52:46 -06:00 • committed by GitHub
commit 4f118721be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 90 additions and 19 deletions

View file

@ -28,6 +28,10 @@ proc toLit*[T](a: T): PNode =
elif T is tuple:
result = newTree(nkTupleConstr)
for ai in fields(a): result.add toLit(ai)
elif T is seq:
result = newNode(nkBracket)
for ai in a:
result.add toLit(ai)
elif T is object:
result = newTree(nkObjConstr)
result.add(newNode(nkEmpty))