Commit Graph

2847 Commits

Author SHA1 Message Date
Léa Saviot
84f960356c [poincare] Add limit on iterative replacement of symbols 2018-11-23 12:04:06 +01:00
Léa Saviot
7a3451e3cd [poincare] remove max recursion limit 2018-11-23 12:04:06 +01:00
Léa Saviot
755af81d65 [poincare] Fix tests 2018-11-23 12:04:06 +01:00
Léa Saviot
60656f3ecd [poincare] Add tests on circular variables definitions 2018-11-23 12:04:06 +01:00
Léa Saviot
4ede2f8b86 [poincare] Add recursion protection around Exp:getPolyReducedCoefs 2018-11-23 12:04:06 +01:00
Léa Saviot
ada8f5f3c4 [poincare] Replace symbols with their expressions iteratively
... not recursively.
2018-11-23 12:04:06 +01:00
Léa Saviot
5bba2e9528 [poincare] Protect from deep recursion in Expressio::approximateToEval 2018-11-23 12:04:06 +01:00
Léa Saviot
1dc18d9a50 [poincare] Put back Edition2D as default 2018-11-23 12:04:06 +01:00
Léa Saviot
de2b3c22fe [poincare] Use reduce instead of deepReduce in simplify 2018-11-23 12:04:06 +01:00
Léa Saviot
4b4376a41f [poincare] Catch interrupted "simplify" in Poincare::Store 2018-11-23 12:04:06 +01:00
Léa Saviot
cb678e370e [poincare] Escape when recursion too deep 2018-11-23 12:04:06 +01:00
Léa Saviot
54b2566b04 [poincare] Indent code to make it clearer 2018-11-23 12:04:06 +01:00
Léa Saviot
667d373806 [poincare] Use deepreduce instead of reduce 2018-11-23 12:04:06 +01:00
Léa Saviot
07c2d6a95e [poincare] Interrupt simplification if current expression is matrix
Do not recursively check for matrices
2018-11-23 12:04:06 +01:00
Léa Saviot
f65b133b37 [poincare] use deepReduce instead of reduce 2018-11-23 12:04:06 +01:00
Léa Saviot
8b2c00d8ba [apps/poincare] Forbid variable creation with same name as existing func 2018-11-23 12:04:06 +01:00
Léa Saviot
861ba08198 Remove unneeded include 2018-11-23 12:04:06 +01:00
Léa Saviot
c7635c5e4d [poincare] Encapsulate deepReduce in reduce 2018-11-23 12:04:06 +01:00
Léa Saviot
5d96a87bf3 [poincare] Store simplified expressions, not just reduced 2018-11-23 12:04:06 +01:00
Émilie Feral
1b2c810eb2 [poincare] Delete useless method in Number 2018-11-23 12:04:06 +01:00
Léa Saviot
823d31150e [poincare/parser] Catch error from function call 2018-11-23 12:04:05 +01:00
Léa Saviot
0e2201b273 [poincare/parser] Return uninitialized expressions on parsing error
Instead of empty matrices
2018-11-23 12:04:05 +01:00
Léa Saviot
a11723d014 [poincare/parser] Add parsing tests 2018-11-23 12:04:05 +01:00
Léa Saviot
6b782d1a26 [poincare/parser] When parsing vector, propagate list parsing error 2018-11-23 12:04:05 +01:00
Léa Saviot
5f8c71898a [poincare] Regression and Series symbols must be 2 characters long 2018-11-23 12:04:05 +01:00
Léa Saviot
ad1629721d [poincare/test] Add parser test on "=5" 2018-11-23 12:04:05 +01:00
Léa Saviot
125479852c [poincare/parser] Error when Equal does not have a left hand side 2018-11-23 12:04:05 +01:00
Léa Saviot
4bbde7a4d5 [poincare] Remove useless forward declaration 2018-11-23 12:04:05 +01:00
Léa Saviot
cce6591f54 [apps] When editing an expression model, replace UnknownX with 'x' 2018-11-23 12:04:05 +01:00
Léa Saviot
bdbae0777e [poincare] Add Store tests 2018-11-23 12:04:05 +01:00
Léa Saviot
7b2abfe591 Fix typo 2018-11-23 12:04:05 +01:00
Ruben Dashyan
3d48f8ac93 [poincare] Complete and clean Parser 2018-11-23 12:04:05 +01:00
Ruben Dashyan
952f1e9292 [poincare] Parser's popTokenUntil changed to nextTokenHasPrecedenceOver 2018-11-23 12:04:05 +01:00
Ruben Dashyan
c97996696e [poincare] Complete and clean Parser's Tokenizer 2018-11-23 12:04:05 +01:00
Ruben Dashyan
5f734c3f4c [poincare] Add a string member to Parser's Token class
in the form of a pair m_text, m_length. Note that m_text
is not null-terminated. Moreover, the method compareTo is implemented
to compare m_text to any other (null-terminated) string.
2018-11-23 12:04:05 +01:00
Ruben Dashyan
3bee0f35fa [poincare] Add UntypedBuilder Function and Symbol
UntypedBuilders moreover retrieve Expression value from context.
2018-11-23 12:04:05 +01:00
Ruben Dashyan
93d8f60619 [poincare] Derivative, Integral, Product, Sum constructors check
their second parameter is of Symbol type.
2018-11-23 12:04:05 +01:00
Ruben Dashyan
4b72e4cef2 [poincare] Function constructor has additional length paramater 2018-11-23 12:04:05 +01:00
Ruben Dashyan
603e672cf3 [poincare] Add parsing tests 2018-11-23 12:04:05 +01:00
Ruben Dashyan
9c5ea70c24 [poincare] Make derived Expression s_functionHelper constexpr 2018-11-23 12:04:05 +01:00
Ruben Dashyan
61b1b8a09d [poincare] Add Expression::FunctionHelper class
That class is meant to contain data about named functions (e.g. sin,
tan...) in one place: their name, their number of children and a pointer to
a builder. The derived class corresponding to each such function
contains a private instance (m_functionHelper) and a getter.
The previous parser is removed, along with unecessary
constructors (used by the previous parsers).
2018-11-23 12:04:05 +01:00
Ruben Dashyan
cda6f522f0 [poincare] New static NumberOfChildren() method in Expression subclasses 2018-11-23 12:04:05 +01:00
Ruben Dashyan
e2e5fd6551 [poincare] Delete an accidentally inserted line in Randint 2018-11-23 12:04:05 +01:00
Ruben Dashyan
23c07e02ca [poincare] New static Name() method in Expression subclasses
Replaces the name() method in ExpressionNode subclasses.
When necessary, the createLayout and serialize methods in thoses
subclasses were moved to their .cpp file.
2018-11-23 12:04:05 +01:00
Ruben Dashyan
a859b69939 [poincare] No default type for Token constructor 2018-11-23 12:04:05 +01:00
Ruben Dashyan
799e59b031 [poincare] raiseError method in Parser 2018-11-23 12:04:05 +01:00
Ruben Dashyan
dd5bd7f39c [poincare] Parsing error handling for bang token 2018-11-23 12:04:05 +01:00
Ruben Dashyan
b27f98c287 [poincare] Rename Power Token as Caret 2018-11-23 12:04:04 +01:00
Ruben Dashyan
6c52a62168 [poincare] Use const-ref when parsing 2018-11-23 12:04:04 +01:00
Ruben Dashyan
c1943cfb49 [poincare] Correct stoppingType for parseSlash 2018-11-23 12:04:04 +01:00