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:
@@ -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"
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
"Τη γλώσσα μου έδωσαν ελληνική",
|
||||
[
|
||||
92,
|
||||
["another string", apple, Sîne]
|
||||
["another string", "apple", "Sîne"]
|
||||
]
|
||||
]
|
||||
14
test/test_files/basic_yaml_flow_test.yaml
Normal file
14
test/test_files/basic_yaml_flow_test.yaml
Normal 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
|
||||
]
|
||||
]
|
||||
@@ -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]))
|
||||
> '}'
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user