From d834a7c4ce9209774ac1ce8dbd4401877a229071 Mon Sep 17 00:00:00 2001 From: yhirose Date: Thu, 6 Aug 2015 23:09:37 -0400 Subject: [PATCH] Changed to use C++ raw string. --- example/calc.cc | 18 +++++++++--------- example/calc3.cc | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/example/calc.cc b/example/calc.cc index f7d8459..4fc18c1 100644 --- a/example/calc.cc +++ b/example/calc.cc @@ -34,15 +34,15 @@ int main(int argc, const char** argv) return result; }; - peg parser( - " EXPRESSION <- _ TERM (TERM_OPERATOR TERM)* " - " TERM <- FACTOR (FACTOR_OPERATOR FACTOR)* " - " FACTOR <- NUMBER / '(' _ EXPRESSION ')' _ " - " TERM_OPERATOR <- < [-+] > _ " - " FACTOR_OPERATOR <- < [/*] > _ " - " NUMBER <- < [0-9]+ > _ " - " ~_ <- [ \t\r\n]* " - ); + peg parser(R"( + EXPRESSION <- _ TERM (TERM_OPERATOR TERM)* + TERM <- FACTOR (FACTOR_OPERATOR FACTOR)* + FACTOR <- NUMBER / '(' _ EXPRESSION ')' _ + TERM_OPERATOR <- < [-+] > _ + FACTOR_OPERATOR <- < [/*] > _ + NUMBER <- < [0-9]+ > _ + ~_ <- [ \t\r\n]* + )"); parser["EXPRESSION"] = reduce; parser["TERM"] = reduce; diff --git a/example/calc3.cc b/example/calc3.cc index 38d87c7..36d93bb 100644 --- a/example/calc3.cc +++ b/example/calc3.cc @@ -39,15 +39,15 @@ int main(int argc, const char** argv) } }; - peg parser( - " EXPRESSION <- _ TERM (TERM_OPERATOR TERM)* " - " TERM <- FACTOR (FACTOR_OPERATOR FACTOR)* " - " FACTOR <- NUMBER / '(' _ EXPRESSION ')' _ " - " TERM_OPERATOR <- < [-+] > _ " - " FACTOR_OPERATOR <- < [/*] > _ " - " NUMBER <- < [0-9]+ > _ " - " ~_ <- [ \t\r\n]* " - ); + peg parser(R"( + EXPRESSION <- _ TERM (TERM_OPERATOR TERM)* + TERM <- FACTOR (FACTOR_OPERATOR FACTOR)* + FACTOR <- NUMBER / '(' _ EXPRESSION ')' _ + TERM_OPERATOR <- < [-+] > _ + FACTOR_OPERATOR <- < [/*] > _ + NUMBER <- < [0-9]+ > _ + ~_ <- [ \t\r\n]* + )"); parser.enable_ast();