Skip to content

Update vendored equations-parser code (fe93ca5 .. ec64e60) - #40

Open
rodiguif wants to merge 1 commit into
oxeanbits:masterfrom
rodiguif:sync/equations-parser-update
Open

rodiguif wants to merge 1 commit into
oxeanbits:masterfrom
rodiguif:sync/equations-parser-update

Conversation

@rodiguif

Copy link
Copy Markdown
Contributor

What this is

Updates the vendored equations-parser code in core/src/main/cpp/parser, which had been stuck since commit fe93ca5 (Nov/2022), up to the current HEAD ec64e60.

Instead of copying files one by one, this was done with a 3-way merge (git merge-file, BASE = fe93ca5, LOCAL = Android customizations, UPSTREAM = ec64e60), which applies upstream changes on top of the local customizations automatically.

equations-parser commits brought in by this PR

Commit Title
ec64e60 DUV-4103 Adding custom round with Up and down args (#59)
3a79bde Remove deprecated std::binary_function inheritance for C++17 compatibility (#56)
39ba4c4 Create current_time function (#53)
3e0e34f Create weekday(date) function (#50)
39d949b Create calculate(string) function (#48)
b81e50b Remove logs from regex function
76b6aaa Create weekyear(date) function (#46)
8769175 Create regex(input, pattern) function (#45)
0012543 Improve unneeded ternary operator (#41)
bfd3d5a Create helper functions inside EquationParser namespace (#43)
8c4fab5 Fixing compilation error on GCC 11.3.0

(Other commits from that period — 7428a00, e7650c1, a210f5d, a4606cd, fea0e4d, ecf9a64, af58a4c — only touched the equations-parser README, CMake config, or tests/CI, outside the vendored parser/ folder, so they have no effect here.)

How the result was validated

Every new feature above was checked individually (class declared + defined + registered via DefineFun), and every small removal/tweak (e.g. removing std::binary_function, simplifying a ternary, the GCC 11.3 fix, removing debug logs) was confirmed present in the final result.

Final comparison between equations-parser/parser (HEAD) and this module's core/src/main/cpp/parser (run from the parent directory containing both repos as siblings):

$ diff -ru equations-parser/parser parsecs-android/core/src/main/cpp/parser
--- equations-parser/parser/mpFuncStr.cpp
+++ parsecs-android/core/src/main/cpp/parser/mpFuncStr.cpp
@@ -89,7 +89,6 @@
     if (a_iArgc > 3)
       throw ParserError(ErrorContext(ecTOO_MANY_PARAMS, GetExprPos(), GetIdent()));
-
     string_type str1 = a_pArg[0]->GetString();
@@ -266,7 +265,7 @@
-      } else if (a_pArg[0]->GetType() == 's') { // NOT NULL first parameter
+      } else if (a_pArg[0]->GetType() == 's'){ // NOT NULL first parameter
@@ -452,9 +451,9 @@
       #ifndef _UNICODE
-          sscanf(string_value.c_str(), "%lf", &out);
+        sscanf(string_value.c_str(), "%lf", &out);
       #else
-          swscanf(string_value.c_str(), _T("%lf"), &out);
+        swscanf(string_value.c_str(), _T("%lf"), &out);
       #endif
--- equations-parser/parser/mpFuncStr.h
+++ parsecs-android/core/src/main/cpp/parser/mpFuncStr.h
@@ -179,7 +179,7 @@
   }; // class FunStrNumber
-//------------------------------------------------------------------------------
+  //------------------------------------------------------------------------------
--- equations-parser/parser/mpValue.cpp
+++ parsecs-android/core/src/main/cpp/parser/mpValue.cpp
@@ -36,7 +36,6 @@
 #include <limits>
-
 MUP_NAMESPACE_START

The only remaining differences are pre-existing Android-side formatting quirks (a stray blank line, a missing space before {, indentation inside an #ifndef block) — confirmed identical to their state before this sync, unrelated to any change in this PR. No functional/content difference. Every other file in parser/ ended up byte-for-byte identical to upstream.

Notes

  • equationsParser.cpp/h (new upstream since bfd3d5a) was ported — it's a real dependency of the calculate(s) function added in 39d949b, not just optional convenience code (the build failed to link without it: undefined symbol: EquationsParser::Calc).
  • Tested locally by building the core module (Debug, arm64-v8a and x86) via Android Studio.

Updates the vendored muParserX code in core/src/main/cpp/parser to match
equations-parser's current HEAD, merged via a 3-way merge (BASE=fe93ca5,
LOCAL=Android customizations, UPSTREAM=ec64e60) instead of copying files
by hand.

Brings in the following equations-parser changes:
- DUV-4103 Adding custom round with Up and down args (#59)
- Remove deprecated std::binary_function inheritance for C++17 compatibility (#56)
- Create current_time function (#53)
- Create weekday(date) function (#50)
- Create calculate(string) function (#48)
- Remove logs from regex function
- Create weekyear(date) function (#46)
- Create regex(input, pattern) function (#45)
- Improve unneeded ternary operator (#41)
- Create helper functions inside EquationParser namespace (#43)
- Fixing compilation error on GCC 11.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant