xl45 / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

Invalid comment interpretation #201

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Using shedskin 0.9.4 compile the following code

for it in (0, 1): #{
  for o in ('i','g'): #{
    print o
  #}
#}

What is the expected output? What do you see instead?
The python is valid and execute the following way:
i
g
i
g

However schedskin complains this way:
*ERROR* /tmp/test.py:5: expected an indented block

Note that removing the #{ and #} fixes the problem. My editor is more 
convenient using this patterns (and should be harmless as it's only comments)

Hope it helps improve this great product.
Cheers,
Olivier

Original issue reported on code.google.com by akato...@gmail.com on 15 Mar 2014 at 4:58

GoogleCodeExporter commented 8 years ago
thanks a lot for reporting! will investigate within a few days..

Original comment by mark.duf...@gmail.com on 15 Mar 2014 at 8:31

GoogleCodeExporter commented 8 years ago
No problem, I'm glad to contribute as I'm using it intensively :)
Olivier

Original comment by akato...@gmail.com on 15 Mar 2014 at 8:37

GoogleCodeExporter commented 8 years ago
oh, please note that #{ and #} are also used as directives to shedskin that the 
surrounded code should not be compiled..  but apparently that breaks when they 
are nested. perhaps this directive was not such a good idea.

Original comment by mark.duf...@gmail.com on 16 Mar 2014 at 6:14

GoogleCodeExporter commented 8 years ago
Uh, my bad, seems like I missed a feature of shedskin. But isn't the """ block 
commenting not sufficient for shedskin usecases ? I hadn't had a look at it 
already.
Cheers,
Olivier

Original comment by akato...@gmail.com on 16 Mar 2014 at 9:05