Post by Paul McGuireAndrea, I'll try to take a look at the PyContracts code that you posted and
see if any glaring areas jump out. will, I hope these descriptions will give
you some clues where to start looking in your grammar. I can also post some
before-after snippets that you can patch into your versions of pyparsing and
rerun your tests.
Thanks Paul!
1) As for the PyContracts project, where I get syntax errors, this is
my travis project:
https://travis-ci.org/AndreaCensi/contracts
This currently shows the same code working for 2.7,3.2,3.3,pypy, but
failing for 3.4 and 3.5.
Currently the version that is installed by pip is pyparsing-2.0.6-py2.py3.
I'm not an expert at Travis. I wish there was a way to run different
builds with multiple versions of pyparsing.
To look into the grammar, start here:
https://github.com/AndreaCensi/contracts/blob/master/src/contracts/syntax.py
Other parts are in other files. It is fairly complex - I was using
almost all the features of PyParsing.
In the past, what was failing in >=3.4 were tests related to the unary
operator "-". It didn't recognize things like ">=-1". Now the problem
is errors like this:
'array(=4|>=2,<=0)'
=>
pyparsing.ParseException: Expected {{FollowedBy:({{Forward:
{{FollowedBy:({{Forward: {{FollowedBy:({{... "*"} ...}) Group:({...
{{"*" ...}}...})} | ...} "-"} Forward: {{FollowedBy:({{... "*"} ...})
Group:({... {{"*" ...}}...})} | ...}}) Group:({Forward:
{{FollowedBy:({{... "*"} ...}) Group:({... {{"*" ...}}...})} | ...}
{{"-" Forward: {{FollowedBy:({{... "*"} ...}) Group:({... {{"*"
...}}...})} | ...}}}...})} | Forward: {{FollowedBy:({{... "*"} ...})
Group:({... {{"*" ...}}...})} | ...}} "+"} Forward:
{{FollowedBy:({{Forward: {{FollowedBy:({{... "*"} ...}) Group:({...
{{"*" ...}}...})} | ...} "-"} Forward: {{FollowedBy:({{... "*"} ...})
Group:({... {{"*" ...}}...})} | ...}}) Group:({Forward:
{{FollowedBy:({{... "*"} ...}) Group:({... {{"*" ...}}...})} | ...}
{{"-" Forward: {{FollowedBy:({{... "*"} ...}) Group:({... {{"*"
...}}...})} | ...}}}...})} | Forward: {{FollowedBy:({{... "*"} ...})
Group:({... {{"*" ...}}...})} | ...}}}) Group:({Forward:
{{FollowedBy:({{Forward: {{FollowedBy:({{... "*"} ...}) Group:({...
{{"*" ...}}...})} | ...} "-"} Forward: {{FollowedBy:({{... "*"} ...})
Group:({... {{"*" ...}}...})} | ...}}) Group:({Forward:
{{FollowedBy:({{... "*"} ...}) Group:({... {{"*" ...}}...})} | ...}
{{"-" Forward: {{FollowedBy:({{... "*"} ...}) Group:({... {{"*"
...}}...})} | ...}}}...})} | Forward: {{FollowedBy:({{... "*"} ...})
Group:({... {{"*" ...}}...})} | ...}} {{"+" Forward:
{{FollowedBy:({{Forward: {{FollowedBy:({{... "*"} ...}) Group:({...
{{"*" ...}}...})} | ...} "-"} Forward: {{FollowedBy:({{... "*"} ...})
Group:({... {{"*" ...}}...})} | ...}}) Group:({Forward:
{{FollowedBy:({{... "*"} ...}) Group:({... {{"*" ...}}...})} | ...}
{{"-" Forward: {{FollowedBy:({{... "*"} ...}) Group:({... {{"*"
...}}...})} | ...}}}...})} | Forward: {{FollowedBy:({{... "*"} ...})
Group:({... {{"*" ...}}...})} | ...}}}}...})} | Forward:
{{FollowedBy:({{Forward: {{FollowedBy:({{... "*"} ...}) Group:({...
{{"*" ...}}...})} | ...} "-"} Forward: {{FollowedBy:({{... "*"} ...})
Group:({... {{"*" ...}}...})} | ...}}) Group:({Forward:
{{FollowedBy:({{... "*"} ...}) Group:({... {{"*" ...}}...})} | ...}
{{"-" Forward: {{FollowedBy:({{... "*"} ...}) Group:({... {{"*"
...}}...})} | ...}}}...})} | Forward: {{FollowedBy:({{... "*"} ...})
Group:({... {{"*" ...}}...})} | ...}}} (at char 10), (line:1, col:11)
2) As for the other project, the one with out of memory errors, I do
have unicode expressions in literals.
Could the changes in unicode expressions lead to out of memory errors?
~
Just read your last message about the cosmetic bug. When you push out
the fix, I will let you know if the problems above disappear.
------------------------------------------------------------------------------