39 Commits

Author SHA1 Message Date
Max Bruckner
0772a1fb81 util/latex: Get rid of toUnit ( hasn't been working anyway ) 2015-04-05 14:29:12 +02:00
Max Bruckner
e160efbb66 util/latex: get rid of the toOperator function 2015-04-05 14:29:11 +02:00
Max Bruckner
5dcb87aeaa util/latex: Remove unused functions
* toArgs
* addBraces
* dots and curly functions

util/latex.js: Remove Function addBraces

util/latex.js remove dots and curly functions
2015-04-05 14:29:09 +02:00
Max Bruckner
13e35217b7 Latex restructure 2015-04-05 14:25:54 +02:00
Max Bruckner
e04dfd26bc Rename customFuncions to callbacks 2015-03-17 18:30:26 +01:00
Max Bruckner
35ce7f7fb4 Make Node.toTex a wrapper like Node.compile
Node.prototype.toTex is now a wrapper that calls the node's _toTex
2015-03-13 21:23:14 +01:00
Max Bruckner
37c1363c2d Pass callbacks to toTex functions 2015-03-13 21:23:13 +01:00
Max Bruckner
b2d868c2ed Update OperatorNode's toTex to better handle parens
Use the new infrastructure in OperatorNode's toTex
2015-03-01 16:34:09 +01:00
Max Bruckner
1ac3319656 OperatorNode: validate input 2015-03-01 10:35:03 +01:00
Max Bruckner
0e5a6e5a38 New generic toString for OperatorNode 2015-03-01 10:35:03 +01:00
Max Bruckner
946df4d4b2 Function to calculate all necessary parentheses
calculateNecessaryParentheses takes an OperatorNode and it's arguments
and calculates which of those arguments need to be put in parentheses
based on precedence and associativity.
2015-03-01 10:35:03 +01:00
Max Bruckner
d593e749e9 New function getIdentifier() for Nodes
getIdentifier() returns a String that contains the name of the node and
the function associated with it ( in case of FunctionNode and
OperatorNode ).
2015-03-01 10:35:03 +01:00
Max Bruckner
183d15fcfe OperatorNode: remove unnecessary elseif 2015-02-14 02:36:57 +01:00
Max Bruckner
bbe22a9055 fix: no brackets with single operators (bug #273)
* Use brackets after unary minus followed by an OperatorNode with + or -
 - "-(a+b)", "-(a-b)"
* Use brackets in fron of postfix operators like '!' (for OperatorNode)
 - "(a*b)!", "(a+b)!"
2015-02-14 02:36:38 +01:00
Max Bruckner
23b1890f7e fix indentation of previous commit 2015-02-14 01:48:54 +01:00
Max Bruckner
9b6d7ead9f Fix missing brackets in LaTeX output (bug #273)
When creating the LaTeX output for expressions like 1-(1+1) or 1-(1-1),
the bracket's where missing.
2015-02-13 16:51:40 +01:00
jos
309bf3938d Added proper error messages to Node.map 2014-11-15 13:32:02 +01:00
jos
5669ae1365 Some refactoring 2014-11-14 11:35:13 +01:00
jos
a1f60db0d1 Created Node.map, changed traverse to use Node.map 2014-11-14 11:25:48 +01:00
jos
72a1b03850 Documented expression tree API. Some internal refactoring in nodes. 2014-11-12 22:30:15 +01:00
jos
95a49fe156 Node.transform first clones the node tree 2014-10-11 21:59:47 +02:00
jos
839e596772 Implemented transform and traverse 2014-10-11 18:03:41 +02:00
jos
5f08307391 Implemented a function replace for nodes of a parsed expression. 2014-10-11 15:33:23 +02:00
jos
6b833a581c Renamed FunctionNode to FunctionAssignmentNode, and renamed ParamsNode to FunctionNode for more clarity (see #203) 2014-08-03 21:13:24 +02:00
jos
40986a1325 Using strict mode now in all files (added 'use strict'; on top of every file) 2014-07-18 23:19:14 +02:00
Niels Heisterkamp
086e59061a Fixed test and removed remaining console.log. 2014-05-19 20:32:25 +02:00
Niels Heisterkamp
12147b3bd4 Some tweaks and fixes 2014-05-19 19:27:42 +02:00
Niels Heisterkamp
b7fe0bfbf1 Added LaTeX conversion of expressions using toTex() on expression.
Also added some basic tests, which cover some use cases; but should be expanded.
2014-05-19 08:20:06 +02:00
jos
1189efd4d8 Added property type to all expression nodes in a node tree. 2014-04-24 20:26:51 +02:00
josdejong
8cea27406b Some internal refactoring 2014-04-06 11:22:13 +02:00
josdejong
b046c7ee98 Completed unit tests for all expression nodes 2014-03-01 15:55:20 +01:00
josdejong
42548e1cf0 More unit tests 2014-02-28 22:50:46 +01:00
josdejong
5d96ce4c16 Removed old code for expression evaluation 2014-01-07 21:07:43 +01:00
josdejong
00e55b917e Replaced eval with compile 2014-01-07 16:12:57 +01:00
josdejong
5f81246136 Implemented global definitions internally in expression compilation 2014-01-05 15:01:07 +01:00
josdejong
f6acb12e4d Implemented expression compilation for 80% 2014-01-01 20:46:30 +01:00
josdejong
3a4c1c5ef0 Internally renamed variable options to settings 2013-11-21 13:39:24 +01:00
josdejong
c8a289a08c Removed unnecessary .js suffix in module require statements 2013-10-20 14:01:31 +02:00
josdejong
eadb884af9 Moved around code and namespaces in order to separate expression parser related code. 2013-08-31 09:37:14 +02:00