-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTODO
More file actions
349 lines (349 loc) · 18.3 KB
/
TODO
File metadata and controls
349 lines (349 loc) · 18.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
- [70%] Types
- [x] Conversions
- [ ] Define "source paths"
- [ ] Describe operations like GetQNameInNsSetOrAnyPublicNs() and possibly others used in property lookup
- [70%] Property lookup
- https://github.com/whackengine/sdk/blob/master/crates/mxmlsemantics/src/semantics/property_lookup.rs#L353
- [x] PropertyLookup: remind of `meta` stuff
- [x] `meta::get` allows for multiple signatures
- [ ] Introduce lazily imported source files based in source paths, when lookuping from packages.
- [ ] Values whose static type is a type parameter will lookup for names in the type parameter's derived types.
- [ ] InScopeLookup
- [ ] Lookups with an algebraic enum as context type may infer a variant/variant namespace (e.g. `var exp : Exp = Sum(left, right)`, `var i : I = Loc.Get(idx)`)
- [ ] Introduce lazily imported source files based in source paths.
- [ ] `Env` qualifier causes DotEnv variable retrieval (or, depending on the implementation, may resolve to a predefined variable).
- [ ] Use `fixed=true` access when doing property lookup in activation's `this` (e.g. user should use `this` if the enclosing class is dynamic and needs to access a dynamic property).
- [ ] Constants
- [ ] *EnumConstant* for both regular enumerations and flag enumerations
- [ ] Reference values
- [ ] *DynamicReferenceValue*(*base*, *qual*, *key*.Value, *followedByCall*, *fixed*)
- [ ] *KeyValuePairReferenceValue*(*base*, *meta-method*, *qual*, *key*)
- [ ] Do not include XML reference values from Whack Engine
- [70%] Packages
- [70%] Namespaces
- [70%] Classes
- [70%] Enumerations
- [70%] Interfaces
- [70%] Variables
- [70%] Virtual variables
- [70%] Methods
- [x] Aliases
- [x] Parameterized types
- [x] Lexical scopes
- [x] Default lexical scope
- [x] Conditional compilation
- [x] ShockDoc comments
- [x] Meta-methods
- [x] Lexical conventions
- [ ] ShockScript: Expressions
- [x] `Embed()`
- [x] URL behavior
- [x] `"text/plain""`
- [x] `"application/octet-stream"`
- [ ] Qualified identifier
- [x] Fixed expression (FixedExpression)
- `<?fixed={}?>`
- [ ] String literal
- [ ] Is applicable to enumerations (also check for union)
- [ ] Is applicable to byte (ASCII), int, uint or the Number union (strictly one character allowed)
- [ ] Numeric literal
- [ ] Final type, when literal contains no suffix, is decided smartly (e.g. considers unions and possible meta-method parameters (including `meta::get` in a brackets operator)).
- [ ] XML expression
- [ ] XML literals applied as `XML`/`XMLList` shall still resolve namespace prefixes to lexical ShockScript names. (`namespace` definitions may be used as prefixes as well (definition name = URI); with implicit prefix.)
- [ ] Null literal
- [ ] Array literal
- [ ] Is applicable to flag enumerations
- [x] All literal `**` (AllLiteral)
- [ ] Object initializer
- [ ] Applicable to flag enumerations
- [ ] The rest operator may appear at most once and will be written before the actual fields regardless of its position among them. (This avoids programmer bugs.)
- [ ] Applicable to Map
- [ ] Applicable to record types
- [ ] The rest operator may appear at most once and will be written before the actual fields regardless of its position among them. (This avoids programmer bugs.)
- [ ] Filter out subtype fields
- [ ] Applicable to "track" record types
- [ ] The compiler contains different codegen for initializers of this such variant of record types (which writes to the inner hash map, and for the rest operator it reads its record's inner hash map).
- [ ] The rest operator may appear at most once and will be written before the actual fields regardless of its position among them. (This avoids programmer bugs.)
- [ ] For the rest operator, filter out subtype fields
- [ ] Applicable to classes that contain an optional constructor or a multi-method constructor that supports an optional signature, assigning instance variables; equivalent to `var o=new C();with(o){...};return o`
- [ ] In this case, the rest operator will reuse the fields of the specified object.
- [ ] The rest operator may appear at most once and will be written before the actual fields regardless of its position among them. (This avoids programmer bugs.)
- [ ] For the rest operator, filter out subtype fields
- [ ] Rest expression may be nullish to indicate absence.
- [ ] Parenthesized expression
- [ ] Does not propagate *followedByCall=true*
- [ ] Propagates *fixed=true* from given context
- [ ] Dot operator
- [ ] Propagates *fixed=true* from given context
- [ ] Brackets operator
- [ ] Propagates *fixed=true* from given context
- [ ] Descendants operator
- [ ] Takes a non-attribute qualified identifier.
- [ ] Equality, relational, arithmetic and bitwise operations using the `Number` union (from the ShockScript global objects) at either or both sides should be allowed, causing a forced conversion if necessary.
- [ ] Equality allows mixing compatible operands with void and/or null.
- [ ] Call operator
- [ ] Base is passed *followedByCall=true*
- [ ] Watch for static `meta::call` when calling classes (supports multiple signatures too)
- [ ] `XML` and `XMLList` being called statically shall still pass themselves as the context type to the first call argument, even if they define `meta::call()`.
- [ ] Perform type inference for omitted generic parameters.
- [ ] `v is T` operator
- [ ] Verify `v` first
- [ ] Verify `T` with `v`'s static type as the context type (for allowing algebraic enumeration's variant inference).
- [ ] Evaluation: Support matching union members
- [ ] `v as T` operator
- (... different from `T(v)`, do not verify T first ... this is mostly useless... and it being that way helps algebraic enum's variant inference)
- [ ] Verify `v` first
- [ ] Verify `T` with `v`'s static type as the context type (for allowing algebraic enumeration's variant inference).
- [ ] Assignment expression
- [ ] When base is *KeyValuePairReferenceValue*, `meta::set()`
- [ ] When base is *AttributeReferenceValue*, `meta::setAttribute()`
- [ ] Delete operator
- [ ] `meta::delete()`
- [ ] `meta::deleteAttribute()`
- [ ] New operator
- [ ] Base is passed *followedByCall=true*
- [ ] Support a dynamically typed base (`*` or `Class`)
- [ ] Forbid instantiating `abstract` or `static` classes.
- [ ] Forbid instantiating enumerations.
- [ ] Null coalescing `x ?? y`
- [ ] Pass x type to y
- [ ] `typeof`
- [ ] Returns `"xml"` for XML/XMLList
- [ ] Returns `"number"` for any types comprising the `Number` union
- [ ] Ternary conditional operator
- [ ] Ensure test is not an accidental binding of a function/method (where the user meant to "call" it)
- [ ] Conditional test - Accidental method binding prevention (where the user meant to "call" a method, and not obtain its Function object)
- [ ] logical !
- [ ] &&
- [ ] ^^
- [ ] ||
- [ ] ??
- [ ] ,
- [ ] ?:
- [ ] (x)
- [x] ShockScript: Type expressions
- [x] ShockScript: Patterns
- [ ] Structural matching automatically asserts objects as non-null (that way, the language doesn't need a "!" operator inside patterns)
- [ ] This is also particularly useful for if let applied to iterator results (e.g. `if (let [ch] = characters.next()) { ... }`)
- [x] ShockScript: Statements
- [ ] If statement
- [ ] Ensure test is not an accidental binding of a function/method (where the user meant to "call" it)
- [ ] If let statement
- [ ] For non-nullable assignment, ensure test is not an accidental binding of a function/method (where the user meant to "call" it)
- [ ] `for each`: `Iterator` and `Iterable` are iterable
- [ ] `switch type`: Provide context type for type inference on `case(...)` parameters when matching over an algebraic enumeration
- [x] ShockScript: Directives
- [ ] Variable definitions: const/let const (for an instance variable) may still be assigned later a first time in the constructor of a class if the initialiser was omitted.
- [x] ShockScript: Definitions
- [ ] Global objects
- [ ] (Whack engine) w namespace = "http://www.sweaxizone.com/2015/whack"
- [ ] SX namespace = "http://www.sweaxizone.com/2015/shockscript/global"
- [ ] generic namespace = "http://www.sweaxizone.com/2015/shockscript/generic"
- [ ] genericq = same as generic, but can be used as an access modifier in definitions
- [ ] meta namespace = "http://www.sweaxizone.com/2015/shockscript/meta" (under the hood it's not really that URI; it's the global "meta" system namespace)
- [ ] Intl namespace = "org.sx.intl"
- [ ] Temporal namespace = "org.sx.temporal"
- [ ] Env namespace (Env special qualifier) = "http://www.sweaxizone.com/2015/shockscript/Env"
- [ ] trace()
- [ ] etrace()
- [ ] assert() (a namespace-method)
- [ ] Assert methods have an optional Class constructor (usual Error signature). Their ShockDoc should include `@throws` for both `Error` and `AssertionError`.
- [ ] assert.equal() (uses `Object#equals()`, thus it's not a reference equality; advise care when using this; one might want `assert(x === y)` instead)
- [ ] assert.throws()
- [ ] encodeURI()
- [ ] decodeURI()
- [ ] encodeURIComponent()
- [ ] decodeURIComponent()
- [ ] isNaN()
- [ ] isFinite()
- [ ] parseInt()
- [ ] parseFloat()
- [ ] Infinity
- [ ] NaN
- [ ] undefined
- [ ] Number = union `(byte, short, int, uint, long, bigint, float, double, decimal)`
- [ ] DecimalContext
- [ ] Supports "precision" and "rounding" options for now (look at decimal.js's API to get some ideas)
- [ ] Iterator.\<T> (interface)
- [ ] required `next():[T]?` (the returned array must be of length 1)
- [ ] `length():int` (consumes the whole iterator)
- [ ] `skip(count:int):void`
- [ ] `meta::filter(...)` (returns another iterator)
- [ ] Other functional methods (iterator *helper methods* like `map`, `every`, `some`, `reduce`...)
- [ ] Iterable.\<K, V> (interface) requires keys() and values()
- [ ] Generator.\<T>
- [ ] Comparable interface
- [ ] `compareTo(obj:Object):int`
- [ ] This is used by default on array sorting.
- [ ] Object
- [ ] `equals(obj:Object):boolean`
- [ ] 1. First of all, try a `===` comparison and return true if that is already true.
- [ ] 2. Advise: equals() is by default structural
- [ ] 3. Boolean: return false
- [ ] 4. Number union
- [ ] floating points: NaN = NaN
- [ ] floating points: 0 = 0
- [ ] floating points: -0 = -0
- [ ] floating points: -0 != 0
- [ ] Otherwise return false
- [ ] 5. String: return false
- [ ] 6. Tuples
- [ ] 7. Records
- [ ] 8. "track" prefixed records (special kind of classes)
- [ ] 9. Simple enums === (flags are interned, so that would work)
- [ ] 10. Perform a deep field equality comparison -- Last case (not ===)
- [ ] Field/element equality goes as `x === undefined ? y === undefined : x === null ? y === null : x.equals(y)`
- [ ] `genericq::clone(deep:boolean=):Object` (used mostly as `generic::clone`, but the access modifier needs to use genericq)
- [ ] final
- [ ] deep=true by default
- [ ] Circular references are not preserved.
- [ ] Steps
- [ ] 1. Have we cached the cloning method f (without using a bound method) of the object's exact constructor?
- [ ] 1. Let o = The resulting of calling f with (this) or (this, deep). -- Check f Function length (1 or 2 (deep=))
- [ ] 2. Throw a TypeError if o is undefined or null or o's constructor is not exactly this's constructor.
- [ ] 3. Return o
- [ ] A MUST: For Boolean, String and each Number data type's Class provide a pre-cached Function (self):* that returns self as is
- [ ] NOTE: To clarify, org.sx.meta.* should provide a function somewhere for retrieving a class's instance method as a Function that clearly takes the `this` receiver as a regular parameter.
- [ ] 2. Tuples
- [ ] 3. Records
- [ ] 4. "track" prefixed records (special kind of classes)
- [ ] 5. For simple enums, return as is
- [ ] 6. Detect a fixture, compatible clone method (optional deep=?)
- [ ] If found
- [ ] Cache it as a non-bound-method.
- [ ] Let o = The resulting of calling f with (this) or (this, deep). -- Check f Function length (1 or 2 (deep=))
- [ ] Throw a TypeError if o is undefined or null or o's constructor is not exactly this's constructor.
- [ ] Return o
- [ ] 7. Let f = DefaultCloneBehavior
- [ ] 8. Cache f as the cloning method of this
- [ ] 9. Return the result of calling f with (this) or (this, deep).
- [ ] DefaultCloneBehavior(self, deep)
- [ ] Let c = self.meta::class
- [ ] Throw a TypeError if c.length != 0
- [ ] Let o = new c()
- [ ] Copy instance fields from self to o
- [ ] If deep=true, map the field value to val?.generic::clone()
- [ ] Return o
- [ ] `meta::class()`
- [ ] toString()
- [ ] toLocaleString()
- [ ] valueOf()
- [ ] Array
- [ ] +Iterable
- [ ] `new Array` supports taking iterables or iterators
- [ ] `meta::get(...)` throws if out of bounds
- [ ] `meta::filter(...)`
- [ ] `meta::has(...)`
- [ ] `filter(...)` (alternative for the optional chaining operator)
- [ ] `equals(o)` - Structural equality
- [ ] `clone(deep=)`
- [ ] `shift(): (void, T)`
- [ ] `pop(): (void, T)`
- [ ] `first : (void, T)`
- [ ] `last : (void, T)`
- [ ] Map
- [ ] +Iterable
- [ ] `Map(weakKeys:boolean = false)`
- [ ] `meta::get()` throws if key does not match
- [ ] `meta::has(...)`
- [ ] other meta hooks (e.g. set, delete)
- [ ] `length()`
- [ ] `equals(o)` - Structural equality
- [ ] `clear()`
- [ ] `clone(deep=)`
- [ ] Math
- [ ] `random()`
- [ ] `random(start, end)` (inclusive; most Number types supported)
- [ ] string
- [ ] +Iterable
- [ ] static `fromByte(...):string`
- [ ] length (in UTF-8 bytes)
- [ ] `byteAt():byte`
- [ ] `bytes():Iterator.<byte>`
- [ ] charAt()
- [ ] Returns empty string if out of bounds
- [ ] `charCodeAt():uint`
- [ ] Reads Unicode Code Point at given UTF offset
- [ ] Returns U+00 if out of bounds
- [ ] `chars():Chars`
- [ ] `format(vars:Map.<string, string>):string`
- Formats `$varName`, `${varName}` and `$$`
- [ ] Chars
- [ ] +Iterator
- [ ] `new Chars(str:string, offset:int = 0)`
- [ ] Indexing (peeking using zero-based Unicode code point positions; returns U+00 if out of bounds)
- [ ] `seq(numCodePoints:int):string` (stops on end of stream)
- [ ] `peek():uint` (equivalent to `chars[0]`)
- [ ] `reachedEnd:boolean`
- [ ] `hasRemaining:boolean`
- [ ] `clone():Chars`
- [ ] RegExp
- [ ] `equals(obj)`
- [ ] `clone():RegExp`
- [ ] RegExpMatches
- [ ] +Iterable
- [ ] Implement indexing
- [ ] `substr : [string]` (idx. 0 = whole)
- [ ] `length`
- [ ] `clone()`
- [ ] Function
- [ ] NOTE: Function internally holds some context (e.g. this receiver, captured locals, DecimalContext, DefaultNamespace, XMLContext).
- [ ] `length` = number of required parameters (optional or rest parameters do not count)
- [ ] `equals(obj)` override just using `===`
- [ ] `clone()` returns the same Function reference back without cloning
- [ ] whack.ds.BindableObject
- [ ] `equals(obj)` override just using `===`
- [ ] `clone()` returns the same BindableObject reference back without cloning
- [ ] XML
- [ ] Implement `Iterable`
- [ ] static `meta::call(arg:*):XML`
- [ ] `meta::has(name:QName):boolean`
- [ ] `@` prefix in name = attribute
- [ ] `meta::get(index:int):XML` (throws if out of bounds)
- [ ] `meta::get(name:QName):XMLList`
- [ ] `meta::set(key:(int, QName), value:(XML, XMLList)):void`
- [ ] `meta::delete(arg:(int, QName)):boolean`
- [ ] `sibling(n)` - e.g. `sibling(-1)` (previous) and `sibling(1)` (next) - uses `parent` internally.
- [ ] Attributes
- [ ] XMLList
- [ ] static `meta::call(arg:*):XMLList`
- [ ] XMLContext
- [ ] Represent this as a class and not a record type (object literal works on classes now)
- [ ] ignoreWhitespace defaults to true, which means "trim any whitespace at the beginning and end of text nodes". Unlike AS3/E4X, XML literals always ignore whitespace. (If whitespace is desired on text nodes, one may use CDATA.
- [ ] Namespace
- [ ] unlike QName, fully writable
- [ ] QName
- [ ] QName constructor
- [ ] If uri is undefined or unspecified: if name = "*", then uri=null; otherwise uri=default namespace
- [ ] `uri:?string` - May be null for "match any namespace"
- [ ] fully read-only
- [ ] ByteArray
- [ ] +Iterable
- [ ] Indexing
- [ ] `shareable:boolean`
- [ ] `clone()`
- [ ] Endian enum
- [ ] Date
- [ ] clone()
- [ ] override equals()
- [ ] `org.sx.intl.*`
- [ ] Like ECMA-262 `Intl`. Aliased `Intl::`, as well.
- [ ] Most data types implement clone()
- [ ] Most data types override equals()
- [ ] `org.sx.temporal.*`
- [ ] Like ECMA-262 like `Temporal`. Aliased `Temporal::`, as well.
- [ ] Most data types implement clone()
- [ ] Most data types override equals()
- [ ] `org.sx.meta.*`
- Used for what the `meta` namespace cannot be used for (e.g. perhaps extracting a list of properties from a package name).
- [ ] `org.sx.meta.ty.*`
- [ ] Allows most of type inspection during runtime. E.g. most can be obtained from Class or Function objects.
- [ ] `org.sx.meta.context.*`
- Special compiler functions for reflecting lexical contexts.
- [ ] decimal() - DecimalContext
- [ ] dxns() - default xml namespace
- [ ] xml() - XMLContext
- [ ] `org.sx.serial.json.*`
- [ ] `org.sx.serial.toml.*`
- [ ] `org.sx.serial.xml.*`
- [ ] Every serialization/deserialization methods require options that require at least the Namespace prefixes.