Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added function and test cases to check syntax of input equation #155

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

vidhanarya
Copy link
Contributor

Before generating tokens, tokenizer will check for the syntax of the input equation if it matches standards defined in User Manual -> Syntax Guidelines as described in issue #140 .

Example:

Before adding function-

(aeroenv) vidhanarya@macbookpro:visma$ python main.py 
>>> simplify(.2 + 4)
INPUT: 2.0 + 4.0
OPERATION: simplify
OUTPUT: 6.0

2.0 + 4.0

6.0
(Adding 4.0 and 2.0)


>>> simplify(2 + sin2)
INPUT: 2.0 + 2.0
OPERATION: simplify
OUTPUT: 2.0 + 2.0

2.0 + 2.0

When function was added-

(aeroenv) vidhanarya@macbookpro:visma$ python main.py 
>>> simplify(log2)
Invalid Expression
>>> addition(log2+log3)
Invalid Expression
>>> simplify(log(2))
INPUT: log(2.0)
OPERATION: simplify
OUTPUT: log(2.0)

log(2.0)


>>> simplify(0.2 + .4)
Invalid Expression
>>> simplify(.3 + 4)
Invalid Expression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant