From c7a94c3f84380ca9f85a1226749414f44f3a102c Mon Sep 17 00:00:00 2001 From: binrapt Date: Mon, 5 Oct 2009 19:50:42 +0200 Subject: [PATCH] Renamed the property operator to the selection operator --- frith/function.hpp | 2 +- frith/intermediary.hpp | 2 +- frith/lexer.hpp | 4 +++- lexer/lexeme.cpp | 2 +- lexer/number.cpp | 18 +++++++++--------- lexer/operator.cpp | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/frith/function.hpp b/frith/function.hpp index d9a631f..0fdf7cb 100644 --- a/frith/function.hpp +++ b/frith/function.hpp @@ -102,7 +102,7 @@ namespace frith struct parse_tree_symbol { - string_vector names; + std::string name; }; struct parse_tree_unary_operator_node diff --git a/frith/intermediary.hpp b/frith/intermediary.hpp index 0a20ebf..25dc6eb 100644 --- a/frith/intermediary.hpp +++ b/frith/intermediary.hpp @@ -30,7 +30,7 @@ namespace frith { enum type { - property_operator, + selection, negation, logical_not, diff --git a/frith/lexer.hpp b/frith/lexer.hpp index 5ead1bc..9ec10f7 100644 --- a/frith/lexer.hpp +++ b/frith/lexer.hpp @@ -71,10 +71,12 @@ namespace frith iteration, iterator, + function_declaration, anonymous_function_declaration, + class_operator, - property_operator, + selection_operator, call_operator, scope_operator, }; diff --git a/lexer/lexeme.cpp b/lexer/lexeme.cpp index 6609a36..17f66cc 100644 --- a/lexer/lexeme.cpp +++ b/lexer/lexeme.cpp @@ -189,7 +189,7 @@ namespace frith case class_operator: return "class operator"; - case property_operator: + case selection_operator: return "."; case call_operator: diff --git a/lexer/number.cpp b/lexer/number.cpp index fa500b5..7450ca7 100644 --- a/lexer/number.cpp +++ b/lexer/number.cpp @@ -48,22 +48,22 @@ namespace frith } } - char const property_operator = '.'; + char const dot = '.'; - bool got_property_operator = false; + bool got_dot = false; char last_byte = byte; for(; i < end; i++) { byte = input[i]; - if(byte == property_operator) + if(byte == dot) { - if(got_property_operator) + if(got_dot) { - error = number_parsing_error("Encountered a floating point value containing multiple property_operators", error_occured); + error = number_parsing_error("Encountered a floating point value containing multiple dots", error_occured); return false; } else - got_property_operator = true; + got_dot = true; } else if(!ail::is_digit(byte)) break; @@ -71,15 +71,15 @@ namespace frith last_byte = byte; } - if(last_byte == property_operator) + if(last_byte == dot) { - error = number_parsing_error("Encountered a floating point value ending with a property_operator", error_occured); + error = number_parsing_error("Encountered a floating point value ending with a dot", error_occured); return false; } std::string number_string = input.substr(start, i - start); lexeme current_lexeme; - if(got_property_operator) + if(got_dot) current_lexeme = lexeme(ail::string_to_number(number_string)); else current_lexeme = lexeme(ail::string_to_number(number_string)); diff --git a/lexer/operator.cpp b/lexer/operator.cpp index add4fc5..f4e348b 100644 --- a/lexer/operator.cpp +++ b/lexer/operator.cpp @@ -62,7 +62,7 @@ namespace frith operator_lexeme(function_declaration, "@"), operator_lexeme(anonymous_function_declaration, "@@"), operator_lexeme(class_operator, "$"), - operator_lexeme(property_operator, "."), + operator_lexeme(selection_operator, "."), operator_lexeme(call_operator, ","), operator_lexeme(scope_operator, ":"), }; -- 2.11.4.GIT