95 Commits

Author SHA1 Message Date
dcode
34d86a0d6a Replace more workarounds with actual lazy compilation in stdlib 2019-02-21 05:42:33 +01:00
Daniel Wirtz
0c64f21250
Rework resolver (#489)
* Rework IR and resolver to use nested lookup tables
* Integrate types into IR
* Make components prefer IR, slimmed down AST
* Implement `export *`
* Add `@lazy` annotation and remove `--noTreeShaking`
* Add `@start` annotation and remove magic `main`
* Related refactoring, cleanup and docs
2019-02-21 00:11:22 +01:00
Daniel Wirtz
75328f3feb
Implement calls to 'super()' (#445) 2019-01-31 10:35:49 +01:00
dcode
65c4acd2d4 Skip over duplicate '| null's on nullable types 2019-01-30 10:56:22 +01:00
Daniel Wirtz
d843772314
Implement non-null assertions (#443) 2019-01-30 09:56:13 +01:00
dcode
df3b2befd7 Support type names with enclosed dots, see #423 2019-01-17 00:37:28 +01:00
Daniel Wirtz
ebae7cbd73
Implement optional type parameters (#360)
* Add a NATIVE<T> macro type to simplify use of a native WebAssembly type
* Add default type parameters for internal helpers for explicit loads and stores
* Unify loadUnsafe/loadUnsafeWithOffset etc. into one
* Renamed loadUnsafe etc. into just LOAD, like a macro
* Implement parsing of index signatures, but ignore them, for properly linting code
* Refactor TypedArray<T> to use macros
2018-12-07 14:33:32 +01:00
dcodeIO
a79db87af9 Fix parsing of properties and field names using semi-reserved keywords 2018-11-13 08:48:10 +01:00
Andy Hanson
0bb5cb829e Support definite assignment assertion x!: i32 (#260) 2018-10-27 18:29:59 +02:00
Daniel Wirtz
f7c734789e
Update Binaryen to latest; Various fixes 2018-10-11 08:49:08 +02:00
dcodeIO
63d4579118 Fix some array function parsing and serialization issues
Quite similar to #256 and also uses its test, but also fixes the serializer and doesn't try to parse an untyped 'x => x'.
2018-10-04 09:53:47 +02:00
dcodeIO
00fb45fcad Check for EOF on parse error in blocks, fixes #180 2018-07-21 03:11:33 +02:00
dcodeIO
26e46f6f86 Reintroduce builtin decorator so these can appear anywhere in stdlib again
Avoids wrapping an undocumented function within 'memory.size' for example.
2018-07-19 02:10:04 +02:00
dcodeIO
10a9f407bf Support object literal shorthands 2018-07-14 15:18:45 +02:00
dcodeIO
9e508de69a Implement object literal parsing; Instantiate classes from object literals
Essentially, if the contextual type is a class with a constructor that takes zero arguments or doesn't have a constructor at all, an object literal can be used to initialize a new instance of that class with preset values.
2018-07-14 04:00:04 +02:00
dcodeIO
c4199673ef Support parsing of class expressions, see #161 2018-07-10 03:03:59 +02:00
dcodeIO
27dbbd1d75 Support a bit more interface syntax when parsing, see #160 2018-07-10 00:34:40 +02:00
Max Graey
2e5a42d233 Fix unexpected TS1005 in tryParseSignature (#149) 2018-06-24 01:06:31 +02:00
dcodeIO
188b4e48ce Try parsing signatures only if node is callable, see #149; Minor refactoring 2018-06-24 01:04:24 +02:00
dcodeIO
48e96cbcf5 Add initial map implementation to tests, see #17 2018-06-19 04:23:22 +02:00
dcodeIO
25b433dca9 Support 'import * as' directives, see #27 2018-06-12 00:45:19 +02:00
dcodeIO
7478c8a0d3 Initial implementation of 'instanceof'
Works like an assignability check for now / does not yet honor nullables.
2018-06-07 17:04:41 +02:00
dcodeIO
9d25f78fc1 Implement 'this' context parsing and serialization; Other minor improvements 2018-05-30 16:22:56 +02:00
dcodeIO
7ad13f9d65 Add a 'call_indirect' builtin to emit arbitrary calls (might trap at runtime); Optimize 'for' loop compilation a bit 2018-05-25 15:59:17 +02:00
Alan Pierce
edf4aaa966 Allow trailing commas in import and export statements (#114) 2018-05-22 12:08:01 +02:00
dcodeIO
940392f463 Fix handling of readonly/type as identifiers, see #115 2018-05-21 11:14:14 +02:00
Alan Pierce
5ab81a00a1 Allow keywords in named import/export syntax (#107) 2018-05-13 13:26:12 +02:00
Alan Pierce
00fee73022 Implement optional trailing commas (#97) 2018-05-07 02:16:26 +02:00
dcodeIO
2ff1bb745a Fix some diagnostic issues when skipping invalid statements, see #80; Make game-of-life example somewhat interactive; Update dist files 2018-04-22 23:13:02 +02:00
dcodeIO
5a2f834c0d Fix game-of-life example inconsistencies; Fix ternary expression issues in void contexts and variable statements; Simplify HEAP_BASE handling 2018-04-18 15:12:33 +02:00
Daniel Wirtz
623597c23a
Make the transition to ArrayBuffer backed Arrays (#70)
* Traverse base classes when resolving overloads
* Implement preliminary TypedArray accessors
* Extract decorator flags from common flags to make space
* Add '**' overload
* Implement basic explicit inlining
* Support inlining of instance methods
* Reduce number of required locals when inlining
* Implement inlining of operator overloads
* Fix issues when inlining generic functions
2018-04-11 23:35:19 +02:00
dcodeIO
06198a3723 Rename lib prefix to '~lib' (parens aren't valid); Add built-in alignof<T>; Prepare for ArrayBufferView 2018-04-02 19:05:26 +02:00
dcodeIO
38a025950e Support parameter properties; Minor formatting 2018-03-25 00:21:58 +01:00
dcodeIO
721d77012b Math scaffolding 2018-03-24 17:18:15 +01:00
dcodeIO
4adb69f73a Binary expression operator overloads for +/==; Check allocation flow in ternary expressions; Cache empty array buffers; Sealed decorator for non-derivable internals 2018-03-23 12:45:29 +01:00
dcodeIO
49f4d3dff1 Eliminate @builtin decorator for compatibility with TS 2018-03-21 16:29:08 +01:00
dcodeIO
2c0ddf4f80 Support 'this' in static functions, fixes #45; Fix propagation of 'ambient' flag 2018-03-20 12:02:05 +01:00
dcodeIO
fea8e65a41 Fix 'static readonly' not being recognized as constant anymore, see #44 2018-03-19 19:36:39 +01:00
dcodeIO
0fef69e445 Set up documentation generation 2018-03-19 01:12:18 +01:00
dcodeIO
5eb10d404f Document the purpose of most files 2018-03-17 23:41:48 +01:00
dcodeIO
83e96892f2 Statically eliminate unnecessary branches in generic contexts
In order to use the new compile time type checks in generics, untaken branches must be skipped because these might be invalid.
2018-03-17 14:40:58 +01:00
dcodeIO
faac3c31eb AST cleanup; Definition generators scaffolding 2018-03-17 01:37:05 +01:00
dcodeIO
8e7bad7459 Reduce unnecessary diagnostic noise 2018-03-14 15:31:50 +01:00
dcodeIO
23a7db4dc3 Ensure consistent variable modifiers
'var' is a distinct local or mutable global, 'let' a shared local
2018-03-13 02:32:10 +01:00
dcodeIO
c93f0bb1fe Fixed a function expression parsing issue
Also uncovered a yet-to-be-fixed issue when immediately calling a returned function
2018-03-12 19:39:05 +01:00
dcodeIO
7870e3ac18 Generic function type aliases 2018-03-12 17:44:09 +01:00
Daniel Wirtz
423533c6b0
Implement function types / indirect calls / trampolines (#39) 2018-03-12 14:06:39 +01:00
dcodeIO
d81ce5f907 Retain wrap state in parenthesized expressions; Void statements fwiw 2018-03-04 18:52:12 +01:00
dcodeIO
d4c00eaba3 Revised implicit type conversions; Initial function expression compilation 2018-02-28 01:48:01 +01:00
dcodeIO
bda6cb9792 Initial function expression parsing 2018-02-27 02:28:36 +01:00