Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: xfa/fxfa/fm2js/xfa_fmparse.cpp

Issue 2027273002: Fix all the code which has duplicate variable declarations (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/fm2js/xfa_fm2jscontext.cpp ('k') | xfa/fxfa/parser/xfa_document_datamerger_imp.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_fmparse.h" 7 #include "xfa/fxfa/fm2js/xfa_fmparse.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 CXFA_FMSimpleExpression* e) { 548 CXFA_FMSimpleExpression* e) {
549 uint32_t line = m_pToken->m_uLinenum; 549 uint32_t line = m_pToken->m_uLinenum;
550 while (1) { 550 while (1) {
551 switch (m_pToken->m_type) { 551 switch (m_pToken->m_type) {
552 case TOKlparen: { 552 case TOKlparen: {
553 NextToken(); 553 NextToken();
554 std::unique_ptr<CFX_ArrayTemplate<CXFA_FMSimpleExpression*>> pArray; 554 std::unique_ptr<CFX_ArrayTemplate<CXFA_FMSimpleExpression*>> pArray;
555 if (m_pToken->m_type != TOKrparen) { 555 if (m_pToken->m_type != TOKrparen) {
556 pArray.reset(new CFX_ArrayTemplate<CXFA_FMSimpleExpression*>()); 556 pArray.reset(new CFX_ArrayTemplate<CXFA_FMSimpleExpression*>());
557 while (m_pToken->m_type != TOKrparen) { 557 while (m_pToken->m_type != TOKrparen) {
558 CXFA_FMSimpleExpression* e = ParseSimpleExpression(); 558 if (CXFA_FMSimpleExpression* expr = ParseSimpleExpression())
559 if (e) { 559 pArray->Add(expr);
560 pArray->Add(e);
561 }
562 if (m_pToken->m_type == TOKcomma) { 560 if (m_pToken->m_type == TOKcomma) {
563 NextToken(); 561 NextToken();
564 } else if (m_pToken->m_type == TOKeof || 562 } else if (m_pToken->m_type == TOKeof ||
565 m_pToken->m_type == TOKreserver) { 563 m_pToken->m_type == TOKreserver) {
566 break; 564 break;
567 } 565 }
568 } 566 }
569 if (m_pToken->m_type != TOKrparen) { 567 if (m_pToken->m_type != TOKrparen) {
570 CFX_WideString ws_TempString(m_pToken->m_wstring); 568 CFX_WideString ws_TempString(m_pToken->m_wstring);
571 Error(m_pToken->m_uLinenum, kFMErrExpectedToken, 569 Error(m_pToken->m_uLinenum, kFMErrExpectedToken,
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 NextToken(); 1040 NextToken();
1043 e.reset(ParseBlockExpression()); 1041 e.reset(ParseBlockExpression());
1044 Check(TOKend); 1042 Check(TOKend);
1045 if (m_pErrorInfo->message.IsEmpty()) { 1043 if (m_pErrorInfo->message.IsEmpty()) {
1046 e.reset(new CXFA_FMDoExpression(line, e.release())); 1044 e.reset(new CXFA_FMDoExpression(line, e.release()));
1047 } else { 1045 } else {
1048 e.reset(); 1046 e.reset();
1049 } 1047 }
1050 return e.release(); 1048 return e.release();
1051 } 1049 }
OLDNEW
« no previous file with comments | « xfa/fxfa/fm2js/xfa_fm2jscontext.cpp ('k') | xfa/fxfa/parser/xfa_document_datamerger_imp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698