-
Notifications
You must be signed in to change notification settings - Fork 49
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
Improved math expressions #6
Conversation
Things are in a better state, + - / * work now for basic const var = 5 <operator> 1 Though the current method I'm using to make the ast isn't really going to work for dealing with precedence rules so some refactoring is needed going forward
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Node that identifiers are working, call expressions are not, that's a TODO / * % + - are working both other things like exponent and logical operators are also not working. Recasting is the most important thing to implement next
@@ -1296,6 +1313,61 @@ export function findClosingBrace( | |||
return findClosingBrace(tokens, index + 1, _braceCount, searchOpeningBrace) | |||
} | |||
|
|||
// function findOpeningBrace( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended not needing this, but might be useful in future, I danno maybe I should have just deleted it.
if (part.type === 'Literal') { | ||
return part.value | ||
} else if (part.type === 'Identifier') { | ||
return programMemory.root[part.name].value | ||
} else if (part.type === 'BinaryExpression') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now works with expressions with more than a single operator 🎉
# This is the 1st commit message: updates; Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #2: docs Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #3: remove descriptions Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #4: get snippet tests Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #5: updates Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #6: more autocomplete tests Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #7: updates Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #8: updates Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #9: updates Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #10: updates Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #11: tab to end of snippets Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #12: updates Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #13: updates Signed-off-by: Jess Frazelle <github@jessfraz.com> # This is the commit message #14: A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) # This is the commit message #15: A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
There was a bit more to it than I was expecting, dealing with order and precedence was a little tricky but mostly works now.
There are a few quirks but the base is there.
resolves #5