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

Proper support for the ?-print shortcut #84

Open
Liquidream opened this issue Sep 5, 2021 · 3 comments
Open

Proper support for the ?-print shortcut #84

Liquidream opened this issue Sep 5, 2021 · 3 comments

Comments

@Liquidream
Copy link

Hey Dan,
Just wanted to let you know that I'm receiving the following errors, while running latest luamin against the following lines of code:

fillp(▒)
.\pico-dune.p8: Syntax error (remaining:b'\xe2\x96\x92)\n') at line 1601 char 9

?"mission "..(endstate<3 and "complete" or "failed"),36,60,p_col1
.\pico-dune.p8: Expected b'end' at line 327 char 15

?sub("000000", #strnum+1)..strnum, 103,2, p_col2
.\pico-dune.p8: Expected b'end' at line 1493 char 32

?selected_subobj.name,30,26,7
.\pico-dune.p8: Expected b'end' at line 1633 char 14

?selected_subobj.description,30,34,6
.\pico-dune.p8: Expected b'end' at line 1635 char 16

?self.text,self.x+2,85,(#text>1) and 0 or (self.hover and p_col1 or 6)
.\pico-dune.p8: Expected b'end' at line 1668 char 79

Once these particular lines are commented out - it completes and the output seems to work well
(I'm also using the new "keep" list too!)

If you need any further info, please let me know.
Thx

@dansanderson
Copy link
Owner

High char support is still missing, and explains the first error. #36

I'll rename this issue to track proper ?-print support, which I know for sure isn't fully implemented. I added ? to the token list but that's not a complete solve: ? is a line macro and either needs explicit grammatical support (like short-if) or needs to be translated to print(...) during a build. Adding it to the grammar is probably the best solution for picotool's use cases.

(This is a general issue with what picotool is trying to do vs. how PICO-8 is designed. PICO-8 can get away with all of these preprocessor macros because it never has to reverse the process and regenerate the code. Unfortunately this means PICO-8 can make all kinds of grammatical choices for those macros that complicate picotool's task.)

@dansanderson dansanderson changed the title Luamin issues with latest build Proper support for the ?-print shortcut Sep 5, 2021
@dansanderson
Copy link
Owner

Also a note to future self: 0.2.2d will make this more complex by supporting short-if-with-?-print. 🤪

@Liquidream
Copy link
Author

Good point (high char), forgot about that.

Also, I must confess that I suggested the "short-if-with?-print" feature to Zep (selfishly for Tweetcarts/Pico1k) - sorry! 😬😇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants