57 Commits

Author SHA1 Message Date
jos
a18f2068f3 Fixed toString of a parsed expression tree containing an immediately invoked function assignment not being wrapped in parenthesis 2017-08-12 11:03:19 +02:00
jos
27660d8c00 Some more security measures 2017-05-05 21:08:23 +02:00
jos
ee6efa3768 Only allow accessing/assigning properties on plain objects. Only allow calling known methods. 2017-04-08 15:32:10 +02:00
jos
f8370bdaf1 Fixed #790: Expression parser did not pass function arguments of enclosing functions via scope to functions having rawArgs = true 2017-02-05 13:50:06 +01:00
jos
4306200c4c Implemented method Node.equals(other) for all nodes of the expression parser 2016-11-05 16:27:23 +01:00
jos
26e1e26555 Fixed #635: Node.toString options where not passed to function arguments 2016-04-03 11:31:08 +02:00
jos
89e1238fed Implemented read-only name-properties for AccessorNode and AssignmentNode, improved the name property of FunctionNode 2016-02-27 11:17:34 +01:00
jos
9173fbd3b8 Large refactoring of nodes: AssignmentNode. UpdateNode, AccessorNode, IndexNode 2016-02-25 15:02:44 +01:00
jos
fad5d8cc07 Merged parseFunctions and parseIndex into parseAccessors. Restricted support for implicit multiplication, execute as accessors instead 2016-01-09 21:11:29 +01:00
Max Bruckner
1983516c2f Tests for new templates 2015-06-07 19:26:31 +02:00
Max Bruckner
a598204fa7 Change template Syntax to ES6 like style
Access properties via ${property} and ${property[index]}
2015-06-07 18:49:58 +02:00
Max Bruckner
b3e8aae10c LaTeX templates for attached toTex properties 2015-06-07 18:47:50 +02:00
Max Bruckner
2b11b14632 Enable attaching toTex callbacks to functions 2015-06-07 18:41:25 +02:00
jos
a92b978036 Merged develop into v2 2015-06-07 15:57:41 +02:00
jos
c810981238 Method Node.compile() no longer needs math to be passed as argument. 2015-05-27 13:30:35 +02:00
Max Bruckner
3f217cefdd toTex: no global configuration. Only pass around one local object 2015-05-16 13:30:25 +02:00
Max Bruckner
c0e1b2d268 toString: no global configuration. Only pass around one local object 2015-05-16 13:29:55 +02:00
Max Bruckner
8d3b3bbe35 Tests for custom toString 2015-05-16 13:29:20 +02:00
Max Bruckner
291d620972 Pass local configuration to toTex functions 2015-05-16 13:27:48 +02:00
jos
f7c5381a13 Fixed Node.transform not recursing over replaced parts of the node tree (see #349). 2015-05-02 17:27:14 +02:00
Max Bruckner
390a0060b4 Add is<NameOfNode> property to enable type checking across constructors 2015-04-28 09:14:53 +02:00
jos
d3d3212633 Refactored all nodes into factory functions (see #342) 2015-04-26 21:25:31 +02:00
Max Bruckner
8ad525b66e util/latex: get rid of many unnecessary curly braces 2015-04-19 11:08:00 +02:00
Max Bruckner
55a66aeaaf OperatorNode.toTex: get rid of unnecessary curly braces 2015-04-19 09:49:09 +02:00
Max Bruckner
f2bcfed89f LaTeX: no spaces between operands and operators 2015-04-17 14:18:24 +02:00
Max Bruckner
13e35217b7 Latex restructure 2015-04-05 14:25:54 +02:00
Max Bruckner
47f76f35ac Limit custom toTex with multiple callbacks to FunctionNodes
Now only FunctionNode's toTex can be overwritten mit a map of callbacks
2015-03-17 18:14:14 +01:00
Max Bruckner
0fee9173c8 Enable custom toTex functions 2015-03-13 21:23:14 +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
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
jos
3d84b47658 Fixed #258: missing parentheses in the toTex representation of function permutations. 2015-01-03 10:29:55 +01:00
jos
309bf3938d Added proper error messages to Node.map 2014-11-15 13:32:02 +01:00
jos
9257ec3c33 Added unit tests for Node.map and Node.forEach 2014-11-15 13:16:32 +01:00
jos
a1f60db0d1 Created Node.map, changed traverse to use Node.map 2014-11-14 11:25:48 +01:00
jos
be9a8629ea Node.transform does not create a clone of the tree anymore 2014-11-13 22:01:48 +01:00
jos
72a1b03850 Documented expression tree API. Some internal refactoring in nodes. 2014-11-12 22:30:15 +01:00
jos
7132a6f3c2 Fixed #221 for one-based implementations of map and forEach 2014-10-14 09:03:04 +02:00
jos
bd1981ecd0 Renamed Node.map and Node.forEach back to traverse and transform 2014-10-13 21:42:48 +02:00
jos
238281e28a Renamed traverse and transform to forEach and map 2014-10-12 19:32:51 +02:00
jos
ba70c07509 Added unit tests for Node.clone 2014-10-11 22:29:48 +02: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
a172b52fdc Renamed raw to rawArgs (see #207) 2014-08-18 09:02:04 +02:00
jos
4a98f6efd4 Updated docs 2014-08-16 18:00:23 +02:00
jos
396777f724 Raw functions are now invoked as fn(args, math, scope) 2014-08-16 15:06:11 +02:00
jos
99fc9a0ead Implemented support for raw functions 2014-08-16 12:13:57 +02:00
jos
8a12c8e9bc Fixed #200: A new instanceof of math.js must now be created as math.create([options]) instead of math([options]) 2014-08-03 21:42:12 +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
7c761e390a Refactored ConstantNode to make it more flexible to various types of input 2014-06-23 11:51:01 +02:00