-
Notifications
You must be signed in to change notification settings - Fork 78
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
Generate file with file name #100
Conversation
Codecov Report
@@ Coverage Diff @@
## master #100 +/- ##
==========================================
- Coverage 98.82% 98.78% -0.05%
==========================================
Files 26 26
Lines 3840 3855 +15
==========================================
+ Hits 3795 3808 +13
- Misses 45 47 +2
Continue to review full report at Codecov.
|
Also solve issue #81 |
solve issue #71 |
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.
Apologies for my late review -- I've had a busy few weeks. I've left some comments on your changes :) FYI for next time, it's easiest to keep unrelated fixes in separate PRs so we can look at each individually and merge them faster.
Also, feel free to add yourself to the contributors list in the README.
"-o", | ||
nargs="?", | ||
metavar="file", | ||
help="Place output into <file>", |
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.
Nitpicky: for consistency, could you make the first letter of the help string lowercase?
@@ -118,6 +122,12 @@ def get_arguments(): | |||
parser.add_argument("-z-reg-alloc-perf", | |||
help="display register allocator performance info", | |||
dest="show_reg_alloc_perf", action="store_true") | |||
parser.add_argument( | |||
"-o", | |||
nargs="?", |
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.
If I am not mistaken, as written this will accept the command shivyc -o
without warning or error. However, it appears GCC prints an error here, so we should do the same.
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.
Fix this on new pull request #101 .Code review is required.
and token_is(index + 1, token_kinds.close_paren): | ||
if token_is(index + 2, token_kinds.open_brack): | ||
return params, index + 1 | ||
elif token_is(index + 1, token_kinds.identifier): |
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'm a little confused by this code. Isn't the token at index + 1
always going to be a close parenthesis here?
I think it would be easier to implement this in the semantic stage of the compiler (i.e. in the tree/
directory) rather than in the parser, since this isn't really a parsing issue as much as it's a semantic one.
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.
Fix this on new pull request #102
@@ -600,6 +600,8 @@ def _generate_array_ctype(self, decl, prev_ctype): | |||
|
|||
def _generate_func_ctype(self, decl, prev_ctype): | |||
"""Generate a function ctype from a given a decl_node.""" | |||
# save identifiers | |||
identifiers = [] |
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.
Could you do this more easily on line 546 instead?
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.
Do you mean checking redefinition of identifier inside make_ctype?
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.
Fix this on #104
OK.I will fix it! Thanks for your code reviewing and comment! :) |
No description provided.