Commit Graph

198 Commits (4dc703af2d8f5ade51bbd44953c66c68d2c824a7)

Author SHA1 Message Date
Enzo Baldisserri 4b3ce79e84
interface: support arguments in methods and simplify 2020-05-04 00:14:59 +02:00
Alexander Medvednikov de749e9d3b parser/cgen: interface <<; `any` type 2020-05-03 18:08:45 +02:00
Delyan Angelov 7e4e3abc2c compiler: circuimvent the dependency cycle v.ast <-> v.table 2020-05-02 22:52:10 +03:00
Uwe Krüger 170ee4312f
cgen: string interpolation field width support for large integers and utf8 strings 2020-05-02 00:43:59 +02:00
Alexander Medvednikov 2f64594ce0 cgen: more interface fixes 2020-05-02 00:28:46 +02:00
Alexander Medvednikov b0c710c985 checker: allow `fn == 0` comparison for now 2020-04-30 18:51:33 +02:00
Alexander Medvednikov 20013e4b4b table: interfaces: unique gen_types 2020-04-30 16:48:46 +02:00
Alexander Medvednikov 2fc05b814c all: interface arrays 2020-04-29 12:21:15 +02:00
Delyan Angelov c6a15dba50 compiler: add support for size_t 2020-04-28 15:07:19 +03:00
Enzo Baldisserri 682838a0cf
checker: check array and fields mutability 2020-04-27 22:53:26 +02:00
joe-conigliaro 9f76a7b250
parser: simplify unused vars & add loop/if vars etc 2020-04-27 23:16:31 +10:00
Alexander Medvednikov 60a0ba5eaa table: minor interface clean up 2020-04-26 05:34:34 +02:00
Enzo Baldisserri c73d91a8fe
fmt: TypeDecl; format more files 2020-04-25 20:58:00 +02:00
Enzo Baldisserri fb54a2635c
fmt: lots of fixes 2020-04-25 17:49:16 +02:00
Delyan Angelov 9a19531909 compiler: add support for `[if myflag]` void fn/methods 2020-04-25 16:57:11 +03:00
joe-conigliaro 6696e1a6e2
table: move set_nr_muls to method 2020-04-25 17:54:32 +10:00
Alexander Medvednikov d54b48b300 table: interface cast fix 2020-04-25 09:18:10 +02:00
joe-conigliaro fbcdffbbc8
table: move Type functions to methods 2020-04-25 17:08:53 +10:00
Alexander Medvednikov f1f9e423c3 interfaces: preparatory fixes 2020-04-25 08:00:44 +02:00
Enzo Baldisserri a924defb94
checker: check `in` left type 2020-04-25 06:14:17 +02:00
Kris Cherven d871595437
all: replace `var` with `mut` 2020-04-23 01:16:58 +02:00
Alexander Medvednikov d7ee4755c2 parser/cgen: interfaces (part 1) 2020-04-22 20:23:53 +02:00
Kris Cherven faed178cb1
fmt: fix optional formatting 2020-04-22 20:12:58 +02:00
Delyan Angelov 4b8ed3f831 cgen: fixes for ustring, makes utf8_util_test.v pass 2020-04-22 10:35:14 +03:00
joe-conigliaro abf5942433
parser/cgen: anon fn var & calling (#4534) 2020-04-21 13:23:36 +10:00
Alexey 85c5103ba3
tests: test cflags parsing 2020-04-18 23:45:17 +02:00
Kris Cherven 3cc7009440
cflag: remove circular dependency 2020-04-18 16:29:43 +02:00
Alexander Medvednikov 06c1b9e95e table/checker: verify private functions/methods 2020-04-17 17:16:14 +02:00
Enzo Baldisserri 051cc732bb
cgen: generate typeof for functions 2020-04-16 21:04:27 +02:00
Abdullah Atta 6a186e8f11
jsgen: implement js backend 2020-04-15 23:16:49 +02:00
Alexander Medvednikov ec10831318 parser: `[]int{cap:cap, len:len}` syntax; minor fixes 2020-04-14 18:10:16 +02:00
Alexander Medvednikov 1185f04868 json: encode 2020-04-14 00:37:47 +02:00
krischerven 8c0b25a2ab
cgen: fix printing alias types 2020-04-13 20:07:25 +02: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
Alexander Medvednikov 2b685fc80a table: bring back parse_cflag() 2020-04-09 15:59:22 +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 7ff0c3aaa9 cgen/parser: fix unions 2020-04-08 01:20:55 +02:00
Alexander Medvednikov 6bbd1943dd cgen: fix &string cast; vfmt fixes 2020-04-07 18:51:44 +02:00
Alexander Medvednikov fd75cce0f3 vfmt: minor fixes + tests 2020-04-07 04:05:59 +02:00
Alexander Medvednikov 35fbac8d56 parser/cgen: default struct field values 2020-04-06 14:45:48 +02:00
Alexander Medvednikov 2a06263a5b vfmt: more fixes; enable `v fmt` and `v fmt -w` 2020-04-05 03:37:38 +02:00
Alexander Medvednikov 95a1bd8470 cgen: handle C typedefs 2020-04-04 14:32:42 +02:00
joe-conigliaro c9e290b36f
table: simplify/generalise type fns & remove calls 2020-04-04 16:37:11 +11:00
joe-conigliaro bf59828897
ast: const impl & global scope & objects 2020-04-04 14:14:40 +11:00
Alexander Medvednikov 9d630dff30 allow slicing of fixed size arrays 2020-03-31 16:48:00 +02:00
joe-conigliaro f8169fee48
table: add i8 to number_type_idxs 2020-03-31 16:17:26 +11:00
Joe Conigliaro 3d2fafa580 cgen: variadic for in loop 2020-03-24 19:42:16 +11:00
Joe Conigliaro 076bc2b773 cgen/checker: fixes & fixes & tmp fixes :D 2020-03-23 02:22:49 +11:00
Joe Conigliaro 043ea80fa9 checker: comptime if expr/stmts & type check fixes 2020-03-22 23:36:27 +11:00
Alexander Medvednikov b2d1f55702 cgen_test fixes 2020-03-21 11:17:17 +01:00
Alexander Medvednikov 8077a7534e cgen: 7 errors left 2020-03-20 20:22:37 +01:00
Joe Conigliaro 4262ff76c3 checker/parser: check & gen stmts for ForIn & fix key, val vars 2020-03-18 23:18:18 +11:00
Joe Conigliaro cf094c6265 cgen: gen fn type declerations 2020-03-16 20:12:03 +11:00
Alexander Medvednikov 8a8f50a6a0 cgen: unwrapped optionals 2020-03-15 08:18:45 +01:00
Joe Conigliaro 50ed4004f4 ast/table: use common struct fn decl arguments 2020-03-15 09:21:36 +11:00
Delyan Angelov 19f9c18305
os: make executable() more robust 2020-03-13 22:19:02 +01:00
Alexander Medvednikov b173cea177 cgen: optionals 2020-03-13 05:57:55 +01:00
Alexander Medvednikov 4b4c47461b cgen: error fixes; table: simplify; compiler tests 2020-03-13 01:43:30 +01:00
Alexander Medvednikov 92d6eec09a cgen: fix remaining errors. hello world now compiles 2020-03-12 09:11:41 +01:00
joe-conigliaro 853bb4c41e cgen: alias & map types & add map_string/map_int aliases 2020-03-12 17:56:44 +11:00
Alexander Medvednikov aada19f574 cgen: fix [] => string casts and for in 2020-03-11 19:00:55 +01:00
Joe Conigliaro a1314bd199 checker/gen/table: impl fn types & sum/other fixes & tidy 2020-03-12 02:10:46 +11:00
Joe Conigliaro 7309be55a0 table: fix error in field/method lookup from previous commit 2020-03-11 20:53:14 +11:00
Joe Conigliaro 7513dab185 table/checker: proper parent field/method lookup & cleanup 2020-03-11 20:48:45 +11:00
yuyi 9e14850bbf
vdoc: show map type correctly 2020-03-11 05:18:20 +01:00
Delyan Angelov 5e541e1f11
vfmt: alias type and sum type + sum type fix 2020-03-07 17:37:55 +01:00
Alexander Medvednikov 37453945d0 cgen: remaining nodes; match type fix; v2.c is now generated 2020-03-04 15:48:43 +01:00
Joe Conigliaro 8458ea40f0 v2: add UnsafeStmt to checker & byte/byteptr to check 2020-03-05 00:20:37 +11:00
Alexander Medvednikov 823b8ad244 table: Type str() 2020-03-03 18:38:41 +01:00
Joe Conigliaro 895a1711cb v2: fix type aliases & add check 2020-03-03 09:19:04 +11:00
Alexander Medvednikov 22ffe336cb checker: AsCast, CharLiteral, fix integer index check 2020-03-02 19:00:33 +01:00
Alexander Medvednikov baaa55f196 cgen: fix methods; println 2020-03-02 18:27:00 +01:00
Joe Conigliaro 8497d637d9 v2: allow pointers to be initialized with 0 2020-03-02 23:52:41 +11:00
Joe Conigliaro 16528b12fa v2: allow enum value to be used as int 2020-03-02 21:32:28 +11:00
joe-conigliaro a8f07157dd v2: implement sym types & handle in table.check 2020-03-02 16:40:18 +11:00
joe-conigliaro b333d02e3b v2: allow none & error for functions that return optional - checker 2020-03-02 13:58:36 +11:00
Joe Conigliaro 00dcaf0e04 v2: ArrayInit + all errs & unhandled + arrange nodes + type fix 2020-03-01 15:14:36 +11:00
Joe Conigliaro f67fca826e v2: fix C function & type prefixing 2020-02-29 21:47:47 +11:00
Joe Conigliaro 48f912c2e9 v2: handle variadic in selector_expr 2020-02-29 19:04:47 +11:00
Joe Conigliaro c4b9ef388f v2: handle var decl & assign stmt together 1st step combining 2020-02-28 23:29:04 +11:00
Alexander Medvednikov 3bde876097 v2: checker: fix --/++ 2020-02-27 17:31:10 +01:00
Alexander Medvednikov 09b7a7c872 v2: checker: handle clone() 2020-02-27 17:21:13 +01:00
Alexander Medvednikov c51f464446 v2: fix `mod.Enum.val` and `x = .val` 2020-02-27 00:12:40 +01:00
Alexander Medvednikov 857cbfb0d2 v2: short struct init syntax; .xxx enum checks; unions; assert 2020-02-26 15:51:05 +01:00
Alexander Medvednikov 28ee0f4ebe checker: check enums 2020-02-25 15:02:34 +01:00
Alexander Medvednikov f6c2b3a54b v2: enum fixes 2020-02-25 13:30:43 +01:00
Alexey 87ad5a96b9
v2: stringify multi-return types 2020-02-24 16:38:31 +01:00
joe-conigliaro 15c288b444 v2: small type cleanup 2020-02-22 08:50:21 +11:00
Alexander Medvednikov 9be87d03f5 type_to_str: fix imported types 2020-02-21 19:56:37 +01:00
Alexander Medvednikov 4c95e59d5c fmt, doc: &; update 0.2 roadmap 2020-02-21 18:13:34 +01:00
Alexander Medvednikov 9e6773cba8 fmt: optionals; none 2020-02-21 17:52:20 +01:00
Alexander Medvednikov b309e7d0e5 type_to_str() 2020-02-21 14:47:42 +01:00
Alexander Medvednikov 6dac2edeef checker: is_number() 2020-02-21 13:44:03 +01:00
joe-conigliaro 8bb8b7d76e v2: add ability to store extra information with Type such as optional 2020-02-21 21:44:06 +11:00
Alexander Medvednikov 296e736f5b checker: minor fixes 2020-02-20 16:16:44 +01:00
joe-conigliaro fcd97f513a v2: module/type/fn name fixes, compile fixes 2020-02-20 21:13:18 +11:00
joe-conigliaro aab1045045 v2: reorder types idxs, > string defined with v struct. rm unresovled 2020-02-20 11:39:59 +11:00
Alexander Medvednikov 92e3e48bce v2: checker: [] and in 2020-02-19 21:13:42 +01:00
Alexander Medvednikov ec3d67c19f checker: print multiple errors; none 2020-02-19 19:54:42 +01:00