summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmexpression.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-02-22 20:01:15 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-22 20:01:15 +0000
commit26fc813975170de5040e9abe79a80b7034719944 (patch)
tree3ba21bf39f87fb4b47df8da5ecd31c41f5bb4c9a /xfa/fxfa/fm2js/cxfa_fmexpression.h
parentcc48741d63e216b3030fc2e452b6cf07481596ea (diff)
downloadpdfium-26fc813975170de5040e9abe79a80b7034719944.tar.xz
[formcalc] Cleanup function handling
This CL creates a CXFA_FMAST root for the AST tree instead of overloading the CXFA_FMFunctionDefinition. This Removes the m_global from FunctionDefinition and simpifies the code. Change-Id: I9347769a291ef1753539701f334cc8dd69b7187e Reviewed-on: https://pdfium-review.googlesource.com/27590 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmexpression.h')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmexpression.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.h b/xfa/fxfa/fm2js/cxfa_fmexpression.h
index 5024432df9..32cbf96c95 100644
--- a/xfa/fxfa/fm2js/cxfa_fmexpression.h
+++ b/xfa/fxfa/fm2js/cxfa_fmexpression.h
@@ -26,7 +26,6 @@ class CXFA_FMExpression {
class CXFA_FMFunctionDefinition : public CXFA_FMExpression {
public:
CXFA_FMFunctionDefinition(
- bool isGlobal,
const WideStringView& wsName,
std::vector<WideStringView>&& arguments,
std::vector<std::unique_ptr<CXFA_FMExpression>>&& expressions);
@@ -38,7 +37,18 @@ class CXFA_FMFunctionDefinition : public CXFA_FMExpression {
WideStringView m_wsName;
std::vector<WideStringView> m_pArguments;
std::vector<std::unique_ptr<CXFA_FMExpression>> m_pExpressions;
- bool m_isGlobal;
+};
+
+class CXFA_FMAST {
+ public:
+ explicit CXFA_FMAST(
+ std::vector<std::unique_ptr<CXFA_FMExpression>> expressions);
+ ~CXFA_FMAST();
+
+ bool ToJavaScript(CFX_WideTextBuf& javascript);
+
+ private:
+ std::vector<std::unique_ptr<CXFA_FMExpression>> expressions_;
};
class CXFA_FMVarExpression : public CXFA_FMExpression {