Commit Graph

191 Commits (f584e70cf2fe862a93c1521b9d67eb2c83bdc4d2)

Author SHA1 Message Date
playX 0121c8b4fd
v.gen.js: fix method calls and other codegen parts, rand module compiles (#11205) 2021-08-18 11:33:37 +03:00
playX 659f823c5c
js: initial work on porting rand module to JS backend (#11188) 2021-08-15 18:09:51 +03:00
playX b72d1e5e86
v.gen.js: implement `u64` and `i64` with BigInt (#11174) 2021-08-13 21:24:10 +03:00
playX aa14fd1b05
v.gen.js: support operator overloading (#11171) 2021-08-13 10:06:59 +03:00
playX 70124d2d23
js: time module: implement utc,now,local (#11138) 2021-08-11 09:22:53 +03:00
playX 7a67a08d2f
js: implement codegen for array.sort and implement .any,.all (#11100) 2021-08-09 01:46:40 +03:00
playX 94c321c80d
v.gen.js: port fully the array test suite & add fixes (#11073) 2021-08-07 17:58:49 +03:00
playX 8743b616a0
v.gen.js: codegen fixes, add a few builtins, port more array tests (#11049) 2021-08-04 12:46:24 +03:00
playX 0455632b1f
v.gen.js: fix prefix, postfix and assign codegen and add more array tests (#11031) 2021-08-03 14:59:46 +03:00
playX 836ac54d12
v.gen.js: add more array tests and fixes (#11014) 2021-08-01 14:08:49 +03:00
playX 77e9ed417f
v.gen.js: fix segfault when anonymous function is declared with assertion (#11009) 2021-08-01 07:27:44 +03:00
playX a7ca051016
v.gen.js: fix for array filter, add more tests and other fixes (#10999) 2021-07-30 11:17:11 +03:00
playX 75c41252d9
js: add more tests & add array prepend codegen (#10988) 2021-07-29 11:39:36 +03:00
playX e3cf95b058
js: add more tests for array, support array insert_many, minor fixes for references (#10983) 2021-07-28 13:01:00 +03:00
Delyan Angelov 6134c4870b
v.util: extract v.util.version, use it to speed up building `v repl`, `v up` and `v doctor` 2021-07-27 12:59:56 +03:00
playX f51fa7e665
v.gen.js: fix references and add iterator to map (#10938) 2021-07-24 15:35:17 +03:00
playX 69cbdf9fdc
v.gen.js, os_js: port the OS module to JS (#10872) 2021-07-23 18:04:36 +03:00
playX 425ca5e3c3
v.gen.js: add three backend options for JS, and comptime if support (#10859) 2021-07-19 15:55:03 +03:00
playX d5e0fa6d1b
v.gen.js: port string methods and fix booleans (#10824) 2021-07-18 09:00:20 +03:00
playX 06edbc8a38
v.gen.js: implement most of array and map methods in builtin/js (#10806) 2021-07-15 17:36:53 +03:00
playX 9c710b2a34
v.gen.js: improve reference support (#10793) 2021-07-14 11:43:48 +03:00
playX 0e08d15bc4
v.gen.js: add basic support for references (#10785) 2021-07-13 22:52:01 +03:00
playX ee00d80931
v.gen.js: support global declarations in the JS backend (#10773) 2021-07-13 15:36:06 +03:00
Delyan Angelov 972542d6ee
checker: `[noreturn]` part 2 (cleanup) (#10667) 2021-07-05 05:05:37 +03:00
yuyi c58b04bcbf
checker: implement if smartcast multi conds (part 2) (#10487) 2021-06-17 12:27:31 +03:00
Uwe Krüger 2ac39d9112
all: new function `isreftype(T)` to know if `T` contains pointers (#10438) 2021-06-13 06:26:13 +03:00
Andreas Heissenberger 96c8d147b2
v.gen.js: add source map creation support (inline only, no src) (#10384) 2021-06-10 08:33:46 +03:00
Delyan Angelov bc01de2181
ast: mark ast.File{} with `[heap]`, and use []&ast.File consistently 2021-05-22 19:06:55 +03:00
Uwe Krüger d26ac5692e
all: various fixes for [heap]/auto-heap handling (#10033) 2021-05-07 15:58:48 +03:00
Enzo 4eb8072882
parser: remove ++/-- exception for some modules (#9895) 2021-04-27 01:41:42 +03:00
spaceface 8b22dbbadb
jsgen: basic struct embedding support (#9879) 2021-04-26 09:56:03 +03:00
Uwe Krüger 3c0a368af3
all: automatically move (some) referenced objects to heap (#9873) 2021-04-25 21:40:38 +03:00
Delyan Angelov bd539b6427
vfmt: fix string interpolation formatting with multiple ',",\' and \" . 2021-04-20 20:26:06 +03:00
Lukas Neubert 4a1f75c964
fmt: split infix wrapping into smaller functions and fix a trailing space bug (#9806)
* change recursive fn calls to reduce write operations

* format files and test

* Update vtest-cleancode.v

* fix test
2021-04-19 21:56:39 +03:00
Delyan Angelov 68c3eccec5
v: skip asserts in -prod mode inside non _test.v files 2021-04-13 13:07:57 +03:00
Enzo 5a1a1b7c12
all: merge GoExpr and GoStmt (#9685) 2021-04-11 23:56:25 +02:00
Alexander Medvednikov 7385f8e56b all: a massive merge of ast and table modules 2021-04-02 01:57:09 +03:00
Alexander Medvednikov 6f318be96c checker: do not allow nil sum types init 2021-03-31 11:13:52 +03:00
Ned Palacios b319068151
ast, parser: implement simple AST poisoning (#9525) 2021-03-30 09:33:29 +02:00
crthpl fafb035fb5
all: reimplement inline assembly (#8645) 2021-03-17 01:43:17 +01:00
Delyan Angelov 69f1e7c9c3
v: fixes for `v -autofree -o v2 cmd/v` 2021-03-14 09:37:38 +02:00
Leah Lundqvist 64d0006ff9
jsgen: fix string and array for loops and improve casting (#9295) 2021-03-14 08:20:01 +02:00
zakuro 00399b49ab
v.util: add util.tabs() (#9211) 2021-03-09 13:03:25 +02:00
Delyan Angelov 849cde245c
v: support dump(expr) (#9160) 2021-03-06 18:09:28 +01:00
Leah Lundqvist 65e888230a
jsgen: object equality checks, optimise casting and start builtin implementation (#9068) 2021-03-04 14:02:16 +01:00
zakuro f54c1a5cc2
all: add strings.Builder.write_string and use write_string instead of write (#8892) 2021-02-22 13:18:11 +02:00
Nick Treleaven 0f8edd918a
checker: disallow `unsafe` map copy (#8720) 2021-02-17 05:19:25 +01:00
Nick Treleaven 01aa09d515
checker: do not allow copying any map lvalue (#8662) 2021-02-16 12:46:12 +01:00
yuyi 95c3ef3a6a
cgen: minor cleanup in stmt() (#8659) 2021-02-09 23:00:43 +01:00
Daniel Däschle d477e525bb
checker/gen: fix generic struct init (#8322) 2021-02-03 00:42:00 +11:00
div72 8c70920695
all: add offsetof (#8380) 2021-01-30 12:57:09 +01:00
Delyan Angelov 7f5d654c3a
all: cleanup redundant `.ends_with(_test.v)` calls 2021-01-30 11:08:52 +02:00
Delyan Angelov 760b4c37b9
all: support _test.vv files (to test _test.v errors/checks too) 2021-01-30 10:42:18 +02:00
Uwe Krüger 8d014d4646
sync: allow `go` routine join with return value (#8125) 2021-01-15 13:45:26 +01:00
Uwe Krüger 5f95dd54bd
builtin: rename `any_*` -> `*_literal` - 2. part (#8032) 2021-01-11 22:58:15 +01:00
Daniel Däschle 5841d5d8e1
all: implement basic comptime field selector (#7888) 2021-01-05 16:11:43 +02:00
joe-conigliaro 02965e753e
all: re-implement variadics using arrays & implement array decomposition to varg (#7689) 2020-12-29 16:14:08 +01:00
Nick Treleaven d785e22a6e
checker: disallow assigning number to pointer (#7267) 2020-12-12 10:42:07 +01:00
Leah Lundqvist 90c1c639fe
js: types (#7108) 2020-12-08 17:49:20 +01:00
spaceface777 744a36ed71
js: restructure namespaces (#7170) 2020-12-07 18:36:22 +01:00
Leah Lundqvist ab225ff154
jsgen: fix JS.@typeof (#7055) 2020-12-01 04:02:10 +01:00
Alexander Medvednikov c27818e247 all: remove remaining broken escape sequences 2020-11-27 03:17:19 +01:00
Daniel Däschle 7d6f97259f
all: refactor UnionSumType to SumType (#6944) 2020-11-25 13:09:40 +02:00
Leah Lundqvist 96b73acad7
jsgen: optional "or blocks" (#6938) 2020-11-24 22:52:23 +01:00
Daniel Däschle a042966082
all: remove old sumtype code (#6937) 2020-11-24 17:55:24 +01:00
Daniel Däschle aa6303f0b2
all: use the new types with old syntax (#6922) 2020-11-24 13:58:29 +01:00
pancake aa90625819
js: initial support for optional return unwrapping (#6926) 2020-11-24 12:54:26 +01:00
pancake 4b19a6e00d
js: fix code generation for `$if js` statements (#6896) 2020-11-21 15:40:37 +01:00
Daniel Däschle 838ad16296
all: refactor ast.Expr to use the new sum type implementation (#6792) 2020-11-21 00:05:57 +01:00
pancake d8f64f516b
js: fix codegen for multiline strings (#6791) 2020-11-18 18:23:44 +01:00
Daniel Däschle 6271798ce3
cgen: union sum types implementation (#6745) 2020-11-11 09:18:15 +01:00
Larpon 785bf40f67
all: remove comp time '@' expansion from scanner (#6746) 2020-11-05 10:12:32 +02:00
Delyan Angelov 9eb655e65c all: add .pos fields to all AST nodes, to avoid wrong positions in error messages 2020-11-04 13:34:12 +02:00
Delyan Angelov ab137e4164
cgen: print results of failed callexprs in `assert fn() == fn2()` (#6665) 2020-10-21 21:58:40 +02:00
Delyan Angelov 140166e1cd interpolation: support '' (rounding like in C) 2020-10-16 17:28:11 +03:00
Enzo fd88bfbac8
fmt: fix formatting of anon args (#6545) 2020-10-04 06:32:47 +02:00
Enzo 324d547cdb
parser: allow multiple types in match branch (#6505) 2020-10-01 01:07:36 +02:00
Alexander Medvednikov fca344d1fb all: fn args => params 2020-09-27 03:32:56 +02:00
Nick Treleaven 9958881cbe
parser: support parsing unsafe (as first token) as UnsafeExpr (#6032) 2020-09-19 19:18:36 +03:00
spaceface777 ff92c3409d
ast: merge `IfExpr` and `CompIf` (#6011) 2020-09-18 00:58:54 +02:00
Uwe Krüger 1bc9063573
parser: implement parsing of `select` block (#6379) 2020-09-16 15:34:57 +02:00
Nick Treleaven eb95a4333a
table: rename Arg to Param (#6337) 2020-09-09 13:21:11 +02:00
Alexander Medvednikov a55bea44da table: register rune type 2020-08-25 18:15:24 +02:00
Uwe Krüger 9602a25a0b
all: add builtin channel type `chan elem_type` (#6126) 2020-08-14 21:18:42 +02:00
Enzo f238890fe9
compiler: move attributes to declarations (#6026) 2020-08-04 20:10:22 +02:00
Nick Treleaven 7f447bb82f
ast: use Block instead of UnsafeStmt (#5981) 2020-08-02 14:06:44 +03:00
spaceface777 1feca22e28
jsgen: don't generate `JS.` struct decls (#6035) 2020-08-01 22:27:25 +02:00
spaceface777 1a5236e53d
jsgen: export module through commonjs (#5895) 2020-07-20 19:57:13 +03:00
Enzo 90d9040e6e
all: make comment expressions + fix vfmt array init (#5851) 2020-07-17 19:13:22 +02:00
Nick Treleaven 53023c1ca9
all: add UnsafeExpr (#5793) 2020-07-12 12:58:33 +02:00
Daniel Däschle c5dc1a33b6
all: remove `it` smartcast and replace with original variable name (#5764) 2020-07-09 17:14:14 +02:00
Daniel Däschle 5ea17ad2d4
all: if smartcast part 2 (#5754) 2020-07-08 15:46:58 +02:00
Daniel Däschle b62bf59c21
all: if-is smartcast part 1 (#5730) 2020-07-08 15:17:28 +02:00
Leah Lundqvist cfa8e0a81a
js: |0 -> parseInt (#5703) 2020-07-06 18:09:54 +02:00
Leah Lundqvist 659aa8db3c
js: fix int division (#5701) 2020-07-06 15:24:24 +02:00
Uwe Krüger 3b067f5f85
all: experimental locked concurrency support, part 1 (#5637) 2020-07-04 12:44:25 +02:00
Alexander Medvednikov b7175b54eb vweb: ['/:arg1/:arg2/action'] attribute 2020-07-03 15:10:39 +02:00
Delyan Angelov 56ae814cbc gen: fix js main entry point generation 2020-07-01 19:37:24 +03:00
Delyan Angelov 78e1127d99
cgen: treat the main module like any other v module 2020-07-01 00:53:53 +02:00
joe-conigliaro 73da3c9e4c
generic structs: better naming & comments 2020-06-30 09:22:15 +10:00