<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 14: Parsing Flags</title><link>https://sourceforge.net/p/pyparsing/support-requests/14/</link><description>Recent changes to 14: Parsing Flags</description><atom:link href="https://sourceforge.net/p/pyparsing/support-requests/14/feed.rss" rel="self"/><language>en</language><lastBuildDate>Wed, 17 Feb 2016 20:57:33 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pyparsing/support-requests/14/feed.rss" rel="self" type="application/rss+xml"/><item><title>Parsing Flags</title><link>https://sourceforge.net/p/pyparsing/support-requests/14/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I am trying to get the system to generate a flag based on the results of a parsing operation.  I am pretty sure I could write a wrapper and set the .setFailAction() / .setParseAction(), but I am trying to see if there is a cleaner way.&lt;/p&gt;
&lt;p&gt;What I am trying to accomplish is to have a string that I parse, but I want to be able to report back to the user why it failed, or why it parsed it as it did, or warnings that do not generate failures...&lt;/p&gt;
&lt;p&gt;so, with the following addresses, return the following flags:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Address&lt;/th&gt;
&lt;th&gt;Flags&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;'dan.strohl'&lt;/td&gt;
&lt;td&gt;ERR_NO_AT_SYMBOL, ERR_NO_DOMAIN&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;'dan@strohl'&lt;/td&gt;
&lt;td&gt;WARN_SINGLE_DOMAIN_ELEMENT, WARN_NO_TLD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;'dan@(neat name strohl).com'&lt;/td&gt;
&lt;td&gt;CONTAINS_COMMENT, ERR_DONAIN_STARTS_WITH_DOT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;'dan@&lt;span&gt;[127.0.0.1]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;WARN_LOOPBACK_ADDRESS_LITERAL&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;As I said, I am sure I could do something using the setFailAction that saves flags to a ceneral list, but is there a better approach? &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dan Strohl</dc:creator><pubDate>Wed, 17 Feb 2016 20:57:33 -0000</pubDate><guid>https://sourceforge.net7c8b5b08d57bf2972c64fc72a9c49b07254a2b1f</guid></item></channel></rss>