warning.warn("Cannot add element of type %s to ParserElement" % type(other),
NameError: global name 'warning' is not defined
Should something like "import logging" be mentioned someplace?
Incidentally, I got that type error on the following, and I haven't a clue which thing is the type which is not liked.
wiki_header = LineStart + Regex( '[=]*' ) + wiki_text + Regex( '[=]*' )
Aha. LineStart() rather than LineStart.
Sorry to make you solve all your problems yourself! The warning.warn statements should all read "warnings.warn" - I've fixed this in the current build on my system, as well as added convenience globals lineStart, lineEnd, stringStart, and stringEnd (just as there is a global empty to use in place of Empty()).
It looks like you are working on a Wiki parser, good luck with this. I don't think anyone has touched this type of application with pyparsing yet. (By the way, I think the transformString method may be useful to you. It is specifically intended for converting input patterns to replacement patterns, as defined in parse actions.)
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.