Commit Graph

191 Commits (f584e70cf2fe862a93c1521b9d67eb2c83bdc4d2)

Author SHA1 Message Date
playX f584e70cf2
js: add fixes for generic structures and functions; add promise API; refactor modules (#12575) 2021-11-25 16:49:53 +02:00
playX b0bc112168
jsdom, examples: add more WebGL APIs; add interactive 3D cube example running on VJS (#12562) 2021-11-24 20:31:39 +02:00
playX 243e66a106
js,jsdom: Canvas & context API; Added TypeSymbol.is_js_compatible & temporary hacks for JS ifaces (#12526) 2021-11-20 21:28:11 +02:00
playX 1edb3e559e
js,jsdom: make JS structs plain objects; add more DOM API support for jsdom (#12501) 2021-11-18 10:09:53 +02:00
playX 2eb02ff5a7
jsdom, js: start refactoring jsdom; improve JS interfaces; add two attributes for them (#12488) 2021-11-17 11:41:33 +02:00
yuyi 5a89c0a480
ast: change CompFor to ComptimeFor (#12482) 2021-11-17 08:29:43 +02:00
yuyi c28041cecc
all: cleanup/rename all `comp_` names to be `comptime_` (#12467) 2021-11-15 15:47:29 +02:00
playX a8a1e9381f
strconv,js: f64_to_str works on JS backend now; Fix BigInt usage in infix expressions (#12464) 2021-11-15 14:13:44 +02:00
playX a4c57ba56e
js: support JS interfaces (#12426) 2021-11-11 14:36:32 +02:00
playX 194b3647e2
js,checker: allow casting JS primitives to V primitives and vice-versa (#12420) 2021-11-10 11:37:16 +02:00
playX a32dae335a
js: fix interfaces behaviour & disable struct deep copy for now (#12333) 2021-10-29 11:23:40 +03:00
playX fa02418a55
js: copy variables passed to closures (#12328) 2021-10-28 19:31:56 +03:00
playX cfecb62299
js: DOM API. Part 1 (#12296) 2021-10-27 23:18:09 +03:00
playX 2eae4cf63e
js: fix optional error propagation (#12283) 2021-10-24 15:56:44 +03:00
playX 864d6eae6b
js: codegen & vlib fixes, replace the Game of Life CLI example (#12272) 2021-10-22 22:03:19 +03:00
ChAoS_UnItY 5b69593766
cgen,js: fix missing break in switch case, generated by match with range branches (#12260) 2021-10-21 22:30:05 +03:00
ChAoS_UnItY ab350d52ec
cgen: support RangeExpr while emitting enum switch case (#12226) 2021-10-19 17:02:22 +03:00
ChAoS_UnItY 53c2e262f1
cgen & jsgen: generate when possible a `switch` from `match x {` (#12216) 2021-10-18 10:59:52 +03:00
playX a3de67de28
js: support WASM interoperability using `wasm_import`/`wasm_export` fn tags (#12212) 2021-10-18 10:56:21 +03:00
ChAoS_UnItY 4d1307f29b
all: index accessor in array init expression (#12181) 2021-10-15 03:57:49 +03:00
playX 22962dd2d2
js: change codegen for match statement, speedup string.split_into_lines (#12157) 2021-10-12 09:52:16 +03:00
ChAoS_UnItY d0c961ebc0
transformer: eliminate unreachable branches in IfExpr and fold more expressions and statements (#12135)
* v: fix using constant as length in fixed array

* format test file

* v/trasnformer: discard unreachable if branches

* transform more expressions and statements

* replace IfExpr with EmptyExpr when all branches were eliminated

* fix typo

* fix gens

* only allows branch elimination on if expression statement

* fix native gen

* fix handling of multi branch ifs in the native backend, also allow for `if true {}`

Co-authored-by: KyleLin921021 <43753315+KyleLin921021@users.noreply.github.com>
Co-authored-by: Delyan Angelov <delian66@gmail.com>
2021-10-11 14:29:17 +03:00
playX 33a1006cc5
js: comptime&assert improvements, more `byte` and `strings.Builder` methods ported (#12096) 2021-10-07 15:55:47 +03:00
Wertzui123 77c18f4435
cgen: fix alphabetic order of ast statement generation (#12080) 2021-10-06 14:32:42 +03:00
playX b2945e916f
js: add initial support for runes (#12077) 2021-10-06 10:43:49 +03:00
playX 8d1ba52d0c
js: fix string.bytes codegen, readline, add tests for `strings` (#12060) 2021-10-04 18:28:30 +03:00
playX 9145cd66ec
js: add more tests to builtin/js and implement more builtin functions (#12049) 2021-10-03 10:08:21 +03:00
playX 82f187e5e0
js: fix `rand` build, properly use key values on map, add `rand.string` (#12020) 2021-10-01 21:23:49 +03:00
playX 4333a53f28
js: support running `.js.v` tests in `v test-self`, fixes for array methods & codegen (#12011) 2021-09-29 15:33:14 +03:00
playX 863dd0b23e
js: array improvements (#11952) 2021-09-26 07:33:53 +03:00
yuyi 108a01d65f
fmt: fix unnecessary line break in array init (fix #11448) (#11562) 2021-09-21 16:20:09 +03:00
Enzo b2ecca3966
all: remove `size_t` (#11478) 2021-09-21 02:12:38 +03:00
yuyi 44ec8a8cd4
v.fmt, v.gen.js: use 'if foo in [TypeA, TypeB]' in fmt.v and js.v (#11524) 2021-09-17 21:59:16 +03:00
playX c175b4fd48
v.gen.js: refactor code, fix alias codegen, `-stats` now again works with tests on the JS backend (#11512) 2021-09-16 14:00:15 +03:00
playX 7d1776b84d
js: equality method generation for V types (#11503) 2021-09-16 07:07:48 +03:00
playX b9dfc89aa9
js: prefix V builtin functions, so they do not overlap with JS (#11483) 2021-09-13 11:44:55 +03:00
playX 5b619b99c2
v.gen.js: Interfaces support, fix for error propagation & panic stacktraces (#11471) 2021-09-11 14:24:47 +03:00
Alexander Medvednikov ab3adf3346 checker: no longer allow automatic dereferncing in `a = b` 2021-09-09 20:21:01 +03:00
playX 72089c4feb
js: use prefixed names for functions and global symbols (#11387) 2021-09-08 20:30:46 +03:00
playX a4df418a68
js: support `[export: 'AnotherName']` for FnDecl codegen (#11377) 2021-09-03 13:00:24 +03:00
playX 08c517c966
strconv,v.gen.js: proper optionals returns, strconv compiles to the JS backend (#11364) 2021-09-03 12:16:07 +03:00
playX a9b705bfd8
js: fix printing, make builtins for result and option types behave correctly (#11336) 2021-08-30 20:47:18 +03:00
playX 61ac7b671d
js: add initial support for optional types, IfGuardExpr codegen for `if` (#11332) 2021-08-29 14:27:17 +03:00
playX 118c5fdcd8
js: fix -stats compilation of tests, proper alias codegen (#11327) 2021-08-28 16:57:33 +03:00
playX bdf11d969a
js: add basic support for running tests, fix string.replace_each (#11314) 2021-08-26 15:20:54 +03:00
playX 109d5d5847
js: `os` now compiles to the JS backend, more builtins & minor codegen fixes (#11302) 2021-08-25 14:40:53 +03:00
playX d78e7e3b2b
js: codegen fixes, W.I.P `os` availability for JS backend (#11281) 2021-08-23 14:25:02 +03:00
playX dd486bb0fb
js: match support (#11269) 2021-08-22 19:36:49 +03:00
playX 2f6b2dd189
js: math.big support, f{32,64}_bits,from_bits support, typeof(expr).name support (#11260) 2021-08-21 17:18:57 +03:00
playX 1570e613b5
math: inf,nan,fmod for the JS backend (#11246) 2021-08-20 01:14:49 +03:00