Commit Graph

103 Commits

Author SHA1 Message Date
Ian
5ddeead29c #9348 Merge some small test files (#9561)
* Consolidated types issue tests
* Consolidated vm issue tests
2018-10-30 06:30:39 +01:00
Utwo
a68a4bfaf2 Remove install.txt and readme.txt (#9521)
* Remove install.txt and readme.txt

* Refactor tests that use readme.txt

* Tests open own source code
2018-10-28 13:36:52 +01:00
Arne Döring
2fa13040b9 Merge pull request #9496 from cooldome/vm_float_casts
VM: add int <-> float casts of the same size
2018-10-28 11:56:30 +01:00
Kaushal Modi
f8cef575b3 Improve dumpLisp macro (#9515)
* Improve dumpLisp macro

- Remove commas from the lisp representation of the AST.
- Make the dumpLisp output "pretty" and indented.
- Improve docs of `dumpTree` and `dumpLisp` macros.

With:

    dumpLisp:
      echo "Hello, World!"

Output before this commit:

    StmtList(Command(Ident("echo"), StrLit("Hello, World!")))

Output after this commit:

    (StmtList
     (Command
      (Ident "echo")
      (StrLit "Hello, World!")))

* Re-use the traverse proc inside treeRepr for lispRepr too

- Add module-local `treeTraverse` proc.
- Also fix treeRepr/dumpTree not printing nnkCommentStmt node contents.

* More doc string updates

* Allow unindented lispRepr output for tests

* Update a test affected by the lispRepr change

* Fix dumpTree

* Add note about lispRepr and dumpLisp to changelog [ci skip]
2018-10-27 14:10:05 +01:00
Andrii Riabushenko
a54e0703a9 Add test 2018-10-24 20:29:51 +01:00
Miran
749dbce4c6 Merge tests into a larger file (part 5 of ∞) (#9368)
* merge magics

* merge metatype tests

* merge method tests

* merge objects tests

* change `import future` to `import sugar`

Nim in Action tests are left with `import future`, to ensure compatibility.

* merge overload tests

* merge proc tests

* merge procvar tests

* merge range tests

* merge seq tests

* merge sets tests

* remove wrong assert from `tsets3`

* fix `jsTests`

* better fix
2018-10-16 10:50:10 +02:00
LemonBoy
ee14ace5d3 Field checks for everybody (#8957)
* Field checks for JS backend

* Clean nkCall nodes with no arguments

Generating a nkEmpty in place of no arguments makes no sense form the
AST point of view and also trips up the VM codegen.

* Field checks for VM backend

* Test case for #6612

This patchset fixes #6612

* Add test case for LHS double evaluation

* Prevent LHS double-eval for JS backend

* Prevent double evaluation in VM backend
2018-10-09 19:54:12 +02:00
LemonBoy
fb54f394e8 Fix for VM codegen with static[T] types
Fixes #9043
2018-09-23 18:17:00 +02:00
Andreas Rumpf
a5d014233a Merge pull request #8996 from LemonBoy/fix-2574
The VM cannot call methods
2018-09-18 10:29:49 +02:00
LemonBoy
c2e5faf959 The VM cannot call methods
Fixes #2574
2018-09-17 19:14:13 +02:00
LemonBoy
027cc5013e Fix error during field access in VM
Tuple constructors can't have nkExprColonExpr but may contain NimNodes
of that kind.

Fixes #4952
2018-09-17 18:52:40 +02:00
Araq
cfbf9dcc59 fixes #8740 2018-09-03 09:06:52 +02:00
Araq
f91a181f58 make tests green again 2018-08-13 23:16:03 +02:00
Andreas Rumpf
975114e114 make more tests green 2018-08-13 13:02:52 +02:00
Oscar Nihlgård
931273cc6b Fix ref bug in vmgen (#8424) 2018-07-30 22:28:24 +02:00
Oscar Nihlgård
7ae9c4358e Fix vm regression (#8163) 2018-06-30 13:38:52 +02:00
Oscar Nihlgård
d146045ed5 Fixes #6689 (#8135) 2018-06-30 09:16:46 +02:00
Oscar Nihlgård
ae69e571e1 VM regression fixes (#8146) 2018-06-29 16:00:53 +02:00
Andreas Rumpf
ccb1514837 Merge pull request #8108 from LemonBoy/fix-5958
Make `static` blocks introduce their own scope
2018-06-26 23:16:40 +02:00
Oscar Nihlgård
236bc06b5f Improve vm support for ref types 2018-06-26 21:25:27 +02:00
LemonBoy
f559e62e45 Adjust some tests to make them pass
The non-scoped behaviour of static blocks was exploited by those tests,
replace all the variables declared whithin one with compileTime marked
ones.
2018-06-25 15:56:13 +02:00
Oscar Nihlgård
440212a154 Fix for newStringOfCap in VM (#7901) 2018-06-04 13:38:26 +02:00
Oscar Nihlgård
7cf87dfac6 VM fix for refs 2018-05-08 17:00:00 +02:00
genotrance
c3cc52087f Added a few useful os calls to VM (#7440) 2018-04-12 13:59:14 +02:00
Arne Döring
6baca58693 Get symbol kind (#7491) 2018-04-11 16:48:01 +02:00
Arne Döring
5d46e1eaa2 Fixes #7473 (#7475)
* removed code duplication
* changelog entry, adopt tests for changes
2018-04-04 15:37:07 +02:00
Parashurama
26a34d52a0 add tests for integer casting in VM. 2017-12-30 10:30:40 +01:00
Fabian Keller
6df6ec27ec Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
Andreas Rumpf
2ad49836d9 make tests green again 2017-11-19 20:09:38 +01:00
Araq
3174cfe55c make tests green again 2017-11-01 00:20:40 +01:00
Andreas Rumpf
ddc131cf07 the parser finally parses 'echo {1,2}' as it should 2017-09-30 21:35:30 +02:00
Andreas Rumpf
414e7eff04 make tests green again 2017-09-26 23:07:37 +02:00
Daniil Yarancev
ae7fe5087f Closes #6083, closes #6086, closes #6379 (#6392) 2017-09-16 22:54:32 +02:00
Parashurama
88a5e9d88c Fix operations on string as openarray in VM. (#6257)
* fix openarray.len for string as openArray in VM.
* fix openarray[idx] for string as openArray in VM.
* fix openarray[idx]=val for string as openArray in VM.
* add tests for passing string as openArray in VM.
* fix issue with NimNode.len
NimNode.len was also returning len for string literals.
also fix logic bug in if/elif chain.
2017-09-15 13:35:57 +02:00
Parashurama
0861249de7 Fix seq.setLen initialisation in VM (#6224) 2017-09-02 22:53:22 +02:00
Parashurama
f64eee3a1e add testcase for mitems returning tuple on VM. 2017-08-19 08:58:57 +02:00
Parashurama
f063943d5f Vm fix zero extend proc ze/ze64 && toU32/toU16/toU8 (#5988)
* fixes ze/ze64 procs in VM.
* fixes toU8/toU16/toU32.
* add tests for ze/ze64 toU32/toU16/toU8 procs
2017-08-03 10:58:45 +02:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Fredrik Høisæther Rasch
6652ae9741 Creating and setting comment nodes in macros (#5850)
* strVal assingnable comment statement ast nodes
* Set comment instead of strVal for comment nodes
* Added test code for creating and setting comment nodes
* Modified the AST spec documentation for documentation comments
2017-05-31 13:08:08 +02:00
Andreas Rumpf
c4dd9dc77e fixes #5269 2017-02-05 08:51:43 +01:00
Andreas Rumpf
26fb6cb073 fixes #5327 2017-02-03 17:35:58 +01:00
Arne Döring
e8a00b805f fix seq add for nim node in VM (#5253)
fixes #4821
2017-01-19 20:10:01 +01:00
Arne Döring
130f30ddb2 make quote ast a ref type (#5246)
* make quote ast a ref type
* recursive set flag isRef for quoted ast
2017-01-19 16:39:18 +01:00
Andreas Rumpf
b85898cd41 fixes #5237 2017-01-19 13:26:22 +01:00
Araq
9d488261df added system.gorgeEx that includes the exitCode; refs #4874; fixes #1994 2017-01-07 02:38:26 +01:00
Araq
bad35a2709 cleanup tgorge test 2016-10-24 20:10:10 +02:00
Felix Krause
39f03d816c Fixes #4871 2016-10-09 18:02:48 +02:00
Andreas Rumpf
e9e413552a fixes #4619 2016-08-23 01:10:34 +02:00
Andreas Rumpf
857b0c8d4c fixes #4462 2016-07-08 10:52:04 +02:00
Yuriy Glukhov
09783c3fd0 Fixed vm codegen for a call with compile-time args. Fixes #4412. 2016-07-06 14:39:57 +03:00