54 Commits

Author SHA1 Message Date
Nekomajin42
e7aa5b4ec9 fix the escaping errors 2017-06-01 16:02:20 +02:00
Nekomajin42
e18cca6153 Revert "Revert "Use escape goat""
This reverts commit f83c88237f02edf7595e375606c1a0eaaa6ce50c.
2017-06-01 08:36:04 +02:00
Nekomajin42
f83c88237f Revert "Use escape goat"
This reverts commit 51e1b601b64d0bb782590e95c7a74bbb7fb179ff.
2017-06-01 08:35:47 +02:00
Nekomajin42
51e1b601b6 Use escape goat 2017-06-01 08:19:16 +02:00
Nekomajin42
7301b6fcf9 Implement toHTML() to Nodes
toHTML() method to each Node, and update in the docs
2017-05-21 15:47:43 +02:00
jos
27660d8c00 Some more security measures 2017-05-05 21:08:23 +02:00
jos
aef6203049 Use safe function arguments internally 2017-05-05 17:25:21 +02:00
jos
73b774a51b Use safe map, forEach, join 2017-05-05 12:32:21 +02:00
jos
19faeac16c Escape function names and properties 2017-04-24 21:36:00 +02:00
jos
c259c936ec Refactored compile into a factory function 2017-04-22 17:12:38 +02:00
jos
a7bd4cd833 Register _compile as separate functions 2017-04-22 16:49:22 +02:00
jos
b9c3b334e1 Refactored customs.js into a regular js file instead of factory 2017-04-22 13:04:29 +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
79993ceac7 Fixed #765: FunctionAssignmentNode.toString() returning a string incompatible with the function assignment syntax 2016-12-18 13:29:21 +01:00
jos
730a10749e FunctionAssignmentNode creates a TypedFunction 2016-05-22 14:25:48 +02:00
jos
5edecb56c8 Removed the check on the number of arguments from functions defined in the expression parser (see #665) 2016-05-18 21:08:40 +02:00
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
2353c4a61e Renamed folders util to utils 2015-07-18 13:22:38 +02:00
jos
936386c96c Fixed #405: Parser throws error when defining a function in a multiline expression 2015-07-11 20:21:49 +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
5b160767c1 operators.js: Pass parenthesis option directly 2015-05-16 13:31:57 +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
aa7ca9178f Implement 'all' parenthesis option 2015-05-08 09:07:15 +02:00
Max Bruckner
2959858b99 operators: Use config when calculating precedence etc.
Use the parenthesis configuration to decide wether ParenthesisNodes
should be skipped or not.
2015-05-07 10:13:43 +02:00
Max Bruckner
bc2c29be8c Make _toString functions call the wrapper 2015-05-07 10:12:32 +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
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
390a0060b4 Add is<NameOfNode> property to enable type checking across constructors 2015-04-28 09:14:53 +02:00
Max Bruckner
e62ab0dae4 Proper toTex for units and symbols.
Symbols now don't use `\mathrm` anymore by default, but units do.
2015-04-27 11:08:31 +02:00
jos
d3d3212633 Refactored all nodes into factory functions (see #342) 2015-04-26 21:25:31 +02:00
Max Bruckner
978bc2bc31 FunctionAssignmentNode.toTex: get rid of unnecessary curly braces 2015-04-19 09:49:08 +02:00
Jos de Jong
bc6f63b6c9 Merge pull request #318 from FSMaxB/latex-restructure
Restructure and complete the LaTeX generator.
2015-04-13 09:39:16 +02:00
jos
3150e21c8e Fixed #313: parsed functions did not handle recursive calls correctly 2015-04-09 20:29:51 +02:00
Max Bruckner
0868987cdf util/latex: use ":=" for assignments and '=' 'equal' 2015-04-05 14:29:14 +02:00
Max Bruckner
6b1d09f2cb util/latex: new toSymbol 2015-04-05 14:29:12 +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
6a9c2df38c Update FunctionAssignmentNode to better handle parenthesis 2015-03-01 17:10:09 +01:00
Max Bruckner
1f2f42012c New generic toString for FunctionAssignmentNode 2015-03-01 10:35:04 +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
72a1b03850 Documented expression tree API. Some internal refactoring in nodes. 2014-11-12 22:30:15 +01:00