Older compiler backport issues
This commit is contained in:
@@ -953,7 +953,7 @@ namespace chaiscript
|
|||||||
struct Char_Parser
|
struct Char_Parser
|
||||||
{
|
{
|
||||||
string_type &match;
|
string_type &match;
|
||||||
using char_type = typename string_type::value_type;
|
typedef typename string_type::value_type char_type;
|
||||||
bool is_escaped;
|
bool is_escaped;
|
||||||
bool is_interpolated;
|
bool is_interpolated;
|
||||||
bool saw_interpolation_marker;
|
bool saw_interpolation_marker;
|
||||||
@@ -1084,7 +1084,7 @@ namespace chaiscript
|
|||||||
std::string match;
|
std::string match;
|
||||||
const auto prev_stack_top = m_match_stack.size();
|
const auto prev_stack_top = m_match_stack.size();
|
||||||
|
|
||||||
bool is_interpolated = [&]() {
|
bool is_interpolated = [&]()->bool {
|
||||||
Char_Parser<std::string> cparser(match, true);
|
Char_Parser<std::string> cparser(match, true);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -249,7 +249,7 @@ class JSON
|
|||||||
SetType( Class::Object ); return Internal.Map->operator[]( key );
|
SetType( Class::Object ); return Internal.Map->operator[]( key );
|
||||||
}
|
}
|
||||||
|
|
||||||
JSON& operator[]( unsigned index ) {
|
JSON& operator[]( const size_t index ) {
|
||||||
SetType( Class::Array );
|
SetType( Class::Array );
|
||||||
if( index >= Internal.List->size() ) Internal.List->resize( index + 1 );
|
if( index >= Internal.List->size() ) Internal.List->resize( index + 1 );
|
||||||
return Internal.List->operator[]( index );
|
return Internal.List->operator[]( index );
|
||||||
@@ -385,6 +385,8 @@ class JSON
|
|||||||
case Class::Boolean:
|
case Class::Boolean:
|
||||||
return Internal.Bool ? "true" : "false";
|
return Internal.Bool ? "true" : "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw std::runtime_error("Unhandled JSON type");
|
||||||
}
|
}
|
||||||
|
|
||||||
friend std::ostream& operator<<( std::ostream&, const JSON & );
|
friend std::ostream& operator<<( std::ostream&, const JSON & );
|
||||||
|
@@ -12,7 +12,7 @@ namespace chaiscript
|
|||||||
static ModulePtr library(ModulePtr m = std::make_shared<Module>())
|
static ModulePtr library(ModulePtr m = std::make_shared<Module>())
|
||||||
{
|
{
|
||||||
|
|
||||||
m->add(chaiscript::fun([](const std::string &t_str) { return json_wrap::from_json(t_str); }), "from_json");
|
m->add(chaiscript::fun([](const std::string &t_str) { return from_json(t_str); }), "from_json");
|
||||||
m->add(chaiscript::fun(&json_wrap::to_json), "to_json");
|
m->add(chaiscript::fun(&json_wrap::to_json), "to_json");
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
|
Reference in New Issue
Block a user