diff options
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmlexer.h | 3 | ||||
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmparser.cpp | 11 |
2 files changed, 4 insertions, 10 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.h b/xfa/fxfa/fm2js/cxfa_fmlexer.h index c0156f72f7..3864abb0eb 100644 --- a/xfa/fxfa/fm2js/cxfa_fmlexer.h +++ b/xfa/fxfa/fm2js/cxfa_fmlexer.h @@ -110,9 +110,6 @@ class CXFA_FMLexer { CXFA_FMToken NextToken(); - const wchar_t* GetPos() { return m_cursor; } - void SetPos(const wchar_t* pos) { m_cursor = pos; } - private: CXFA_FMToken AdvanceForNumber(); CXFA_FMToken AdvanceForString(); diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.cpp b/xfa/fxfa/fm2js/cxfa_fmparser.cpp index a103183c38..fc8c58511a 100644 --- a/xfa/fxfa/fm2js/cxfa_fmparser.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmparser.cpp @@ -938,8 +938,6 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseIfExpression() { AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; - - const wchar_t* pStartPos = m_lexer->GetPos(); if (!NextToken() || !CheckThenNext(TOKlparen)) return nullptr; @@ -955,13 +953,12 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseIfExpression() { } if (!CheckThenNext(TOKrparen)) return nullptr; + if (m_token.m_type != TOKthen) { - m_token = CXFA_FMToken(TOKidentifier); - m_token.m_string = L"if"; - m_lexer->SetPos(pStartPos); - return ParseExpExpression(); + m_error = true; + return nullptr; } - if (!CheckThenNext(TOKthen)) + if (!NextToken()) return nullptr; std::unique_ptr<CXFA_FMExpression> pIfExpression = ParseBlockExpression(); |