summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-02-21 22:16:26 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-21 22:16:26 +0000
commitaa2aff78e082f14e4bc418f68b27817f90e3f07a (patch)
treee646df3a814cb66508350049ec2132635f231f36 /xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
parent00c1d0b07542611d295dc666ff55d46b0d3f712b (diff)
downloadpdfium-aa2aff78e082f14e4bc418f68b27817f90e3f07a.tar.xz
[formcalc] Cleanup if expression parsing.
This CL simplifies the if expression parsing. The elseif construct has been split into its own list of IfExpressions and no longer gets stuffed into the elseExpression. A loop was added into the output methods for the elseif expressions, which also means we can go from having: if () { } else { if () { } else { } } to if () { } else if () { } else { } Which is a bit nicer. Change-Id: I6edf75215500d6a32a8d7218d477b6960f03de51 Reviewed-on: https://pdfium-review.googlesource.com/27571 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
index 53ad0ee02b..e939cd954f 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
@@ -92,8 +92,7 @@ TEST(CXFA_FMParserTest, Parse) {
L"pfm_rt.dot_acc(border, \"border\", \"fill\", 0, 0), \"\", "
L"\"color\", 0, 0), \"\", \"value\", 0, 0), \"255,64,64\");\n"
L"}\n"
- L"}\nelse\n{\n"
- L"if (pfm_rt.get_val(pfm_rt.neq_op(this, pfm_rt.neg_op(2))))\n"
+ L"}\nelse if (pfm_rt.get_val(pfm_rt.neq_op(this, pfm_rt.neg_op(2))))\n"
L"{\n"
L"if (pfm_rt.is_obj(pfm_rt.dot_acc(pfm_rt.dot_acc(pfm_rt.dot_acc(border, "
L"\"border\", \"fill\", 0, 0), \"\", \"color\", 0, 0), \"\", \"value\", "
@@ -104,7 +103,7 @@ TEST(CXFA_FMParserTest, Parse) {
L"0, 0), \"128,128,128\");\n"
L"}\n"
L"}\n"
- L"else\n{\n{\n"
+ L"else {\n"
L"if (pfm_rt.is_obj(pfm_rt.dot_acc(pfm_rt.dot_acc(pfm_rt.dot_acc("
L"border, \"border\", \"fill\", 0, 0), \"\", \"color\", 0, 0), \"\", "
L"\"value\", 0, 0)))\n{\n"
@@ -113,8 +112,6 @@ TEST(CXFA_FMParserTest, Parse) {
L"\"color\", 0, 0), \"\", \"value\", 0, 0), \"20,170,13\");\n"
L"}\n"
L"}\n"
- L"}\n"
- L"}\n"
L"pfm_ret = this;\n"
L"return pfm_rt.get_val(pfm_ret);\n"
L"}\n).call(this);\n";