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

Limit the depth of the binary numeric expression in Python #57

Closed
wants to merge 11 commits into from

Conversation

izeigerman
Copy link
Member

No description provided.

@coveralls
Copy link

coveralls commented Feb 4, 2019

Coverage Status

Coverage decreased (-0.06%) to 95.159% when pulling 496245b on iaroslav/python_bin_num_expr_depth into 5f5d99e on master.

@krinart krinart mentioned this pull request Feb 5, 2019
10 tasks
@krinart krinart force-pushed the iaroslav/python_bin_num_expr_depth branch from afce3de to e01c63d Compare February 6, 2019 04:09
@krinart krinart force-pushed the iaroslav/python_bin_num_expr_depth branch from e01c63d to a7fe5fb Compare February 6, 2019 04:10
@krinart krinart force-pushed the iaroslav/python_bin_num_expr_depth branch from e1acc4d to 24770bb Compare February 6, 2019 06:27

from m2cgen import ast


class BaseInterpreter:
class BaseAstInterpreter:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like Ast prefix here. It's kind of obvious what's being interpreted. Same true for AstToCode... why not just CodeGenInterpreter? Or even just ToCodeInterpreter?


expected_code = """
def score(input):
var0 = (1) + ((1) + (1))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test case where BinExpr are diluted with some other exprs?
Like BinNumExpr -> BinNumExpr -> SubroutineExpr-> BinNumExpr -> IfExpr -> BinNumExpr. Something along those lines.

@krinart
Copy link
Member

krinart commented Feb 7, 2019

Closed in favor of #60

@krinart krinart closed this Feb 7, 2019
@krinart krinart deleted the iaroslav/python_bin_num_expr_depth branch February 7, 2019 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants