Joachim LF
491c873c90
[Poincare/parser] support ' as derivative
2021-02-12 08:36:57 +01:00
Arthur Camouseigt
bf95b460c3
[Sequence] Fixed computation error and asan fails
...
Change-Id: Ib3a619d29bee5cc6f10b939ee066459a5b135c5d
2020-11-04 15:33:04 +01:00
Arthur Camouseigt
3dca515441
[VariableBox] Added sequences to the variable box
...
It is now possible to call the value of a defined sequence anywhere.
Change-Id: I1990e93c50f9add175b7ea274e07004ba63289e5
2020-11-04 15:32:58 +01:00
Arthur Camouseigt
ed358590ce
[Sequence] Changed the way sequences are parsed
...
Change-Id: If19b46a317e4f336ac857690827ab08e147ac75a
2020-11-04 15:32:58 +01:00
Arthur Camouseigt
8434da60ef
[sequence] Changed sequences behavior
...
Sequences can now be defined using specific terms form other sequences :
Un = n
Vn = u(3)
Initial values can also depend on other sequences.
Should there be a circular dependency, the sequences concerned will
display "undef" as value
Change-Id: I6fe1f3ff7b500f35d480ddefb42de729c327432e
2020-11-04 15:32:58 +01:00
Gabriel Ozouf
52dcd8e749
[poincare/unit] Restructure Unit
...
1. Information about a unit's dimension now uses inheritance.
_m is an instance of DistanceAlias, which is derived from Alias.
A UnitNode now keeps a pointer to an Alias and one to a Prefix.
All aliases are still defined as constexpr.
This cleans up a lot of the code used namely for computing the
additional outputs in Calculation.
2. Instead of being defined with a string, each unit is described by its
ratio with the base SI unit (ex: _L is 0.001 instead of "0.001_m^3").
This greatly speeds up the calculations using units, as the algorithm
to find the best unit used to parse the definition.
Change-Id: I4d6ed6ad4cb967026a3f01a335aec270066e2b9f
2020-11-04 15:11:45 +01:00
Hugo Saint-Vignes
56a9e8d74b
[poincare] Fix LCM GCD bug on device compilation
...
Change-Id: I5ac11b7e72ede335db503b1d0f9c0be00710cd0b
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
cafb1c1c05
[poincare] LCM and GCD accept set of numbers
...
Change-Id: I367ff5e48fa2856e976aa020ac0d172216f3a421
2020-11-04 15:11:43 +01:00
Émilie Feral
56c45d1390
[poincare] Parsing: expression -> expression is always parsed but return
...
"undef" when the left expression is neither a custom variable or
function nor a unit.
This makes the behaviour consistent on theses expressions:
2 -> a+a
2 -> 2*a
2020-06-04 14:50:01 +02:00
Romain Goyet
950862f8d0
Use std::min and std::max
2020-04-14 09:31:02 -04:00
Léa Saviot
ebdac63681
[poincare/parser] u_ v_ w_ are not special identifiers anymore
2020-03-12 11:48:54 +01:00
Léa Saviot
ef249b0bdb
[poincare/parser] parseSpecialId must go through one of the subcases
...
Otherwise we might go through the method without creating leftHandSide
2020-03-10 11:35:37 +01:00
Léa Saviot
79f3ee43bc
[poincare/parser] log_ is not a special identifier anymore
...
The change was made a few commits ago, but this was forgotten
2020-03-10 11:35:37 +01:00
Léa Saviot
a06660ee25
[poincare/vert_off_lay] Subscript layout serializes without _
...
This way there is no parsing confusion when copy pasting the subscript of
a subscript layout
2020-03-02 09:55:11 +01:00
Léa Saviot
c23ad0c882
[poincare/parser] Fix a comment
2020-02-13 10:26:18 +01:00
Léa Saviot
1e3294139d
[poincare/parser] 0→0→c should not be parsable
2020-02-12 15:13:25 +01:00
Léa Saviot
d98eddf960
[poincare/parser] UnitConvert does not check the right member is a unit
2020-02-12 15:13:25 +01:00
Léa Saviot
83ea9cf1e1
[poincare/parser] Rename Store with RightwardsArrow
2020-02-12 15:13:24 +01:00
Léa Saviot
c543985094
[poincare] Unit conversion
2020-02-12 15:13:24 +01:00
Émilie Feral
4b98652ed9
[poincare] Parser: Context is now a member variable of the Parser class
...
instead of being given as a parameter in all methods
2020-02-12 15:13:23 +01:00
Émilie Feral
489901a613
[poincare] Units are now prefixed by "_" to distinct them from user
...
variable
2020-02-12 15:13:22 +01:00
Ruben Dashyan
1f3abec05e
[poincare/parser] Parse unit symbols
2020-02-12 15:13:22 +01:00
Léa Saviot
9d6bab092f
[poincare/parser] Identifier is not already function -> symbol
...
We check the context: if an identifier is already a function, we
interpret it as such, otherwise it is a symbol.
This way, in the Equation app, x(x+1) is interpreted as x*(x+1)
2020-02-12 15:13:21 +01:00
Léa Saviot
756eeeb2d8
[poincare/parser] Add context
2020-02-12 15:13:21 +01:00
Émilie Feral
7209265254
[poincare] Parser: forbid parsing 0xABCF as 0xABC*F
2020-02-12 15:13:19 +01:00
Émilie Feral
a900e39cf3
[poincare] Parser: fix sequence parsing
2020-02-12 15:13:19 +01:00
Émilie Feral
54c55d130a
[poincare] Tokenize/Parse BasedInteger
2020-02-12 15:13:19 +01:00
Ruben Dashyan
55e01fbfd4
[poincare/parser] Remove currentTokenIsReservedFunction and currentTokenIsSpecialIdentifier
...
Use GetReservedFunction and IsSpecialIdentifierName instead.
2020-02-12 15:13:16 +01:00
Ruben Dashyan
9a3e0e9bd3
[poincare/parser] Simplify GetReservedFunction
2020-02-12 15:13:16 +01:00
Ruben Dashyan
4ef46b4fdb
[poincare/parser] IsReservedFunctionName returns a pointer
...
and is hence renamed GetReservedFunction
2020-02-12 15:13:16 +01:00
Ruben Dashyan
967343f75d
[poincare/parser] Remove IsReservedName unused parameter
...
The function is only called in apps/shared/function.
2020-02-12 15:13:16 +01:00
Romain Goyet
a34ecd2769
[poincare] Use std::move when needed
...
When returning a subclass of an Expression as an Expression, make sure
to use std::move, otherwise the compiler cannot proceeed to copy
ellision.
2019-10-16 10:01:14 +02:00
Émilie Feral
9fbec16db4
[poincare] Merge MultiplicationImplicit and MultiplicationExplicit (they
...
were required if we wanted to parse into two distincts expression 2π and
2*π but don't)
2019-08-08 17:22:05 +02:00
Émilie Feral
c1cd0302b8
[poincare] Fix typo: explicite --> explicit, implicite --> implicit
2019-08-08 17:22:04 +02:00
Léa Saviot
ddb05d930d
[poincare/parser] Parse one multiplication/addition for 1+1+1+1+1+1
2019-08-08 17:22:04 +02:00
Émilie Feral
b11e6e5661
[poincare] System parentheses are not layouted but used only to
...
correctly serialized fraction layouts, integral layouts...
Layouts wrapped by system parentheses:
- fraction children
- fraction (to be able to omit multiplication)
- vertical offset index
- integral children
- sequence chidlren
2019-08-08 17:22:02 +02:00
Émilie Feral
fd25b678ce
[poincare] Split Multiplication into MultiplicationExplicite and
...
MultiplicationImplicite
2019-08-08 17:22:02 +02:00
Émilie Feral
d1f8c42ee6
[poincare] Parser: w is a symbol reserved for sequence
2019-08-08 17:22:01 +02:00
Léa Saviot
0298291043
[poincare/parser] Comment and new test about system parentheses
2019-06-26 14:03:08 +02:00
Léa Saviot
596a438557
[poincare/parser] Comment about parseCaretWithParenthesis
2019-06-26 14:03:08 +02:00
Léa Saviot
2ff03bb6a0
[poincare/parser] Pop corresponding types of parentheses
2019-06-26 14:03:08 +02:00
Léa Saviot
2fdbf2ea11
[poincare] VerticalOffsetLyt serializes as ^().
...
UCodePointLeftSuperscript and UCodePointRightSuperscript no longer exist
2019-06-26 14:03:08 +02:00
Léa Saviot
6109903f66
[poincare/serialization] Use system parentheses to serialize
...
This solves the problem :
(1
--- that serialized as ((1)/(2)), which was valid
2)
2019-06-26 14:03:08 +02:00
Léa Saviot
bbb10f1993
[ion/kandinsky] Move unicode to ion
2019-05-03 15:53:19 +02:00
Léa Saviot
d57e28bdc7
[poincare] Clean parsing with unicodes
2019-05-03 15:53:19 +02:00
Léa Saviot
f4e887309d
[parsing] Fix constant code point parsing
2019-05-03 15:53:19 +02:00
Émilie Feral
7b5f3c570d
[poincare] Change the way Expression are built
2019-02-21 11:29:35 +01:00
Émilie Feral
ac6f23684d
[poincare] Clean Expression and Layout builders
...
Before: Opposite(Opposite(Rational(1))) misleadingly created the
expression "-1"; now, Opposite::Builder(Opposite::Builder(Rational(1)))
creates "--1"
2019-02-21 11:29:35 +01:00
Émilie Feral
21fcc84df0
[poincare/parsing] Avoid invalid read (valgrind)
2019-01-22 14:57:17 +01:00
Léa Saviot
4788495d62
[poincare/parser] -1/2 gives - 1/2 and not -(1) / 2
2019-01-10 11:42:05 +01:00