Skip to content

Adding support for variables#89

Open
basta wants to merge 12 commits intoteamxenox:masterfrom
basta:master
Open

Adding support for variables#89
basta wants to merge 12 commits intoteamxenox:masterfrom
basta:master

Conversation

@basta
Copy link
Copy Markdown

@basta basta commented Dec 4, 2020

Variables work by modifying the expression input. You have a dictionary known_variables. In it, you have key value pair of radius: 8.14 (for example).
Then if the expression is 2 + radius => 2 + 8.14 internally.
The result is 10.14. Declaring variables is also easy
"value = 50*2" Result of this is value of variable => 100
"value + 2" Result of this is 102

Sadly I had to modify more things.
I had to remove xo and npm lint from package.json because I was unable to build otherwise because of errors in last commit. I will happily change this if any of the maintainers tell me what to do about it.

I don't think it would be a good practice to change a lot of the code in a pull request because some errors are for example a wrong capitalization of a comment.

Example: radius+2 becomes (value of radius)+2 => 8.14+2
Currently variables only defined in code in main.js/known_variables
… because there were too much errors (Warnings, that prevent releasing). It's temporary but I don't know what else to do
…e of unclean working tree. I really don't understand this js stuff
@sarthology
Copy link
Copy Markdown
Collaborator

Hey @BastionInCzech
Thanks for the submission. Will review this first thing in the morning.

@basta
Copy link
Copy Markdown
Author

basta commented Dec 7, 2020

Did some more last-minute testing, but I think it's okay at this stage. Coudln't find any more bugs.

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.

2 participants