Switch vectors and maps over to curly braces from square braces to line up with C++11.

This commit is contained in:
Jonathan Turner
2011-09-24 13:15:12 -06:00
parent 425ca59a34
commit 784ca41270
47 changed files with 60 additions and 60 deletions

View File

@@ -1597,10 +1597,10 @@ namespace chaiscript
size_t prev_stack_top = m_match_stack.size();
if (Char('[')) {
if (Char('{')) {
retval = true;
Container_Arg_List();
if (!Char(']')) {
if (!Char('}')) {
throw exception::eval_error("Missing closing square bracket", File_Position(m_line, m_col), *m_filename);
}
if ((prev_stack_top != m_match_stack.size()) && (m_match_stack.back()->children.size() > 0)) {

View File

@@ -7,7 +7,7 @@
#ifndef CHAISCRIPT_PRELUDE_HPP_
#define CHAISCRIPT_PRELUDE_HPP_
//Note, the expression "[x,y]" in "collate" is parsed as two separate expressions
//Note, the expression "{x,y}" in "collate" is parsed as two separate expressions
//by C++, so CODE_STRING, takes two expressions and adds in the missing comma
#define CODE_STRING(x, y) #x ", " #y
@@ -23,7 +23,7 @@ def to_string(x) : call_exists(first, x) && call_exists(second, x) { \n\
}\n\
# to_string for containers\n\
def to_string(x) : call_exists(range, x) && !x.is_type("string"){ \n\
"[" + x.join(", ") + "]"; \n\
"{" + x.join(", ") + "}"; \n\
}\n\
# Basic to_string function\n\
def to_string(x) { \n\
@@ -259,7 +259,7 @@ def generate_range(x, y) { \n\
}\n\
# Returns a new Vector with the first value to the second value as its elements\n\
def collate(x, y) { \n\
[x, y]; \n\
{x, y}; \n\
} \n\
def zip_with(f, x, y, inserter) : call_exists(range, x) && call_exists(range, y) { \n\
auto r_x = range(x); \n\