From 7583711c6368dcbd18f7b4702d48da80d056b40b Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 5 Jun 2015 08:56:16 -0400 Subject: [PATCH] Code cleanup. --- peglib.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/peglib.h b/peglib.h index 7c5a0ea..5c1bd1c 100644 --- a/peglib.h +++ b/peglib.h @@ -164,7 +164,7 @@ struct SemanticValue { const T& get() const { return val.get(); } - + std::string str() const { return std::string(s, n); } @@ -1563,10 +1563,10 @@ private: const auto& name = sv[baseId].val.get(); auto ope = sv[baseId + 2].val.get>(); - auto& def = (*data.grammar)[name]; - def <= ope; - def.name = name; - def.ignoreSemanticValue = ignore; + auto& rule = (*data.grammar)[name]; + rule <= ope; + rule.name = name; + rule.ignoreSemanticValue = ignore; if (data.start.empty()) { data.start = name; @@ -1719,10 +1719,10 @@ private: } if (!name.empty()) { - auto& def = grammar[name]; - def <= x.second; - def.name = name; - def.ignoreSemanticValue = ignore; + auto& rule = grammar[name]; + rule <= x.second; + rule.name = name; + rule.ignoreSemanticValue = ignore; } } @@ -2076,8 +2076,8 @@ private: void ast_end() { for (auto& x: *grammar_) { const auto& name = x.first; - auto& def = x.second; - auto& action = def.actions.front(); + auto& rule = x.second; + auto& action = rule.actions.front(); if (!action) { action = [name](const SemanticValues& sv) { if (sv.is_token()) {