Commit Graph

208 Commits (9d0a5942acc0f75c500efb5d9cff98ebeb2630b4)

Author SHA1 Message Date
Tim Basel 9d0a5942ac
builtin: change IError `msg` and `code` to methods + fix vlib, add a deprecation notice for the old usages (#13041) 2022-02-11 15:52:33 +02:00
yuyi 291a1ffd8d
token: rename Position to Pos, rename position() to pos() (#13279) 2022-01-26 12:36:28 +02:00
yuyi ca1f675dba
ast, checker, cgen: implement if guard with multi return optional (#13273) 2022-01-25 14:36:33 +02:00
playX 7fe62a8b3e
js,os: fix `return` in `or` blocks; Properly get path_delimiter and path_separator in JS (#13179) 2022-01-15 09:55:03 +02:00
playX 104e0c5692
js: fix break and continue in or blocks (#13165) 2022-01-14 18:43:18 +02:00
Delyan Angelov 41e763f79c
checker: add error for `type StructAlias = Struct struct Struct { field StructAlias }` 2022-01-02 15:54:40 +02:00
playX a2468e1e0c
js,os: fix integer arithmetic; add Process.close() and os.is_readable() for VJS; Make tetris run on JS backend (#12940) 2021-12-23 11:36:42 +02:00
playX 2b9f993574
gg: add text rendering, keyboard event handling for JS and other fixes (#12932) 2021-12-22 12:26:52 +02:00
pancake cb65f2ff44
js: generate es5 methods for valueOf() and toString() (#12928)
Co-authored-by: pancake <pancake@nopcode.org>
2021-12-22 09:20:45 +02:00
playX b68c217d53
js: remove usage of default arguments for `-es5` flag (#12921) 2021-12-21 20:23:40 +02:00
playX 5f0160bf11
js,gg: more work on porting gg to JS backend (#12903) 2021-12-20 16:18:21 +03:00
yuyi cd0b581445
ast: rename 'table.get_type_symbol()' to 'table.sym()' and more related calls (#12898) 2021-12-19 18:25:18 +02:00
playX 11d2b8b354
js: support `-es5` flag (#12846) 2021-12-15 15:47:34 +02:00
playX 1cb06a2de4
js: ast.GoExpr support using promises on JS backend (#12749) 2021-12-07 12:11:54 +03:00
playX 105d7fcf75
js: support JS.await (#12726) 2021-12-05 13:33:53 +02:00
yuyi 0f50ac3260
ast: cleanup struct embeds related methods (#12719) 2021-12-04 18:46:41 +02:00
playX ddec89f9ee
js,vfmt: fix formatting for JS types; add fetch API (#12608) 2021-11-29 15:32:29 +02:00
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