Our emails crossed :)

Cheers
Lex

On 28 February 2012 13:02, Stuart Rackham <[email protected]> wrote:
> I missed the fact that the ast code is already there, just ensure Jython
> uses it, this seems to work:
>
> diff -r 2d79f221db30 asciidoc.py
> --- a/asciidoc.py»······Tue Feb 28 13:14:28 2012 +1300
> +++ b/asciidoc.py»······Tue Feb 28 14:59:58 2012 +1300
> @@ -375,7 +375,7 @@
> ·
>  if float(sys.version[:3]) < 2.4:
>     pass # No compiler
> -elif float(sys.version[:3]) < 2.6:
> +elif float(sys.version[:3]) < 2.6 and sys.platform[:4] != 'java':
>     import compiler
>     from compiler.ast import Const, Dict, Expression, Name, Tuple, UnarySub,
> Keyword
>
>
> Cheers, Stuart
>
>
> On 28/02/12 13:25, Lex Trotman wrote:
>>
>> [...]
>>>
>>> I poked around and *suspect* that the error was introduced with this
>>> changeset:
>>>
>>>
>>> http://code.google.com/p/asciidoc/source/detail?r=66543730504e5dc07a56fcd89b238ef784cdeac4
>>>
>>> which uses the Python compiler to remove eval()s.
>>>
>>> I would like AsciiDoc to work with Jython so if anyone can figure out
>>> exactly what's causing it and come up with at patch that would be great.
>>>
>>
>> Hi Stuart,
>>
>> Perhaps one solution would be to use the parser module instead of the
>> compiler module, this is messier and harder to use since you have to
>> refer to the detailed grammar, but is available for all Python 2
>> versions.  I don't think the grammar for "safe" literal structures (ie
>> expr) has changed across Python versions so the result should be
>> portable.
>>
>> literal_eval() would need to be re-written to use the output of the
>> parser module, but that should be fairly mechanical.
>>
>> Cheers
>> Lex
>>
>>>
>>> Cheers, Stuart
>>>
>>>
>>>>
>>>> Thanks.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "asciidoc" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/asciidoc?hl=en.
>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "asciidoc" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/asciidoc?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to