Skip to content

Instantly share code, notes, and snippets.

@RotBolt
Created June 9, 2019 09:28
Show Gist options
  • Save RotBolt/c83c58278a4ab25836311fa357e1957f to your computer and use it in GitHub Desktop.
Save RotBolt/c83c58278a4ab25836311fa357e1957f to your computer and use it in GitHub Desktop.
for (operator in Operators.values()) {
var position = expression.reversed().lastIndexOf(operator.sign)
while (position > 0) {
if (isOperator(operator, expression, position)) {
...
...
}
// check again for same operator till the previous position
if (position > 0) {
position = expression.substring(0,position).
reversed().lastIndexOf(operator.sign)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment