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 checkSyntax function to check if standard syntax as defined in user manual is followed #151

Closed
wants to merge 3 commits into from

Conversation

vidhanarya
Copy link
Contributor

Fixed syntax for input was not defined earlier as mentioned in issue #140, in this commit a function has been added which will check the given inputEquation if it follows the syntax defined in user manual. Example:

Before the function was added -

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

2.0 + 2.0


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

2.0 + 


>>> simplify(2 + .4)
INPUT: 2.0 + 4.0
OPERATION: simplify
OUTPUT: 6.0

2.0 + 4.0

(Adding 4.0 and 2.0)
6.0


>>> simplify(.2 + 4)
INPUT: 2.0 + 4.0
OPERATION: simplify
OUTPUT: 6.0

2.0 + 4.0

(Adding 4.0 and 2.0)
6.0

After adding function -

>>> simplify(2 + sin2)
Invalid Expression
>>> simplify(2 + sin())
Invalid Expression
>>> simplify(2 + .4)
Invalid Expression
>>> simplify(.2 + 4)
Invalid Expression

@vidhanarya vidhanarya force-pushed the dev_vidhan branch 2 times, most recently from 744afc3 to 6e72bd7 Compare March 11, 2019 11:43
@vidhanarya vidhanarya closed this Mar 11, 2019
@vidhanarya vidhanarya deleted the dev_vidhan branch March 11, 2019 11:52
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