| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fxfa/fm2js/xfa_lexer.h" | 7 #include "xfa/fxfa/fm2js/xfa_lexer.h" |
| 8 | 8 |
| 9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
| 10 | 10 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 160 |
| 161 CXFA_FMToken::CXFA_FMToken() : m_type(TOKreserver), m_uLinenum(1) {} | 161 CXFA_FMToken::CXFA_FMToken() : m_type(TOKreserver), m_uLinenum(1) {} |
| 162 | 162 |
| 163 CXFA_FMToken::CXFA_FMToken(uint32_t uLineNum) | 163 CXFA_FMToken::CXFA_FMToken(uint32_t uLineNum) |
| 164 : m_type(TOKreserver), m_uLinenum(uLineNum) {} | 164 : m_type(TOKreserver), m_uLinenum(uLineNum) {} |
| 165 | 165 |
| 166 CXFA_FMLexer::CXFA_FMLexer(const CFX_WideStringC& wsFormCalc, | 166 CXFA_FMLexer::CXFA_FMLexer(const CFX_WideStringC& wsFormCalc, |
| 167 CXFA_FMErrorInfo* pErrorInfo) | 167 CXFA_FMErrorInfo* pErrorInfo) |
| 168 : m_ptr(wsFormCalc.c_str()), m_uCurrentLine(1), m_pErrorInfo(pErrorInfo) {} | 168 : m_ptr(wsFormCalc.c_str()), m_uCurrentLine(1), m_pErrorInfo(pErrorInfo) {} |
| 169 | 169 |
| 170 CXFA_FMLexer::~CXFA_FMLexer() {} |
| 171 |
| 170 CXFA_FMToken* CXFA_FMLexer::NextToken() { | 172 CXFA_FMToken* CXFA_FMLexer::NextToken() { |
| 171 m_pToken.reset(Scan()); | 173 m_pToken.reset(Scan()); |
| 172 return m_pToken.get(); | 174 return m_pToken.get(); |
| 173 } | 175 } |
| 174 | 176 |
| 175 CXFA_FMToken* CXFA_FMLexer::Scan() { | 177 CXFA_FMToken* CXFA_FMLexer::Scan() { |
| 176 uint16_t ch = 0; | 178 uint16_t ch = 0; |
| 177 CXFA_FMToken* p = new CXFA_FMToken(m_uCurrentLine); | 179 CXFA_FMToken* p = new CXFA_FMToken(m_uCurrentLine); |
| 178 if (!XFA_FMDChar::isAvalid(m_ptr)) { | 180 if (!XFA_FMDChar::isAvalid(m_ptr)) { |
| 179 ch = XFA_FMDChar::get(m_ptr); | 181 ch = XFA_FMDChar::get(m_ptr); |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 m_pErrorInfo->message.FormatV(msg, ap); | 541 m_pErrorInfo->message.FormatV(msg, ap); |
| 540 va_end(ap); | 542 va_end(ap); |
| 541 } | 543 } |
| 542 | 544 |
| 543 FX_BOOL CXFA_FMLexer::HasError() const { | 545 FX_BOOL CXFA_FMLexer::HasError() const { |
| 544 if (m_pErrorInfo->message.IsEmpty()) { | 546 if (m_pErrorInfo->message.IsEmpty()) { |
| 545 return FALSE; | 547 return FALSE; |
| 546 } | 548 } |
| 547 return TRUE; | 549 return TRUE; |
| 548 } | 550 } |
| OLD | NEW |