Commit Graph

666 Commits (4923048d9556868c7ac4377a353c4e1618142c04)

Author SHA1 Message Date
Alexander Medvednikov 0db0c642c3 vfmt: add missing imports automatically 2020-04-12 17:45:04 +02:00
Daniel Däschle 5818956cdc
cgen: % escape in string interpolated literals
* cgen: % escape in c call to _STR
* tests: add test for string % escape
* Add a test for the % escaping when interpolating inside strings
2020-04-12 16:24:23 +03:00
Daniel Däschle 79dad0bca9
parser: fix enum default value in struct
* parser: fix enum default value in struct

* Add a test for the enum default values in structs.

* Fix compilation of vfmt.

* Run vfmt over enum_default_value_in_struct_test.v

* Cleanup spurious , in vfmt output for enum declarations

Co-authored-by: Delyan Angelov <delian66@gmail.com>
2020-04-12 13:35:54 +03:00
krischerven 0a03797694
tests: run vfmt 2020-04-12 01:41:26 +02:00
Alexey 0f19f9dd51
tests: test call of variadic function with no arguments 2020-04-12 01:37:34 +02:00
Daniel Däschle be16c5b21d
parser: better error on short init struct 2020-04-11 14:56:55 +03:00
Swastik Baranwal 6ecb6cfe8e
tests: add an operator overloading test 2020-04-11 14:39:51 +03:00
Delyan Angelov 217e6f3b8e checker/parser: allow for fixed array with sizes defined with a const 2020-04-10 22:01:22 +03:00
Alexander Medvednikov d5fb68e3d6 vfmt: fix struct init; run on struct_test.v 2020-04-10 00:36:50 +02:00
Alexander Medvednikov 9b2511133d vfmt: lots of fixes; cmd/v: -keepc; 2020-04-10 00:30:43 +02:00
Daniel Däschle c0d86eb651
cgen: printing pointer should print the address 2020-04-09 15:35:52 +02:00
Daniel Däschle 3fbf91a044
cgen: printing pointers 2020-04-09 12:29:29 +02:00
krischerven 8f8f8c418e
cgen: implement equality on arrays 2020-04-09 03:55:37 +02:00
Daniel Däschle 1c340174b7
cgen: print nested structs 2020-04-08 22:14:01 +02:00
Daniel Däschle d38acb5487
cgen: fix enum print case 2020-04-08 18:55:10 +02:00
Daniel Däschle 6bba7d4e3a
cgen: enum str() 2020-04-08 15:54:38 +02:00
Alexander Medvednikov 2e78051933 tests: fix in_expression_test 2020-04-08 13:56:09 +02:00
Delyan Angelov b9ec1479e4 checker: allow again fallthrough in or{} blocks of option calls without assignment 2020-04-08 02:56:24 +03:00
Delyan Angelov cb52dd85e7 tests: add an isolated test case for long struct names with capitalization 2020-04-07 22:03:20 +03:00
Alexander Medvednikov 6bbd1943dd cgen: fix &string cast; vfmt fixes 2020-04-07 18:51:44 +02:00
Daniel Däschle 4aedef367c
cgen: print bool and string correctly in struct 2020-04-07 17:52:15 +02:00
Daniel Däschle 0024ff848d
parser: check if the last or {} block expression is valid
These checks allows for:

a) `x := call() or { 'abc' }`
b) `x := call() or { panic('abc') }`
c) `x := call() or { exit(123) }`
d) `x := call() or { continue }`
e) `x := call() or { break }`
f) `x := call() or { return }`

... but produce errors for:

