69 Commits

Author SHA1 Message Date
jos
9ffab397b6 Fixed #485: Scoping issue with variables both used globally as well as in a function definition 2015-11-28 21:20:25 +01:00
jos
188f43a26a Lazy loading works ... hurray!!! 2015-07-22 21:13:15 +02:00
jos
f19cfb4394 Reintroduced node.eval(scope). Updated some docs and examples 2015-07-18 10:21:48 +02:00
jos
6c592fa67c Added an example custom_loading.js 2015-07-14 21:13:00 +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
jos
6c7bf4acf0 Removed boolean, string, and null from the list with argument types, only leaving the directly supported types (which types can be converted to supported types is determined externally). Consistently renamed primitive types lower case (boolean, string, number, null) and non-primitive types uppercase (Complex, BigNumber, Function, Array, ...). 2015-05-20 21:08:26 +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
a347405a98 toString: implement callbacks and local configuration 2015-05-16 13:28:51 +02:00
Max Bruckner
291d620972 Pass local configuration to toTex functions 2015-05-16 13:27:48 +02:00
Max Bruckner
e383c1c2ce Throw errors when trying to toTex/toString a Node interface 2015-05-16 13:21:39 +02:00
Max Bruckner
4159064a33 Node.toTex: remove dependency on FunctionNode
This is achieved by overriding parts of Node.toTex in FunctionNode.toTex
2015-05-16 13:21:38 +02:00
Max Bruckner
6c2cd7f7b7 Node: add method 'getContent()'
The 'getContent' method returns the next node down the node tree that
isn't a ParenthesisNode.
2015-05-07 10:12:41 +02:00
jos
06b9664b87 Removed more instanceof checks 2015-05-05 15:21:57 +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
6235fd6ce1 Make toString a wrapper around _toString
This enables preparating the node tree in `toString` before generating
the actual string output with `_toString` methods
2015-04-30 00:12:54 +02:00
Max Bruckner
dca94e67b7 Node.toTex: improve 'not implemented' error message to contain the type. 2015-04-29 23:59:31 +02:00
Max Bruckner
15eb602a8f Remove workarounds from Node and ArrayNode 2015-04-29 12:12:46 +02:00
Max Bruckner
8282f424c2 Use the prototype for is<Node> instead of the constructor 2015-04-28 20:13:53 +02:00
Max Bruckner
1c76430dda Get rid of 'instanceof' for Nodes (except for constructors) 2015-04-28 10:09:19 +02:00
Max Bruckner
250707b668 Convert the isNode function into a boolean property. 2015-04-28 09:56:01 +02:00
jos
84512de60b Added a few more index.js files. Removed caching mechanism for function transforms (will be improved upon later again) 2015-04-27 14:54:03 +02:00
jos
d3d3212633 Refactored all nodes into factory functions (see #342) 2015-04-26 21:25:31 +02:00
jos
3150e21c8e Fixed #313: parsed functions did not handle recursive calls correctly 2015-04-09 20:29:51 +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
a973482ef2 Fix bug in fix of breaking change
Without this fix, the type passed to ArrayNode.toTex would stay there
forever until you change it back manually instead of being used only
once.
2015-03-14 09:09:07 +01:00
Max Bruckner
af763aa996 Fix breaking change (Node.toTex should return an empty string) 2015-03-13 21:23:14 +01:00
Max Bruckner
c9d20285e9 Fix breaking change ( passing type to ArrayNode.toTex ) 2015-03-13 21:23:14 +01:00
Max Bruckner
0fee9173c8 Enable custom toTex functions 2015-03-13 21:23:14 +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
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
86bcd55352 Changed the way transforms are registered internally, making Node.compile faster, and enabling lazy-loading constants 2015-01-13 10:48:52 +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
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
20c96894ab Enforcing implementation of _traverse on Nodes 2014-11-13 22:16:57 +01:00
jos
be9a8629ea Node.transform does not create a clone of the tree anymore 2014-11-13 22:01:48 +01:00
jos
423909e6f1 Changed constructor of RangeNode to new RangeNode(start: Node, end: Node [, step: Node]). 2014-11-13 21:25:37 +01:00
jos
bd1981ecd0 Renamed Node.map and Node.forEach back to traverse and transform 2014-10-13 21:42:48 +02:00
jos
adf0b39a69 Fixed deprecated messages 2014-10-12 19:45:05 +02:00
jos
b4de2cb549 Some code reorganization 2014-10-12 19:37:02 +02:00
jos
238281e28a Renamed traverse and transform to forEach and map 2014-10-12 19:32:51 +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
f23c87c4f7 renamed __transform__ to transform 2014-08-16 17:41:37 +02:00
jos
99fc9a0ead Implemented support for raw functions 2014-08-16 12:13:57 +02:00
jos
8200955d71 Removed unnecessary names of functions 2014-07-21 22:14:27 +02:00