2
0
mirror of https://github.com/boostorg/parser.git synced 2026-01-19 04:22:13 +00:00

basic yaml flow tests ok.

This commit is contained in:
Joel de Guzman
2011-11-10 11:24:20 +08:00
parent 01cb27e3e2
commit f94514cb9e
4 changed files with 18 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
* Copyright (C) 2010, 2011 Object Modeling Designs
*/
#define BOOST_SPIRIT_DEBUG
//~ #define BOOST_SPIRIT_DEBUG
#include "../yaml/parser/flow_def.hpp"
#include "../yaml/parser/scalar_def.hpp"

View File

@@ -6,6 +6,6 @@
"Τη γλώσσα μου έδωσαν ελληνική",
[
92,
["another string", apple, Sîne]
["another string", "apple", "Sîne"]
]
]

View File

@@ -0,0 +1,14 @@
# Now we have comments
[
123.45,
true,
false,
"this is a unicode \u20AC string",
"Τη γλώσσα μου έδωσαν ελληνική",
[
92,
["another string", apple, Sîne], # We also have plain unquoted strings
'this is a ''unicode'' string' # and we have single quoted strings
]
]

View File

@@ -51,6 +51,7 @@ namespace omd { namespace parser
namespace phx = boost::phoenix;
auto pb = phx::push_back(_val, _1);
auto ins = phx::insert(_val, _1);
flow_value =
scalar_value
@@ -60,7 +61,7 @@ namespace omd { namespace parser
object =
'{'
> -(member_pair >> *(',' > member_pair))
> -(member_pair[ins] >> *(',' > member_pair[ins]))
> '}'
;