From e8e25bb7c667faceb5fa5e0bbde08979f0f53a2a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 19 Apr 2014 11:56:31 -0400 Subject: [PATCH] A3t - The ::capture_first method now returns a pointer to the new branch. --- src/A3t.cpp | 9 ++++++--- src/A3t.h | 2 +- src/eng-USA.h | 1 + src/esp-ESP.h | 1 + src/fra-FRA.h | 1 + src/ita-ITA.h | 1 + src/por-PRT.h | 1 + 7 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/A3t.cpp b/src/A3t.cpp index 06e8e330b..abbd91407 100644 --- a/src/A3t.cpp +++ b/src/A3t.cpp @@ -503,12 +503,13 @@ void A3t::inject_defaults () } //////////////////////////////////////////////////////////////////////////////// -void A3t::capture_first (const std::string& arg) +Tree* A3t::capture_first (const std::string& arg) { - //std::cout << "# capture_first (" << arg << ")\n"; - // Insert the arg as the new first branch. Tree* t = new Tree ("argIns"); + if (!t) + throw std::string (STRING_ERROR_MEMORY); + t->attribute ("raw", arg); t->tag ("?"); t->_trunk = _tree; @@ -518,6 +519,8 @@ void A3t::capture_first (const std::string& arg) _tree->_branches.insert (i, t); findCommand (); + + return t; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/A3t.h b/src/A3t.h index 278b5ea68..ea32b51e9 100644 --- a/src/A3t.h +++ b/src/A3t.h @@ -54,7 +54,7 @@ public: void get_data_location (Path&); void apply_overrides (); void inject_defaults (); - void capture_first (const std::string&); + Tree* capture_first (const std::string&); private: void findBinary (); diff --git a/src/eng-USA.h b/src/eng-USA.h index 20dc8b467..7d4f9f20d 100644 --- a/src/eng-USA.h +++ b/src/eng-USA.h @@ -690,6 +690,7 @@ #define STRING_INVALID_MOD "The '{1}' attribute does not allow a value of '{2}'." #define STRING_INVALID_SORT_COL "The '{1}' column is not a valid sort field." #define STRING_TLS_INIT_FAIL "Error initializing TLS." +#define STRING_ERROR_MEMORY "Problem obtaining memory." // Feedback #define STRING_FEEDBACK_NO_TASKS "No tasks." diff --git a/src/esp-ESP.h b/src/esp-ESP.h index 786d4648e..0ed69b758 100644 --- a/src/esp-ESP.h +++ b/src/esp-ESP.h @@ -703,6 +703,7 @@ #define STRING_INVALID_MOD "El atributo '{1}' no admite un valor '{2}'." #define STRING_INVALID_SORT_COL "La columna '{1}' no es un campo de ordenación válido." #define STRING_TLS_INIT_FAIL "Error inicializando TLS." +#define STRING_ERROR_MEMORY "Problem obtaining memory." // Feedback #define STRING_FEEDBACK_NO_TASKS "Ninguna tarea." diff --git a/src/fra-FRA.h b/src/fra-FRA.h index 9c537a311..52506c0d1 100644 --- a/src/fra-FRA.h +++ b/src/fra-FRA.h @@ -689,6 +689,7 @@ #define STRING_INVALID_MOD "The '{1}' attribute does not allow a value of '{2}'." #define STRING_INVALID_SORT_COL "The '{1}' column is not a valid sort field." #define STRING_TLS_INIT_FAIL "Error initializing TLS." +#define STRING_ERROR_MEMORY "Problem obtaining memory." // Feedback #define STRING_FEEDBACK_NO_TASKS "No tasks." diff --git a/src/ita-ITA.h b/src/ita-ITA.h index 6052732a3..3cd506732 100644 --- a/src/ita-ITA.h +++ b/src/ita-ITA.h @@ -690,6 +690,7 @@ #define STRING_INVALID_MOD "L'attributo '{1}' non ammette un valore pari a '{2}'." #define STRING_INVALID_SORT_COL "La colonna '{1}' non è un campo di ordinamento valido." #define STRING_TLS_INIT_FAIL "Error initializing TLS." +#define STRING_ERROR_MEMORY "Problem obtaining memory." // Feedback #define STRING_FEEDBACK_NO_TASKS "Nessun task." diff --git a/src/por-PRT.h b/src/por-PRT.h index 357a0dede..6fc541ccb 100644 --- a/src/por-PRT.h +++ b/src/por-PRT.h @@ -690,6 +690,7 @@ #define STRING_INVALID_MOD "O atributo '{1}' não permite o valor '{2}'." #define STRING_INVALID_SORT_COL "A coluna '{1}' não pode ser ordenada." #define STRING_TLS_INIT_FAIL "Erro a iniciar componente TLS." +#define STRING_ERROR_MEMORY "Problem obtaining memory." // Feedback #define STRING_FEEDBACK_NO_TASKS "Nenhuma tarefa."