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
Pyparsing extra debug information on parse failure and preliminary macro support #34
Conversation
Should this still be considered a work in progress? if so, let's change the heading to include [IN PROGRESS] Perhaps we should split the macro support into its own pull request. I don't like having two orthogonal things in a pull request. Also, I'm wondering the best place to report asm_pyparsing issues back to you; the GitHub issues on your fork? In particular asm_pyparsing isn't doing DAT of strings correctly (asm.py now supports them) |
I think all discussion should be in pull requests that are opened early, |
@jtauber, point taken about putting stuff into different pull requests. In this case, it didn't seem to me to be worth the overhead of making two separate ones, and the development was done together. All of the changes are more or less incremental improvements, and I wanted to make the work in progress on macro support visible. With regards to the issues, I'm fine with them going here if you're okay with that, though it's best to @mention me if you want me to notice for the first time so that I get a notification. @swarmer - do you know of a way to add code to a pull request once it is made? |
Um, you just push the code? I think you can even open request again with new commits after it was merged. |
@pwaller if you just continue to push to the branch, it adds it to the pull request |
Macros almost work, but not quite. I'm just having trouble figuring out how to modify the macro so that arguments are substituted. It shouldn't be much more work, but I don't have time for it in the immediate future. |
Also just to mention that I've been working on making the parser a bit more robust, so this should catch a fair number of mistakes and tell you where they are, and developing on the grammar is easier with the new debugging information. |
If this branch is not going to be merged soon I suggest to backport 4358c1f into master |
If someone submits a separate pull request to backport 4358c1f I'll accept it |
Conflicts: asm_pyparsing.py disasm.py
So far as I can tell, macro support now works properly, including things like labels inside macros. It turned out to be rather more complicated to implement than I had hoped. Apologies for putting so much in one pull request but it turned out to be a fairly major re-architecting and it would have been a lot of overhead to break it up. |
@andre-d re: single quotes. Not sure how I feel about introducing an unofficial syntax. Let's cope without for the moment it can be a new issue. |
Is this pull request meant to be finished? Your title still says IN PROGRESS |
Macros now work, so I guess this can be merged. I'm not entirely happy with it, but I don't see going back either, since there are quite a few fixes in here. |
Pyparsing extra debug information on parse failure and preliminary macro support
.. by preliminary I mean very preliminary. They are sort of parsed, but then ignored at code generation for the moment.
The extra debugging information should help in case of parse failures. Now it prints the line number in a friendly way and points at the point of parse failure rather than excepting and bailing out.