Max Bruckner
b2857392bd
OperatorNode: Fix implicit multiplication
...
Fixes implicit multiplication when parenthesis is 'auto' and operands
are ConstantNodes.
This is handled by detecting that case and printing parentheses for
ParenthesisNodes even though they normally wouldn't with parenthesis
set to 'auto'.
2017-08-13 20:57:41 +02:00
Max Bruckner
1f4909c625
OperatorNode: switch-case in calculate..Parentheses
2017-08-13 19:26:37 +02:00
jos
967e65cceb
Refactored usage of properties .isNode, .isSymbolNode, etc. into using functions like type.isNode(x) for security
2017-08-12 14:38:03 +02:00
jos
16b0d620a1
Removed redundant dependency on math
2017-06-24 13:43:21 +02:00
Nekomajin42
9678d1a067
Change escape-goat to native escape function
2017-06-06 12:06:58 +02:00
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
73b774a51b
Use safe map, forEach, join
2017-05-05 12:32:21 +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
Max Bruckner
ab6d9268f3
OperatorNode: Use map instead of foreach in many places
2016-11-14 18:51:21 +07:00
Max Bruckner
493bd7f6b0
OperatorNode: Support more than two operands in toTex/String
...
Only for multiplication and addition though.
2016-11-13 15:50:32 +07:00
Max Bruckner
f4ef42271b
OperatorNode: toString/Tex: switch case -> if
...
This is in preparation for the next step, where the conditions will get
complexer than a simple switch case.
2016-11-11 20:45:10 +07:00
Max Bruckner
0dcd2f2ef4
OperatorNode: fix: implicit multiplication was not cloned
2016-11-11 11:59:24 +07:00
jos
26e1e26555
Fixed #635 : Node.toString options where not passed to function arguments
2016-04-03 11:31:08 +02:00
Max Bruckner
c72071dfb7
OperatorNode: toTex support for implicit multiplication
...
Use the option `implicit` with the value `hide` to not show the
multiplication sign for implicit multiplication. This is the default.
Use `show` otherwise.
2016-03-19 19:09:14 +01:00
Max Bruckner
65817dbf03
OperatorNode: toString support for implicit multiplication
...
Use the option `implicit` with the value `hide` to not show the
multiplication sign for implicit multiplication. This is the default.
Use `show` otherwise.
2016-03-19 18:48:54 +01:00
Max Bruckner
6f39ec5da9
OperatorNode: new 'implicit' attribute to mark implicit multiplication
...
This also modifies the parser to set this attribute
2016-03-19 14:25:58 +01: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
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
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
5767f1f912
OperatorNode: Fix bug from wrong use of getIdentifier
...
1+(1+1) with parenthesis set to 'auto' triggered a bug because
getPrecedence gets the precedence of the content of a node, but
getIdentifier still returns the 'ParenthesisNode' identifier in case of
a ParenthesisNode.
2015-05-07 12:04:53 +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
250707b668
Convert the isNode function into a boolean property.
2015-04-28 09:56:01 +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
55a66aeaaf
OperatorNode.toTex: get rid of unnecessary curly braces
2015-04-19 09:49:09 +02:00
Max Bruckner
8db07e23ad
OperatorNode.toTex: BUGFIX: make clear where the exponent belongs to
...
Without proper parentheses it's impossible to decide whether an exponent
belongs to the numerator of a fraction or to the entire fraction.
For ConditionalNode, the exponent is hard to see without parentheses.
2015-04-19 02:11:20 +02:00
Max Bruckner
f2bcfed89f
LaTeX: no spaces between operands and operators
2015-04-17 14:18:24 +02:00
Max Bruckner
7c1c9c0cef
Show less unnecessary parentheses in LaTeX output
...
OperatorNodes with exponentiation, fractions and conditions use less
parentheses.
2015-04-16 22:31:02 +02:00
Max Bruckner
dacf9fba46
OperatorNode: bugfix: toTex creates invalid LaTeX
...
toTex has been creating invalid LaTeX for fractions where the operands
are in parenthesis, see '(1+1)/2' for example
2015-04-05 14:29:15 +02:00
Max Bruckner
671734f215
util/latex: Use function names as keys for map of operators
2015-04-05 14:29:14 +02:00
Max Bruckner
e536af8328
OperatorNode: get rid of util/latex's toFunction
2015-04-05 14:29:13 +02:00
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