spreadsheet
typeScript/javascript spreadsheet parser, with formulas.
git clone https://git.vogt.world/spreadsheet.git
Log | Files | README.md
← All files
name: TODO.md
-rw-r--r--
5254
 1# TODO
 2
 3
 4### [ISSUE-001] Cells should have `formatAs` fields.
 5Instead of having non-primitives, (i.e. Date, DateTime, Time, Dollar), cells should have formats based on the highest-order type that was used during the compilation and execution of a cell's dependency. For example, `DATE` might return a number, but the cell that called `DATE` would be aware of it calling a formula that returns an non-primitive type, and would display the returned number as a Date. If you're using `DATE` in conjunction with `DOLLAR` it would still display the returned value as a Date. The hierarchy would look like: [Date, DateTime, Time, Dollar, number, boolean, string]. Advantages to this would include not having to cast down when using primitive operators, and flexibility in display. It would also simplify the types themselves, by having types be constants and just having helpers to convert, display, and do normal operations with them. Requires changes to `TO_DATE`, `TO_PERCENT`, `TO_DOLLAR`, and `TO_TEXT`.
 6
 7
 8### [ISSUE-002] CONVERT could offer more accurate conversions for units in the same system
 9For example 64 tbs to a qt.
10
11
12### [ISSUE-003] Range literals should be allow to follow commas
13Currently, this `=SERIESSUM([1], [0], [1], [4, 5, 6])` parses, but this `=SERIESSUM(1, 0, 1, [4, 5, 6])` does not.
14
15
16### [ISSUE-004] Parser/Sheet should be able to be initialized with js range notation (`[]`) or regular range notation (`{}`)
17
18
19### [ISSUE-005] TypeConverter.stringToDateNumber should handle fractions of a second.
20E.g. `01/09/2012 10:04:33.123`
21
22
23### [ISSUE-006] TypeConverter should be able to convert timestamps to numbers.
24E.g. `12:00:00` should result in `0.5`.
25
26
27### [ISSUE-007] Parser should be able to parse arrays without 'eval'
28Right now, arrays and reference literals in a formula are parsed using JS `eval`. This means, if we have references inside, or non-JS parsing values like TRUE or FALSE, they will cause ReferenceErrors. For example, `=SUM([M1, 10])` would throw `[ReferenceError: M1 is not defined]` because M1 is not a variable. Instead of using `eval`, we should parse the opening of an array, and the closeing of an array, and use recursion to see how deep we are, evaluating the tokens inside in the sam way we parse formulas and functions.
29
30
31### [ISSUE-008] Error literals should be thrown
32Error literals in valid locations should throw themselves. For example "=10 + #DIV?/0!" should throw a Divide-By-Zero error.
33
34### [ISSUE-010] Input should be able to start with a decimal.
35Currently '=.1' should parse properly. Could be solved by going back from handling number input in reg-ex to handling it with the parser logic. See [ISSUE-011].
36
37
38### [ISSUE-011] Input should be able to parse short-cut sci-notation
39Currently '=0.e1' should parse properly.  Could be solved by going back from handling number input in reg-ex to handling it with the parser logic. See [ISSUE-010].
40
41
42### [ISSUE-012] Strings should only start with double quotes.
43Single quotes are reserved for variables, like sheet names.
44
45
46### [ISSUE-014] Cell reference ranges should not return nested values
47For example '=(E1:E4)' should return an array of values, not a nested array of values.
48
49
50### Meta-Formulas to write
51Many of these formulas can be written by allowing the Sheet and Parser to return Cell objects in addition to primitive types. There are some memory issues with doing this. If a user calls something like `ISNA(A1:A99999)` we really only need the first cell. So we should return cell objects in some cases, but it would be easier in most cases to have context aware formulas, so if they need a cell, or a reference, we simply skip looking up a reference, and instead return a reference, or just a single cell. One way to do this would be to have formula functions, and then on the side have formula args. So before we lookup a large range of cells, we can check to see if it needs all of them, or if it just cares about the first one. So for `ISNA` we could look at `FormulaArgs.ISNA[0]` to get `Value` so we know that it needs only a single argument that is not an array, so if we call it with `ISNA(A1:A99999)`, it would really only lookup `A1`. This might be premature optimization however.
52
53* CELL - Requires changes to Parser/Sheet so that the raw cell is returned to the function. The raw cell should contain all information necessary for returning specified info.
54* HLOOKUP
55* INDEX
56* INDIRECT
57* LOOKUP
58* MATCH
59* OFFSET
60* VLOOKUP
61* COUNTBLANK - Requires changes to to Parser/Sheet so when we iterate through a range to return an array, we call a special function that accumulates all values, blank/null/undefined or otherwise.
62
63
64### Easy formulas to write
65* REGEXEXTRACT - May be difficult considering language differences.
66* REGEXMATCH - May be difficult considering language differences.
67* REGEXREPLACE - May be difficult considering language differences.
68
69### Other formulas to write
70* CRITBINOM
71* F.DIST.RT
72* LOGINV
73* T.INV
74* T.INV.2T
75* TINV
76* TTEST
77* LOGEST
78* MDETERM
79* MINVERSE
80* MMULT
81* TRANSPOSE - Depends on distinguishing between RowArray and ColumnArray.
82* TREND
83* FILTER
84* SORT
85* COUPDAYBS
86* COUPDAYS
87* COUPDAYSNC
88* COUPNCD
89* COUPNUM
90* COUPPCD
91* DISC
92* DURATION
93* INTRATE
94* PRICE
95* PRICEDISC
96* PRICEMAT
97* RECEIVED
98* YIELD