christopherpow / nesicide

Integrated Development Environment for the 8-bit Nintendo Entertainment System
314 stars 38 forks source link

rc2qt.py does not work on j0CC (double-quote "" escaping) #40

Closed nyanpasu64 closed 5 years ago

nyanpasu64 commented 5 years ago

Probably blocks #29.

I get errors when parsing stock FT's .rc file. However the generated file is identical to Git master. https://gist.github.com/jimbo1qaz/377114754cbc8b0c55a8794f060cc297#file-2-rc2qt-errors-txt


0CC...

https://gist.github.com/jimbo1qaz/377114754cbc8b0c55a8794f060cc297#file-2-rc2qt-errors-txt

line 3:9 no viable alternative at input 'include "resource.h"' line 528:16 no viable alternative at input 'VS_VERSION_INFO VERSIONINFO' line 1974:24 no viable alternative at input 'ID_MANIFEST RT_MANIFEST' line 2101:14 no viable alternative at input 'IDD_BOOKMARKS AFX_DIALOG_LAYOUT' line 2301:100 extraneous input '"Show skipped rows"' expecting {'END', ID} line 2302:98 extraneous input '"Show skipped rows"' expecting {'STRINGTABLE', 'END', ID} line 2480:30 extraneous input '"%1"' expecting {'STRINGTABLE', 'END', ID} line 2811:1 no viable alternative at input 'endif // English (United States) resources\n/////////////////////////////////////////////////////////////////////////////\n\n\n/////////////////////////////////////////////////////////////////////////////\n// Swedish (Sweden) resources\n\nif'

Most of the errors correspond to vanilla FT. I did notice that your script doesn't understand "asdf""zxcv" is an escape for asdf"zxcv. This escape syntax is not used in vanilla FT.


String : '"' (~[\r\n"] | '""')* '"' ; fixes lexing, but quotes are still doubled in the output C++, instead of being transformed into \"

christopherpow commented 5 years ago

Yes. The rc2qt experiment did still require some manual manipulation of the input file. I never quite got it perfect. I also thought I had committed a makefile that made the parser properly...I'll look around for that but it may be lost to the ethers.

christopherpow commented 5 years ago

I have committed the makefile for rc2qt. https://github.com/christopherpow/nesicide/commit/252cdc49c937200b84590f998e9e4c484818f6b0

nyanpasu64 commented 5 years ago
christopherpow commented 5 years ago
christopherpow commented 5 years ago

I committed a fix for the "" issue and updated rc2qt to python3.

I don't have the j0CC rc file locally to test.

christopherpow commented 5 years ago

I found the j0CC rc file. Tested it. Looks like it works properly now. Let me know.

christopherpow commented 5 years ago

I also cleaned up the parsing errors.

nyanpasu64 commented 5 years ago

Looks like it works properly now. Let me know.

Your new script on Python 3 produces a nearly empty stdout (110 lines according to less) on master, missing most of the content?

christopherpow commented 5 years ago

I guess I forgot to look at the actual output on my last commit. :| Fixed.

nyanpasu64 commented 5 years ago

I observed that HertzDevil (0cc) had a tendency to "break master for dozens of commite over time" (including compilation errors on debug builds due to no CI). This messy history made bisecting basically impossible. I'd assume your "fix appveyor" commands create a dead zone which doesn't fail to build, but wastes time if I'm bisecting code changes.

I would have switched antlr grammar in one commit and switched Python versions in another, then rebased or merged (persobally from a self-PR), for ease of bisecting. With both combined, I couldn't tell which change the bug came from. Do you agree?

christopherpow commented 5 years ago

Of course, I agree. If you're intent is to stick around and help for a while I will make an effort to be more careful with my commits. But please understand I've been mainly alone on this for quite a portion of its development time. I allow myself to be a bit sloppy, which isn't nice to others, but doesn't matter if "others" is an empty set. :) I have moved appveyor to its own branch.

nyanpasu64 commented 5 years ago

My plan is to port j0cc to qt using nesicide, then use that as the base for my own tracker with drastic changes. It's your call, but for personal reasons and ease of bisecting/changelog, i try to avoid mistakes reaching master, even on my own repos.

nyanpasu64 commented 5 years ago

I think the fixes are not in master yet, unless you altered your commit without changing commit date or author date, then force-pushed.

also I got into some events elsewhere (someone hassling and verbally attacking me to make me write a NSF driver instead of first implementing the tracker) which may be reducing my enthusiasm to continue this project further. I'll decide this weekend when I have free time.

nyanpasu64 commented 5 years ago

Master seems to work now, thanks. (Would you prefer if I stopped giving git suggestions? If you're OK, I think master's DAG looks messy, and would look better if you did rebasing or squash-merge, for example via Github PR, instead of merge commits.)

christopherpow commented 5 years ago

I'm an old man of habits. That has the unfortunate side effect of making me be a bit hard to work with. Sorry. I will try to work on branches and merge only when completely working. I appreciate the suggestions, but hope you understand it taking me some time to clean up my act.

nyanpasu64 commented 5 years ago

Wait, I think you're mistakenly hex-encoding some strings. As a side effect of the Python 3 switch, you commented out but didn't fix some code. (Maybe it wasn't worth switching.)

image

I'll open a PR shortly.

christopherpow commented 5 years ago

The rc2qt was an experiment, really. I hadn't put much effort into pulling it into the build process because I hadn't a need for it. I took one look at 0CC and almost fainted with all the diffs I'd have to figure out. rc2qt came from an idea to automate the conversion process I'd had for some time but hadn't acted on.

Nice catch on the hexify. I thought there might be some missed gotcha's with python transition.

On Fri, Jun 21, 2019 at 10:44 PM jimbo1qaz notifications@github.com wrote:

Wait, I think you're mistakenly hex-encoding some strings. As a side effect of the Python 3 switch, you commented out but didn't fix some code. (Maybe it wasn't worth switching.)

[image: image] https://user-images.githubusercontent.com/913957/59959006-3185bf00-9464-11e9-8c87-342e9aea7645.png

I'll open a PR shortly.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/christopherpow/nesicide/issues/40?email_source=notifications&email_token=AAMQR4BZ4CMXSG6WXT2YKYTP3WNZBA5CNFSM4HY5B5TKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYJ7K3Q#issuecomment-504624494, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMQR4GRHR442QZDWXHSWGLP3WNZBANCNFSM4HY5B5TA .