g) `x := call() or { println('an error') }` , etc.
2020-04-07 17:36:00 +03:00
Alexander Medvednikov 7f516dbae2 cgen: minor optionals fixes 2020-04-06 18:46:50 +02:00
yuyi 4d5fe14968
log: fix example error 2020-04-06 17:22:53 +02:00
Delyan Angelov 75518e5bb9 ci: extract separate working_with_an_empty_struct_test.v 2020-04-05 12:55:54 +03:00
Delyan Angelov 5e76d53fcd compiler: support default values in optional blocks 2020-04-05 11:59:15 +03:00
joe-conigliaro 97d8633557
checker: constant cycle & test fix 2020-04-04 17:05:26 +11:00
joe-conigliaro bf59828897
ast: const impl & global scope & objects 2020-04-04 14:14:40 +11:00
Alexander Medvednikov 436ef12730 cgen: str(): handle empty structs 2020-04-03 18:49:15 +02:00
hazohelet 0e6fe0a4f2
V: fix const bugs and pass const_test.v (#4206)
* fix const bug in v2

* v2: fix const decl

* small comment fix
2020-04-02 19:39:17 +02:00
Alexander Medvednikov fd12e4e826 fix compiler_test.v 2020-04-02 18:12:10 +02:00
Delyan Angelov 61f79270a8 v2: compiler_test.v should fail on errors. 2020-04-02 19:01:31 +03:00
SleepyRoy d5b2eb3c23
test: remove old num_lit_call_method 2020-04-02 15:52:46 +02:00
Alexander Medvednikov 4981c5a870 parser: fix public interfaces 2020-04-02 12:53:25 +02:00
Alexander Medvednikov d57b1ca962 fix valgrind test 2020-04-02 10:44:35 +02:00
SleepyRoy 74bdc57fad
tests: fix num_lit_call_method_test 2020-04-02 00:18:29 +02:00
Alexander Medvednikov 39434155f8 short struct init syntax 2020-04-01 23:23:20 +02:00
Alexander Medvednikov d9af06f2ad remove remaining files in vlib/compiler 2020-04-01 22:19:09 +02:00
Alexander Medvednikov 0de853a2ab v2: lots of minor test fixes 2020-04-01 17:14:21 +02:00
Alexander Medvednikov 5a0bfa03b3 fix tests 2020-04-01 15:39:54 +02:00
Alexander Medvednikov 3dae1cc131 move sdl module to github.com/vlang/sdl 2020-04-01 15:27:28 +02:00
Alexander Medvednikov 7fd81d3abb parser: fix ^=; disable generics and interface map tests for now 2020-04-01 15:15:21 +02:00
Alexander Medvednikov b1b811b5ed v2: static (for translated code only) 2020-04-01 13:38:05 +02:00
Alexander Medvednikov 48832200bb parser: allow types that start with &&; cgen: allow ++/-- exprs for now 2020-04-01 13:18:58 +02:00
Major Taylor 9bb1b5d1bb
v2: enum fields separated by commas 2020-04-01 12:11:00 +02:00
Alexander Medvednikov 2ac074655f fix interface test 2020-03-31 21:05:48 +02:00
Alexander Medvednikov 2b563bc69f v2: initial interface support; fix enum_hex_test.v 2020-03-31 19:59:41 +02:00
Alexander Medvednikov 2fe0e80569 cgen: enum default values 2020-03-31 19:43:11 +02:00
Delyan Angelov b62035e3d0
solaris & termux: fix both, using the more portable termios.h 2020-03-31 12:46:46 +02:00
hazohelet ec025f2020
compiler: use type `unresolved` for unresolved consts 2020-03-29 19:26:55 +02:00
Delyan Angelov a9724fd38d
v2: typeof() 2020-03-28 17:37:22 +01:00
Alexander Medvednikov f627710870 fix repl tests 2020-03-27 20:49:20 +01:00
Alexander Medvednikov eed7c91e87 move compiler tests from compiler/ to v/ 2020-03-27 18:01:46 +01:00
Alexander Medvednikov 89a05a474f valgrind tests: skip C warnings for now 2020-03-25 21:46:46 +01:00
Alexander Medvednikov 3b4e0147cd cgen: fix tests 2020-03-25 17:26:03 +01:00
Alexander Medvednikov 60fbceea43 memory: free_scope_vars() 2020-03-25 12:26:59 +03:00
Alexander Medvednikov 1cb45e9916 compiler_test: do not run on windows for now 2020-03-23 20:36:34 +01:00
Alexander Medvednikov ae2d001261 tests: fix the new v2 output tests 2020-03-23 20:30:20 +01:00
Alexander Medvednikov 8d8907b61e memory: handle string assignments 2020-03-22 13:40:53 +01:00
Alexander Medvednikov cf8776ac71 valgrind: update the test 2020-03-22 13:33:40 +01:00
Delyan Angelov 3f328a0242
test: fix 'v test vlib/v/tests' 2020-03-22 13:26:16 +01:00
Delyan Angelov 53a9329ab6
valgrind: nicer output 2020-03-22 09:44:15 +01:00
Alexander Medvednikov a02395fe2d valgrind: run the tests 2020-03-21 20:31:30 +01:00
Alexander Medvednikov 85e411bd7c fix valgrind test 2020-03-21 20:10:30 +01:00
Alexander Medvednikov 3e80e22f5d fix prod build 2020-03-21 20:02:37 +01:00
Alexander Medvednikov 4b4c47461b cgen: error fixes; table: simplify; compiler tests 2020-03-13 01:43:30 +01:00