Re: Proper whitespace formatting in mini_xml_karma.cpp example code
Larry Evans <[email protected]> Mon, 23 Apr 2018 12:34:50 -0500
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
On 04/23/2018 02:34 AM, Alberto Luaces wrote: > Hello, I'm no Spirit expert nor anything near it, but something I think > about this list is that they like code over anything else. > > Your best bet is to take the smallest grammar of your software skipping > whitespace and the matching generator, including your expected output > with whitespace, and you can have more chances of somebody chipping in. > > The OP used the mini_xml_karma.cpp as his grammar example. Although that may not be the smallest, it's pretty small. With that grammar, and the input in 1st attachment, I get the output in 2nd attachment. I, and I assume the OP, would expect the output in the 3ird attachment. @Maarten, is that about right? -regards, Larry ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Spirit-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/spirit-general
inp1.xml
(text/xml, 143 B)
<t1>
<t1_1>
(t1_1)
</t1_1>
<t1_2>
(t1_2)
<t1_2_1>
(t1_2_1)
</t1_2_1>
</t1_2>
</t1>
inp1.out
(text/plain, 349 B)
/tmp/build/clangxx5_0_pkg/boost/sandbox/lje/remote/clone/boost_sandbox/karma_indent/libs/spirit/example/karma/mini_xml_karma.exe inp1.xml
-------------------------
Parsing succeeded
-------------------------
<t1><t1_1>(t1_1)
</t1_1><t1_2>(t1_2)
<t1_2_1>(t1_2_1)
</t1_2_1></t1_2></t1>
Compilation finished at Mon Apr 23 12:24:43
inp1.expected
(text/plain, 183 B)
-------------------------
Parsing succeeded
-------------------------
<t1>
<t1_1>
(t1_1)
</t1_1>
<t1_2>
(t1_2)
<t1_2_1>
(t1_2_1)
</t1_2_1>
</t1_2>
</t1>