-
Notifications
You must be signed in to change notification settings - Fork 0
Accepting Numeric Input #2
Copy link
Copy link
Open
Labels
featureNew feature or requestNew feature or request
Description
When a digit or '.' is typed and the cursor's position is...
- in a placeholder, populate the placeholder with a numeric expression.
x + _|becomesx + 4
- inside a number, insert the character into the number.
y * 4|.35becomesy * 46.35
- in an infix binary operator or prefix operator and the next node is...
- a placeholder, populate the placeholder with a numeric expression.
w -|_becomesw - 9(-|_)becomes(-9)
- a number, append the character to the number.
z +|7becomesx+17(-|20)becomes(-120)
- a variable and the operator is...
- binary, insert a multiplication with a new number as the left child and the variable as the right child.
6 -|xbecomes6 - 2 * x3 ^|abecomes3 ^ (2 * a)
- prefix, replace the unary operator with a multiplication between the unary operator with a new number and the variable.
(-|t)becomes(-4)*t
- binary, insert a multiplication with a new number as the left child and the variable as the right child.
- a placeholder, populate the placeholder with a numeric expression.
postfix operators: TBD
Note:
Should '.' be considered a binary operator? It would solve the issue of a numeric expression solely containing '.' being a legal expression, and potentially of it being inserted more than once into a single number. It would also create placeholders on either side.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request