Comments (3)
How can we differentiate docstrings and multiline strings? / How do we already do this? (if we do it at all)
You can't, because docstrings are literally just multiline strings. There's no reason to differentiate between them.
Why is there a match against an empty string for a triple quote in the Python RegEx? If we just never try match this, it should be added in the comment above the RegEx.
That's just the result of the regex not recognizing the mutliline string, and thus it falls back on matching the initial two quotes as an empty string.
The issue exists because you're not compiling the regex with the same options that unrpyc does. the python code ends up running that regex with re.DOTALL enabled, which means .
also matches newlines. Here's it with that option enabled.
Where is this PEP 257 Implementation done regarding multiline docstrings? Is it implicit somewhere? If so, it should also be added in comments
Docstrings are literally just normal python strings.
Now there's also a general note here. This function isn't trying to be absolutely correct. It's trying to do what ren'py does here. For the purpose of checking that we aren't generating output that ren'py would fail on. If it fails to parse something that has become legal, we'll just put some parenthesis around it and be done with it (see simple_expression_guard
).
(Now that function has had some recent changes, like accepting [urfURF] as allowed prefixes, but as I said before, false negatives are okay here, and we can fix that when we get there).
from unrpyc.
Hi. Two things come to mind:
- maybe add to which code/func/module in unrpyc this refers (citing.. link)
- afaik multiline strings have in py special rules regarding indent and newline preservation. Maybe this influences your results and i think there was a PEP for this.
from unrpyc.
Here's the function I am refeering to:
Lines 390 to 397 in 79895a1
I want to add the fact that the comment talks about not parsing docstrings.
But this makes my think of more issues:
- How can we differentiate docstrings and multiline strings? / How do we already do this? (if we do it at all)
- Why is there a match against an empty string for a triple quote in the Python RegEx? If we just never try match this, it should be added in the comment above the RegEx.
- Where is this PEP 257 Implementation done regarding multiline docstrings? Is it implicit somewhere? If so, it should also be added in comments
from unrpyc.
Related Issues (20)
- Camera statement possibly broken in dev HOT 5
- Tracking issue for removal of ren'py 6/7 backwards compatibility in the ren'py 8 / python 3 move. HOT 24
- Legacy-backports HOT 4
- Dev_py3: Possible missing colons in decompiled v8.2 files HOT 5
- Check for manipulated header fails sometimes HOT 7
- AttributeError: 'RawBlock' object has no attribute 'statements' HOT 12
- AttributeError: 'module' object has no attribute '_loads' with Ren'Py 6.99.12.4.2187 HOT 5
- Instaliation issues HOT 6
- Translate feature is in both unrpyc branches error prone implemented HOT 17
- Sugar syntax error in the SL2 decompiler HOT 7
- Interleaved output when multiprocessing is used. HOT 2
- Failed decompile script 'options.rpyс' from renpy 6.11.2 HOT 11
- How to unrpyc a single file during runtime in a rpy file HOT 13
- Missing guards after argparse for bad arg combinations HOT 1
- Safepickler in Py3 possibly broken HOT 10
- Uncaught exception while running a game with un.rpy HOT 10
- Sometimes "elif True" if generated HOT 3
- ModuleNotFoundError: No module named 'renpy' HOT 4
- After decompiled .rpy files, the game crashed. HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unrpyc.