lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master b34c313 1/4: Replace confusing names


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b34c313 1/4: Replace confusing names
Date: Fri, 3 Feb 2017 13:40:57 +0000 (UTC)

branch: master
commit b34c3133bcf0f7e18a42b3475437c674516376a4
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Replace confusing names
    
    Sequences that allow keywords have a set of "allowed keywords" that are,
    so to speak, allowed. There can be no "extra" set that is also allowed,
    whose elements are not contained in the "allowed" set.
---
 input_seq_test.cpp |    8 ++++----
 input_sequence.cpp |   22 +++++++++++-----------
 input_sequence.hpp |    8 ++++----
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/input_seq_test.cpp b/input_seq_test.cpp
index 48f9f26..ad82d72 100644
--- a/input_seq_test.cpp
+++ b/input_seq_test.cpp
@@ -129,7 +129,7 @@ int test_main(int, char*[])
     //   ctor arguments
     //     n: length
     //     e: expression
-    //     k: extra keywords
+    //     k: allowed keywords
     //     o: keywords only
     //     w: default keyword
 
@@ -352,7 +352,7 @@ int test_main(int, char*[])
     BOOST_TEST_EQUAL("0", InputSequence(v).mathematical_representation());
     }
 
-    // Test (enumerative) extra keywords, and keywords-only switch
+    // Test (enumerative) allowed keywords, and keywords-only switch
     // (with input it allows).
     {
     int const n = 9;
@@ -368,7 +368,7 @@ int test_main(int, char*[])
     check(__FILE__, __LINE__, d, n, e, "", k, c, false);
     }
 
-    // Test numbers mixed with (enumerative) extra keywords.
+    // Test numbers mixed with (enumerative) allowed keywords.
     {
     int const n = 9;
     strvec const c     {"", "", "keyword_00", "keyword_00", "", "", "", "", 
""};
@@ -378,7 +378,7 @@ int test_main(int, char*[])
     check(__FILE__, __LINE__, d, n, e, "", k, c);
     }
 
-    // Test numbers mixed with (enumerative) extra keywords, with
+    // Test numbers mixed with (enumerative) allowed keywords, with
     // a default keyword.
     {
     int const n = 10;
diff --git a/input_sequence.cpp b/input_sequence.cpp
index cf6aec6..e62f94a 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -55,7 +55,7 @@ SequenceParser::SequenceParser
     ,int                             a_retirement_age
     ,int                             a_inforce_duration
     ,int                             a_effective_year
-    ,std::vector<std::string> const& a_extra_keywords
+    ,std::vector<std::string> const& a_allowed_keywords
     ,bool                            a_keywords_only
     )
     :input_stream                  (input_expression.c_str())
@@ -64,7 +64,7 @@ SequenceParser::SequenceParser
     ,retirement_age                (a_retirement_age)
     ,inforce_duration              (a_inforce_duration)
     ,effective_year                (a_effective_year)
-    ,extra_keywords                (a_extra_keywords)
+    ,allowed_keywords              (a_allowed_keywords)
     ,keywords_only                 (a_keywords_only)
     ,current_token_type            (e_startup)
     ,previous_duration_scalar_mode (e_inception)
@@ -93,7 +93,7 @@ InputSequence::InputSequence
     ,int                             a_retirement_age
     ,int                             a_inforce_duration
     ,int                             a_effective_year
-    ,std::vector<std::string> const& a_extra_keywords
+    ,std::vector<std::string> const& a_allowed_keywords
     ,bool                            a_keywords_only
     ,std::string const&              a_default_keyword
     )
@@ -102,7 +102,7 @@ InputSequence::InputSequence
     ,retirement_age                (a_retirement_age)
     ,inforce_duration              (a_inforce_duration)
     ,effective_year                (a_effective_year)
-    ,extra_keywords                (a_extra_keywords)
+    ,allowed_keywords              (a_allowed_keywords)
     ,keywords_only                 (a_keywords_only)
     ,default_keyword               (a_default_keyword)
 {
@@ -113,7 +113,7 @@ InputSequence::InputSequence
         ,retirement_age
         ,inforce_duration
         ,effective_year
-        ,extra_keywords
+        ,allowed_keywords
         ,keywords_only
         );
 
@@ -716,8 +716,8 @@ void SequenceParser::value()
                     << "Expected keyword chosen from { "
                     ;
                 std::copy
-                    (extra_keywords.begin()
-                    ,extra_keywords.end()
+                    (allowed_keywords.begin()
+                    ,allowed_keywords.end()
                     ,std::ostream_iterator<std::string>(diagnostics, " ")
                     );
                 diagnostics << "}. ";
@@ -731,13 +731,13 @@ void SequenceParser::value()
         case e_keyword:
             {
             current_interval.value_is_keyword = true;
-            if(extra_keywords.empty())
+            if(allowed_keywords.empty())
                 {
                 diagnostics << "Expected number. ";
                 mark_diagnostic_context();
                 break;
                 }
-            if(contains(extra_keywords, current_keyword))
+            if(contains(allowed_keywords, current_keyword))
                 {
                 current_interval.value_keyword = current_keyword;
                 match(current_token_type);
@@ -748,8 +748,8 @@ void SequenceParser::value()
                     << "Expected keyword chosen from { "
                     ;
                 std::copy
-                    (extra_keywords.begin()
-                    ,extra_keywords.end()
+                    (allowed_keywords.begin()
+                    ,allowed_keywords.end()
                     ,std::ostream_iterator<std::string>(diagnostics, " ")
                     );
                 diagnostics << "}. ";
diff --git a/input_sequence.hpp b/input_sequence.hpp
index 58bbf62..a4bea13 100644
--- a/input_sequence.hpp
+++ b/input_sequence.hpp
@@ -180,7 +180,7 @@ class SequenceParser
         ,int                             a_retirement_age
         ,int                             a_inforce_duration
         ,int                             a_effective_year
-        ,std::vector<std::string> const& a_extra_keywords
+        ,std::vector<std::string> const& a_allowed_keywords
         ,bool                            a_keywords_only
         );
 
@@ -233,7 +233,7 @@ class SequenceParser
     int retirement_age;
     int inforce_duration;
     int effective_year;
-    std::vector<std::string> extra_keywords;
+    std::vector<std::string> allowed_keywords;
     bool keywords_only;
 
     token_type current_token_type;
@@ -262,7 +262,7 @@ class LMI_SO InputSequence
         ,int                             a_retirement_age
         ,int                             a_inforce_duration
         ,int                             a_effective_year
-        ,std::vector<std::string> const& a_extra_keywords
+        ,std::vector<std::string> const& a_allowed_keywords
             = std::vector<std::string>()
         ,bool                            a_keywords_only = false
         ,std::string const&              a_default_keyword = ""
@@ -294,7 +294,7 @@ class LMI_SO InputSequence
     int retirement_age;
     int inforce_duration;
     int effective_year;
-    std::vector<std::string> extra_keywords;
+    std::vector<std::string> allowed_keywords;
     bool keywords_only;
     // Copy of a ctor arg that is unique to this class.
     std::string default_keyword;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]