diff --git a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants.ref.cpp b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants.ref.cpp index db7c67e57..41c52c99a 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants.ref.cpp @@ -6,8 +6,28 @@ #include "FppConstantsAc.hpp" -const char *const s1 = "\"Hello,\" he said."; +const F64 b = 1.0; -const char *const s2 = "Line 1.\nLine 2."; +const bool c = true; -const char *const s3 = "\\"; +const char *const d = "abc"; + +namespace M { + + const F64 b = 1.5; + + const bool c = true; + + const char *const d = "abc"; + +} + +const F64 C_b = 1.0; + +const bool C_c = true; + +const char *const C_d = "abc"; + +const F64 C_j = 3.5; + +const F64 C_k = 3.7; diff --git a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants.ref.hpp b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants.ref.hpp index bcabbd35d..bedfc4236 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants.ref.hpp @@ -9,13 +9,76 @@ #include "Fw/Types/BasicTypes.hpp" -//! Escaped quotation marks -extern const char *const s1; +//! Constant a +enum FppConstant_a { + a = 0 +}; -//! Escaped newlines -extern const char *const s2; +//! Constant b +extern const F64 b; -//! Escaped backslashes -extern const char *const s3; +//! Constant c +extern const bool c; + +//! Constant d +extern const char *const d; + +//! Constant e +enum FppConstant_e { + e = 3 +}; + +namespace M { + + //! Constant a + enum FppConstant_a { + a = 0 + }; + + //! Constant b + extern const F64 b; + + //! Constant c + extern const bool c; + + //! Constant d + extern const char *const d; + + //! Constant e + enum FppConstant_e { + e = 3 + }; + +} + +//! Constant a +enum FppConstant_C_a { + C_a = 0 +}; + +//! Constant b +extern const F64 C_b; + +//! Constant c +extern const bool C_c; + +//! Constant d +extern const char *const C_d; + +//! Constant e +enum FppConstant_C_e { + C_e = 3 +}; + +//! Constant g +enum FppConstant_C_g { + C_g = 1 +}; + +//! Constant j +extern const F64 C_j; + +//! Constant k +extern const F64 C_k; #endif diff --git a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_dir.ref.cpp b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_dir.ref.cpp index ecf313911..a30e7dfbd 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_dir.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_dir.ref.cpp @@ -28,8 +28,6 @@ const bool C_c = true; const char *const C_d = "abc"; -const F64 C_g = 1.5; - const F64 C_j = 3.5; const F64 C_k = 3.7; diff --git a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_dir.ref.hpp b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_dir.ref.hpp index 09634c064..0a4aba0d2 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_dir.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_dir.ref.hpp @@ -70,20 +70,15 @@ enum FppConstant_C_e { C_e = 3 }; -<<<<<<< HEAD -//! Constant f -enum FppConstant_C_g { - C_g = 2 -}; -======= //! Constant g -extern const F64 C_g; +enum FppConstant_C_g { + C_g = 1 +}; //! Constant j extern const F64 C_j; //! Constant k extern const F64 C_k; ->>>>>>> origin/feature/struct-member-expr #endif diff --git a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_prefix.ref.cpp b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_prefix.ref.cpp index f8b21e87e..41c52c99a 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_prefix.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_prefix.ref.cpp @@ -28,8 +28,6 @@ const bool C_c = true; const char *const C_d = "abc"; -const F64 C_g = 1.5; - const F64 C_j = 3.5; const F64 C_k = 3.7; diff --git a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_prefix.ref.hpp b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_prefix.ref.hpp index a2e090744..124dcd097 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_prefix.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/constants/FppConstantsAc_constants_guard_prefix.ref.hpp @@ -70,20 +70,15 @@ enum FppConstant_C_e { C_e = 3 }; -<<<<<<< HEAD -//! Constant f -enum FppConstant_C_g { - C_g = 2 -}; -======= //! Constant g -extern const F64 C_g; +enum FppConstant_C_g { + C_g = 1 +}; //! Constant j extern const F64 C_j; //! Constant k extern const F64 C_k; ->>>>>>> origin/feature/struct-member-expr #endif diff --git a/compiler/tools/fpp-to-cpp/test/constants/constants.fpp b/compiler/tools/fpp-to-cpp/test/constants/constants.fpp index e3086e6e1..4d821e71d 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/constants.fpp +++ b/compiler/tools/fpp-to-cpp/test/constants/constants.fpp @@ -37,7 +37,7 @@ module M { @ Constant e constant e = E2.X - constant f = { a = b, b = { a = b + 1 } } + constant f = { a = b, b = { a = b + 1 }, c = [ 0, 1, 2 ] } } passive component C { @@ -63,7 +63,7 @@ passive component C { constant f = M.f @ Constant g - constant g = f[1] + constant g = f.c[1] @ Constant h constant h = M.f.b diff --git a/compiler/tools/fpp-to-cpp/test/constants/constants.ref.txt b/compiler/tools/fpp-to-cpp/test/constants/constants.ref.txt index 0565a4497..e69de29bb 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/constants.ref.txt +++ b/compiler/tools/fpp-to-cpp/test/constants/constants.ref.txt @@ -1,5 +0,0 @@ -fpp-to-cpp -[ local path prefix ]/tools/fpp-to-cpp/test/constants/constants.fpp:66.16 - constant g = f[1] - ^ -error: { a: F64, b: { a: F64 } } is not an array type diff --git a/compiler/tools/fpp-to-cpp/test/constants/output_dir/FppConstantsAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/constants/output_dir/FppConstantsAc.ref.cpp index 797eb5285..41c52c99a 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/output_dir/FppConstantsAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/constants/output_dir/FppConstantsAc.ref.cpp @@ -14,7 +14,7 @@ const char *const d = "abc"; namespace M { - const F64 b = 1.0; + const F64 b = 1.5; const bool c = true; @@ -27,3 +27,7 @@ const F64 C_b = 1.0; const bool C_c = true; const char *const C_d = "abc"; + +const F64 C_j = 3.5; + +const F64 C_k = 3.7; diff --git a/compiler/tools/fpp-to-cpp/test/constants/output_dir/FppConstantsAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/constants/output_dir/FppConstantsAc.ref.hpp index a0e98b350..bedfc4236 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/output_dir/FppConstantsAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/constants/output_dir/FppConstantsAc.ref.hpp @@ -70,4 +70,15 @@ enum FppConstant_C_e { C_e = 3 }; +//! Constant g +enum FppConstant_C_g { + C_g = 1 +}; + +//! Constant j +extern const F64 C_j; + +//! Constant k +extern const F64 C_k; + #endif diff --git a/compiler/tools/fpp-to-cpp/test/constants/output_dir/constants.ref.txt b/compiler/tools/fpp-to-cpp/test/constants/output_dir/constants.ref.txt index 0565a4497..e69de29bb 100644 --- a/compiler/tools/fpp-to-cpp/test/constants/output_dir/constants.ref.txt +++ b/compiler/tools/fpp-to-cpp/test/constants/output_dir/constants.ref.txt @@ -1,5 +0,0 @@ -fpp-to-cpp -[ local path prefix ]/tools/fpp-to-cpp/test/constants/constants.fpp:66.16 - constant g = f[1] - ^ -error: { a: F64, b: { a: F64 } } is not an array type