| 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_fmparse.h" | 7 #include "xfa/fxfa/fm2js/xfa_fmparse.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 void CXFA_FMParse::Check(XFA_FM_TOKEN op) { | 30 void CXFA_FMParse::Check(XFA_FM_TOKEN op) { |
| 31 if (m_pToken->m_type != op) { | 31 if (m_pToken->m_type != op) { |
| 32 CFX_WideString ws_TempString = m_pToken->m_wstring; | 32 CFX_WideString ws_TempString = m_pToken->m_wstring; |
| 33 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, | 33 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, |
| 34 XFA_FM_KeywordToString(op), ws_TempString.c_str()); | 34 XFA_FM_KeywordToString(op), ws_TempString.c_str()); |
| 35 } | 35 } |
| 36 NextToken(); | 36 NextToken(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void CXFA_FMParse::Error(FX_DWORD lineNum, XFA_FM_ERRMSG msg, ...) { | 39 void CXFA_FMParse::Error(uint32_t lineNum, XFA_FM_ERRMSG msg, ...) { |
| 40 m_pErrorInfo->linenum = lineNum; | 40 m_pErrorInfo->linenum = lineNum; |
| 41 const FX_WCHAR* lpMessageInfo = XFA_FM_ErrorMsg(msg); | 41 const FX_WCHAR* lpMessageInfo = XFA_FM_ErrorMsg(msg); |
| 42 va_list ap; | 42 va_list ap; |
| 43 va_start(ap, msg); | 43 va_start(ap, msg); |
| 44 m_pErrorInfo->message.FormatV(lpMessageInfo, ap); | 44 m_pErrorInfo->message.FormatV(lpMessageInfo, ap); |
| 45 va_end(ap); | 45 va_end(ap); |
| 46 } | 46 } |
| 47 | 47 |
| 48 CFX_PtrArray* CXFA_FMParse::ParseTopExpression() { | 48 CFX_PtrArray* CXFA_FMParse::ParseTopExpression() { |
| 49 std::unique_ptr<CXFA_FMExpression> e; | 49 std::unique_ptr<CXFA_FMExpression> e; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 return expression; | 74 return expression; |
| 75 } | 75 } |
| 76 | 76 |
| 77 CXFA_FMExpression* CXFA_FMParse::ParseFunction() { | 77 CXFA_FMExpression* CXFA_FMParse::ParseFunction() { |
| 78 std::unique_ptr<CXFA_FMExpression> e; | 78 std::unique_ptr<CXFA_FMExpression> e; |
| 79 CFX_WideStringC ident; | 79 CFX_WideStringC ident; |
| 80 std::unique_ptr<CFX_WideStringCArray> pArguments; | 80 std::unique_ptr<CFX_WideStringCArray> pArguments; |
| 81 std::unique_ptr<CFX_PtrArray> pExpressions; | 81 std::unique_ptr<CFX_PtrArray> pExpressions; |
| 82 FX_DWORD line = m_pToken->m_uLinenum; | 82 uint32_t line = m_pToken->m_uLinenum; |
| 83 NextToken(); | 83 NextToken(); |
| 84 if (m_pToken->m_type != TOKidentifier) { | 84 if (m_pToken->m_type != TOKidentifier) { |
| 85 CFX_WideString ws_TempString = m_pToken->m_wstring; | 85 CFX_WideString ws_TempString = m_pToken->m_wstring; |
| 86 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, | 86 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, |
| 87 ws_TempString.c_str()); | 87 ws_TempString.c_str()); |
| 88 } else { | 88 } else { |
| 89 ident = m_pToken->m_wstring; | 89 ident = m_pToken->m_wstring; |
| 90 NextToken(); | 90 NextToken(); |
| 91 } | 91 } |
| 92 Check(TOKlparen); | 92 Check(TOKlparen); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 if (pExpressions) { | 135 if (pExpressions) { |
| 136 for (int i = 0; i < pExpressions->GetSize(); ++i) | 136 for (int i = 0; i < pExpressions->GetSize(); ++i) |
| 137 delete static_cast<CXFA_FMExpression*>(pExpressions->GetAt(i)); | 137 delete static_cast<CXFA_FMExpression*>(pExpressions->GetAt(i)); |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 return e.release(); | 140 return e.release(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 CXFA_FMExpression* CXFA_FMParse::ParseExpression() { | 143 CXFA_FMExpression* CXFA_FMParse::ParseExpression() { |
| 144 std::unique_ptr<CXFA_FMExpression> e; | 144 std::unique_ptr<CXFA_FMExpression> e; |
| 145 FX_DWORD line = m_pToken->m_uLinenum; | 145 uint32_t line = m_pToken->m_uLinenum; |
| 146 switch (m_pToken->m_type) { | 146 switch (m_pToken->m_type) { |
| 147 case TOKvar: | 147 case TOKvar: |
| 148 e.reset(ParseVarExpression()); | 148 e.reset(ParseVarExpression()); |
| 149 break; | 149 break; |
| 150 case TOKnull: | 150 case TOKnull: |
| 151 case TOKnumber: | 151 case TOKnumber: |
| 152 case TOKstring: | 152 case TOKstring: |
| 153 case TOKplus: | 153 case TOKplus: |
| 154 case TOKminus: | 154 case TOKminus: |
| 155 case TOKksnot: | 155 case TOKksnot: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 186 ws_TempString.c_str()); | 186 ws_TempString.c_str()); |
| 187 NextToken(); | 187 NextToken(); |
| 188 break; | 188 break; |
| 189 } | 189 } |
| 190 return e.release(); | 190 return e.release(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 CXFA_FMExpression* CXFA_FMParse::ParseVarExpression() { | 193 CXFA_FMExpression* CXFA_FMParse::ParseVarExpression() { |
| 194 std::unique_ptr<CXFA_FMExpression> e; | 194 std::unique_ptr<CXFA_FMExpression> e; |
| 195 CFX_WideStringC ident; | 195 CFX_WideStringC ident; |
| 196 FX_DWORD line = m_pToken->m_uLinenum; | 196 uint32_t line = m_pToken->m_uLinenum; |
| 197 NextToken(); | 197 NextToken(); |
| 198 if (m_pToken->m_type != TOKidentifier) { | 198 if (m_pToken->m_type != TOKidentifier) { |
| 199 CFX_WideString ws_TempString = m_pToken->m_wstring; | 199 CFX_WideString ws_TempString = m_pToken->m_wstring; |
| 200 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, | 200 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, |
| 201 ws_TempString.c_str()); | 201 ws_TempString.c_str()); |
| 202 } else { | 202 } else { |
| 203 ident = m_pToken->m_wstring; | 203 ident = m_pToken->m_wstring; |
| 204 NextToken(); | 204 NextToken(); |
| 205 } | 205 } |
| 206 if (m_pToken->m_type == TOKassign) { | 206 if (m_pToken->m_type == TOKassign) { |
| 207 NextToken(); | 207 NextToken(); |
| 208 e.reset(ParseExpExpression()); | 208 e.reset(ParseExpExpression()); |
| 209 } | 209 } |
| 210 if (m_pErrorInfo->message.IsEmpty()) { | 210 if (m_pErrorInfo->message.IsEmpty()) { |
| 211 e.reset(new CXFA_FMVarExpression(line, ident, e.release())); | 211 e.reset(new CXFA_FMVarExpression(line, ident, e.release())); |
| 212 } else { | 212 } else { |
| 213 e.reset(); | 213 e.reset(); |
| 214 } | 214 } |
| 215 return e.release(); | 215 return e.release(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 CXFA_FMSimpleExpression* CXFA_FMParse::ParseSimpleExpression() { | 218 CXFA_FMSimpleExpression* CXFA_FMParse::ParseSimpleExpression() { |
| 219 FX_DWORD line = m_pToken->m_uLinenum; | 219 uint32_t line = m_pToken->m_uLinenum; |
| 220 std::unique_ptr<CXFA_FMSimpleExpression> pExp1(ParseLogicalOrExpression()); | 220 std::unique_ptr<CXFA_FMSimpleExpression> pExp1(ParseLogicalOrExpression()); |
| 221 while (m_pToken->m_type == TOKassign) { | 221 while (m_pToken->m_type == TOKassign) { |
| 222 NextToken(); | 222 NextToken(); |
| 223 std::unique_ptr<CXFA_FMSimpleExpression> pExp2(ParseLogicalOrExpression()); | 223 std::unique_ptr<CXFA_FMSimpleExpression> pExp2(ParseLogicalOrExpression()); |
| 224 if (m_pErrorInfo->message.IsEmpty()) { | 224 if (m_pErrorInfo->message.IsEmpty()) { |
| 225 pExp1.reset(new CXFA_FMAssignExpression(line, TOKassign, pExp1.release(), | 225 pExp1.reset(new CXFA_FMAssignExpression(line, TOKassign, pExp1.release(), |
| 226 pExp2.release())); | 226 pExp2.release())); |
| 227 } else { | 227 } else { |
| 228 pExp1.reset(); | 228 pExp1.reset(); |
| 229 } | 229 } |
| 230 } | 230 } |
| 231 return pExp1.release(); | 231 return pExp1.release(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 CXFA_FMExpression* CXFA_FMParse::ParseExpExpression() { | 234 CXFA_FMExpression* CXFA_FMParse::ParseExpExpression() { |
| 235 FX_DWORD line = m_pToken->m_uLinenum; | 235 uint32_t line = m_pToken->m_uLinenum; |
| 236 std::unique_ptr<CXFA_FMSimpleExpression> pExp1(ParseSimpleExpression()); | 236 std::unique_ptr<CXFA_FMSimpleExpression> pExp1(ParseSimpleExpression()); |
| 237 std::unique_ptr<CXFA_FMExpression> e; | 237 std::unique_ptr<CXFA_FMExpression> e; |
| 238 if (m_pErrorInfo->message.IsEmpty()) { | 238 if (m_pErrorInfo->message.IsEmpty()) { |
| 239 e.reset(new CXFA_FMExpExpression(line, pExp1.release())); | 239 e.reset(new CXFA_FMExpExpression(line, pExp1.release())); |
| 240 } else { | 240 } else { |
| 241 e.reset(); | 241 e.reset(); |
| 242 } | 242 } |
| 243 return e.release(); | 243 return e.release(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 CXFA_FMSimpleExpression* CXFA_FMParse::ParseLogicalOrExpression() { | 246 CXFA_FMSimpleExpression* CXFA_FMParse::ParseLogicalOrExpression() { |
| 247 FX_DWORD line = m_pToken->m_uLinenum; | 247 uint32_t line = m_pToken->m_uLinenum; |
| 248 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseLogicalAndExpression()); | 248 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseLogicalAndExpression()); |
| 249 for (;;) { | 249 for (;;) { |
| 250 switch (m_pToken->m_type) { | 250 switch (m_pToken->m_type) { |
| 251 case TOKor: | 251 case TOKor: |
| 252 case TOKksor: { | 252 case TOKksor: { |
| 253 NextToken(); | 253 NextToken(); |
| 254 std::unique_ptr<CXFA_FMSimpleExpression> e2( | 254 std::unique_ptr<CXFA_FMSimpleExpression> e2( |
| 255 ParseLogicalAndExpression()); | 255 ParseLogicalAndExpression()); |
| 256 if (m_pErrorInfo->message.IsEmpty()) { | 256 if (m_pErrorInfo->message.IsEmpty()) { |
| 257 e1.reset(new CXFA_FMLogicalOrExpression(line, TOKor, e1.release(), | 257 e1.reset(new CXFA_FMLogicalOrExpression(line, TOKor, e1.release(), |
| 258 e2.release())); | 258 e2.release())); |
| 259 } else { | 259 } else { |
| 260 e1.reset(); | 260 e1.reset(); |
| 261 } | 261 } |
| 262 continue; | 262 continue; |
| 263 } | 263 } |
| 264 default: | 264 default: |
| 265 break; | 265 break; |
| 266 } | 266 } |
| 267 break; | 267 break; |
| 268 } | 268 } |
| 269 return e1.release(); | 269 return e1.release(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 CXFA_FMSimpleExpression* CXFA_FMParse::ParseLogicalAndExpression() { | 272 CXFA_FMSimpleExpression* CXFA_FMParse::ParseLogicalAndExpression() { |
| 273 FX_DWORD line = m_pToken->m_uLinenum; | 273 uint32_t line = m_pToken->m_uLinenum; |
| 274 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseEqualityExpression()); | 274 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseEqualityExpression()); |
| 275 for (;;) { | 275 for (;;) { |
| 276 switch (m_pToken->m_type) { | 276 switch (m_pToken->m_type) { |
| 277 case TOKand: | 277 case TOKand: |
| 278 case TOKksand: { | 278 case TOKksand: { |
| 279 NextToken(); | 279 NextToken(); |
| 280 std::unique_ptr<CXFA_FMSimpleExpression> e2(ParseEqualityExpression()); | 280 std::unique_ptr<CXFA_FMSimpleExpression> e2(ParseEqualityExpression()); |
| 281 if (m_pErrorInfo->message.IsEmpty()) { | 281 if (m_pErrorInfo->message.IsEmpty()) { |
| 282 e1.reset(new CXFA_FMLogicalAndExpression(line, TOKand, e1.release(), | 282 e1.reset(new CXFA_FMLogicalAndExpression(line, TOKand, e1.release(), |
| 283 e2.release())); | 283 e2.release())); |
| 284 } else { | 284 } else { |
| 285 e1.reset(); | 285 e1.reset(); |
| 286 } | 286 } |
| 287 continue; | 287 continue; |
| 288 } | 288 } |
| 289 default: | 289 default: |
| 290 break; | 290 break; |
| 291 } | 291 } |
| 292 break; | 292 break; |
| 293 } | 293 } |
| 294 return e1.release(); | 294 return e1.release(); |
| 295 } | 295 } |
| 296 | 296 |
| 297 CXFA_FMSimpleExpression* CXFA_FMParse::ParseEqualityExpression() { | 297 CXFA_FMSimpleExpression* CXFA_FMParse::ParseEqualityExpression() { |
| 298 FX_DWORD line = m_pToken->m_uLinenum; | 298 uint32_t line = m_pToken->m_uLinenum; |
| 299 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseRelationalExpression()); | 299 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseRelationalExpression()); |
| 300 for (;;) { | 300 for (;;) { |
| 301 std::unique_ptr<CXFA_FMSimpleExpression> e2; | 301 std::unique_ptr<CXFA_FMSimpleExpression> e2; |
| 302 switch (m_pToken->m_type) { | 302 switch (m_pToken->m_type) { |
| 303 case TOKeq: | 303 case TOKeq: |
| 304 case TOKkseq: | 304 case TOKkseq: |
| 305 NextToken(); | 305 NextToken(); |
| 306 e2.reset(ParseRelationalExpression()); | 306 e2.reset(ParseRelationalExpression()); |
| 307 if (m_pErrorInfo->message.IsEmpty()) { | 307 if (m_pErrorInfo->message.IsEmpty()) { |
| 308 e1.reset(new CXFA_FMEqualityExpression(line, TOKeq, e1.release(), | 308 e1.reset(new CXFA_FMEqualityExpression(line, TOKeq, e1.release(), |
| (...skipping 15 matching lines...) Expand all Loading... |
| 324 continue; | 324 continue; |
| 325 default: | 325 default: |
| 326 break; | 326 break; |
| 327 } | 327 } |
| 328 break; | 328 break; |
| 329 } | 329 } |
| 330 return e1.release(); | 330 return e1.release(); |
| 331 } | 331 } |
| 332 | 332 |
| 333 CXFA_FMSimpleExpression* CXFA_FMParse::ParseRelationalExpression() { | 333 CXFA_FMSimpleExpression* CXFA_FMParse::ParseRelationalExpression() { |
| 334 FX_DWORD line = m_pToken->m_uLinenum; | 334 uint32_t line = m_pToken->m_uLinenum; |
| 335 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseAddtiveExpression()); | 335 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseAddtiveExpression()); |
| 336 for (;;) { | 336 for (;;) { |
| 337 std::unique_ptr<CXFA_FMSimpleExpression> e2; | 337 std::unique_ptr<CXFA_FMSimpleExpression> e2; |
| 338 switch (m_pToken->m_type) { | 338 switch (m_pToken->m_type) { |
| 339 case TOKlt: | 339 case TOKlt: |
| 340 case TOKkslt: | 340 case TOKkslt: |
| 341 NextToken(); | 341 NextToken(); |
| 342 e2.reset(ParseAddtiveExpression()); | 342 e2.reset(ParseAddtiveExpression()); |
| 343 if (m_pErrorInfo->message.IsEmpty()) { | 343 if (m_pErrorInfo->message.IsEmpty()) { |
| 344 e1.reset(new CXFA_FMRelationalExpression(line, TOKlt, e1.release(), | 344 e1.reset(new CXFA_FMRelationalExpression(line, TOKlt, e1.release(), |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 continue; | 382 continue; |
| 383 default: | 383 default: |
| 384 break; | 384 break; |
| 385 } | 385 } |
| 386 break; | 386 break; |
| 387 } | 387 } |
| 388 return e1.release(); | 388 return e1.release(); |
| 389 } | 389 } |
| 390 | 390 |
| 391 CXFA_FMSimpleExpression* CXFA_FMParse::ParseAddtiveExpression() { | 391 CXFA_FMSimpleExpression* CXFA_FMParse::ParseAddtiveExpression() { |
| 392 FX_DWORD line = m_pToken->m_uLinenum; | 392 uint32_t line = m_pToken->m_uLinenum; |
| 393 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseMultiplicativeExpression()); | 393 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseMultiplicativeExpression()); |
| 394 for (;;) { | 394 for (;;) { |
| 395 std::unique_ptr<CXFA_FMSimpleExpression> e2; | 395 std::unique_ptr<CXFA_FMSimpleExpression> e2; |
| 396 switch (m_pToken->m_type) { | 396 switch (m_pToken->m_type) { |
| 397 case TOKplus: | 397 case TOKplus: |
| 398 NextToken(); | 398 NextToken(); |
| 399 e2.reset(ParseMultiplicativeExpression()); | 399 e2.reset(ParseMultiplicativeExpression()); |
| 400 if (m_pErrorInfo->message.IsEmpty()) { | 400 if (m_pErrorInfo->message.IsEmpty()) { |
| 401 e1.reset(new CXFA_FMAdditiveExpression(line, TOKplus, e1.release(), | 401 e1.reset(new CXFA_FMAdditiveExpression(line, TOKplus, e1.release(), |
| 402 e2.release())); | 402 e2.release())); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 416 continue; | 416 continue; |
| 417 default: | 417 default: |
| 418 break; | 418 break; |
| 419 } | 419 } |
| 420 break; | 420 break; |
| 421 } | 421 } |
| 422 return e1.release(); | 422 return e1.release(); |
| 423 } | 423 } |
| 424 | 424 |
| 425 CXFA_FMSimpleExpression* CXFA_FMParse::ParseMultiplicativeExpression() { | 425 CXFA_FMSimpleExpression* CXFA_FMParse::ParseMultiplicativeExpression() { |
| 426 FX_DWORD line = m_pToken->m_uLinenum; | 426 uint32_t line = m_pToken->m_uLinenum; |
| 427 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseUnaryExpression()); | 427 std::unique_ptr<CXFA_FMSimpleExpression> e1(ParseUnaryExpression()); |
| 428 for (;;) { | 428 for (;;) { |
| 429 std::unique_ptr<CXFA_FMSimpleExpression> e2; | 429 std::unique_ptr<CXFA_FMSimpleExpression> e2; |
| 430 switch (m_pToken->m_type) { | 430 switch (m_pToken->m_type) { |
| 431 case TOKmul: | 431 case TOKmul: |
| 432 NextToken(); | 432 NextToken(); |
| 433 e2.reset(ParseUnaryExpression()); | 433 e2.reset(ParseUnaryExpression()); |
| 434 if (m_pErrorInfo->message.IsEmpty()) { | 434 if (m_pErrorInfo->message.IsEmpty()) { |
| 435 e1.reset(new CXFA_FMMultiplicativeExpression( | 435 e1.reset(new CXFA_FMMultiplicativeExpression( |
| 436 line, TOKmul, e1.release(), e2.release())); | 436 line, TOKmul, e1.release(), e2.release())); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 451 default: | 451 default: |
| 452 break; | 452 break; |
| 453 } | 453 } |
| 454 break; | 454 break; |
| 455 } | 455 } |
| 456 return e1.release(); | 456 return e1.release(); |
| 457 } | 457 } |
| 458 | 458 |
| 459 CXFA_FMSimpleExpression* CXFA_FMParse::ParseUnaryExpression() { | 459 CXFA_FMSimpleExpression* CXFA_FMParse::ParseUnaryExpression() { |
| 460 std::unique_ptr<CXFA_FMSimpleExpression> e; | 460 std::unique_ptr<CXFA_FMSimpleExpression> e; |
| 461 FX_DWORD line = m_pToken->m_uLinenum; | 461 uint32_t line = m_pToken->m_uLinenum; |
| 462 switch (m_pToken->m_type) { | 462 switch (m_pToken->m_type) { |
| 463 case TOKplus: | 463 case TOKplus: |
| 464 NextToken(); | 464 NextToken(); |
| 465 e.reset(ParseUnaryExpression()); | 465 e.reset(ParseUnaryExpression()); |
| 466 if (m_pErrorInfo->message.IsEmpty()) { | 466 if (m_pErrorInfo->message.IsEmpty()) { |
| 467 e.reset(new CXFA_FMPosExpression(line, e.release())); | 467 e.reset(new CXFA_FMPosExpression(line, e.release())); |
| 468 } else { | 468 } else { |
| 469 e.reset(); | 469 e.reset(); |
| 470 } | 470 } |
| 471 break; | 471 break; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 489 break; | 489 break; |
| 490 default: | 490 default: |
| 491 e.reset(ParsePrimaryExpression()); | 491 e.reset(ParsePrimaryExpression()); |
| 492 break; | 492 break; |
| 493 } | 493 } |
| 494 return e.release(); | 494 return e.release(); |
| 495 } | 495 } |
| 496 | 496 |
| 497 CXFA_FMSimpleExpression* CXFA_FMParse::ParsePrimaryExpression() { | 497 CXFA_FMSimpleExpression* CXFA_FMParse::ParsePrimaryExpression() { |
| 498 std::unique_ptr<CXFA_FMSimpleExpression> e; | 498 std::unique_ptr<CXFA_FMSimpleExpression> e; |
| 499 FX_DWORD line = m_pToken->m_uLinenum; | 499 uint32_t line = m_pToken->m_uLinenum; |
| 500 switch (m_pToken->m_type) { | 500 switch (m_pToken->m_type) { |
| 501 case TOKnumber: | 501 case TOKnumber: |
| 502 e.reset(new CXFA_FMNumberExpression(line, m_pToken->m_wstring)); | 502 e.reset(new CXFA_FMNumberExpression(line, m_pToken->m_wstring)); |
| 503 NextToken(); | 503 NextToken(); |
| 504 break; | 504 break; |
| 505 case TOKstring: | 505 case TOKstring: |
| 506 e.reset(new CXFA_FMStringExpression(line, m_pToken->m_wstring)); | 506 e.reset(new CXFA_FMStringExpression(line, m_pToken->m_wstring)); |
| 507 NextToken(); | 507 NextToken(); |
| 508 break; | 508 break; |
| 509 case TOKidentifier: { | 509 case TOKidentifier: { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 539 break; | 539 break; |
| 540 } | 540 } |
| 541 e.reset(ParsePostExpression(e.release())); | 541 e.reset(ParsePostExpression(e.release())); |
| 542 if (!(m_pErrorInfo->message.IsEmpty())) | 542 if (!(m_pErrorInfo->message.IsEmpty())) |
| 543 e.reset(); | 543 e.reset(); |
| 544 return e.release(); | 544 return e.release(); |
| 545 } | 545 } |
| 546 | 546 |
| 547 CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( | 547 CXFA_FMSimpleExpression* CXFA_FMParse::ParsePostExpression( |
| 548 CXFA_FMSimpleExpression* e) { | 548 CXFA_FMSimpleExpression* e) { |
| 549 FX_DWORD 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_PtrArray> pArray; | 554 std::unique_ptr<CFX_PtrArray> pArray; |
| 555 if (m_pToken->m_type != TOKrparen) { | 555 if (m_pToken->m_type != TOKrparen) { |
| 556 pArray.reset(new CFX_PtrArray()); | 556 pArray.reset(new CFX_PtrArray()); |
| 557 while (m_pToken->m_type != TOKrparen) { | 557 while (m_pToken->m_type != TOKrparen) { |
| 558 CXFA_FMSimpleExpression* e = ParseSimpleExpression(); | 558 CXFA_FMSimpleExpression* e = ParseSimpleExpression(); |
| 559 if (e) { | 559 if (e) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 delete static_cast<CXFA_FMSimpleExpression*>(pArray->GetAt(i)); | 592 delete static_cast<CXFA_FMSimpleExpression*>(pArray->GetAt(i)); |
| 593 } | 593 } |
| 594 delete e; | 594 delete e; |
| 595 e = nullptr; | 595 e = nullptr; |
| 596 } | 596 } |
| 597 } break; | 597 } break; |
| 598 case TOKdot: | 598 case TOKdot: |
| 599 NextToken(); | 599 NextToken(); |
| 600 if (m_pToken->m_type == TOKidentifier) { | 600 if (m_pToken->m_type == TOKidentifier) { |
| 601 CFX_WideStringC tempStr = m_pToken->m_wstring; | 601 CFX_WideStringC tempStr = m_pToken->m_wstring; |
| 602 FX_DWORD tempLine = m_pToken->m_uLinenum; | 602 uint32_t tempLine = m_pToken->m_uLinenum; |
| 603 NextToken(); | 603 NextToken(); |
| 604 if (m_pToken->m_type == TOKlparen) { | 604 if (m_pToken->m_type == TOKlparen) { |
| 605 CXFA_FMSimpleExpression* pExpAccessor; | 605 CXFA_FMSimpleExpression* pExpAccessor; |
| 606 CXFA_FMSimpleExpression* pExpCall; | 606 CXFA_FMSimpleExpression* pExpCall; |
| 607 pExpAccessor = e; | 607 pExpAccessor = e; |
| 608 NextToken(); | 608 NextToken(); |
| 609 std::unique_ptr<CFX_PtrArray> pArray; | 609 std::unique_ptr<CFX_PtrArray> pArray; |
| 610 if (m_pToken->m_type != TOKrparen) { | 610 if (m_pToken->m_type != TOKrparen) { |
| 611 pArray.reset(new CFX_PtrArray()); | 611 pArray.reset(new CFX_PtrArray()); |
| 612 while (m_pToken->m_type != TOKrparen) { | 612 while (m_pToken->m_type != TOKrparen) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 CFX_WideString ws_TempString = m_pToken->m_wstring; | 671 CFX_WideString ws_TempString = m_pToken->m_wstring; |
| 672 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, | 672 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, |
| 673 ws_TempString.c_str()); | 673 ws_TempString.c_str()); |
| 674 return e; | 674 return e; |
| 675 } | 675 } |
| 676 break; | 676 break; |
| 677 case TOKdotdot: | 677 case TOKdotdot: |
| 678 NextToken(); | 678 NextToken(); |
| 679 if (m_pToken->m_type == TOKidentifier) { | 679 if (m_pToken->m_type == TOKidentifier) { |
| 680 CFX_WideStringC tempStr = m_pToken->m_wstring; | 680 CFX_WideStringC tempStr = m_pToken->m_wstring; |
| 681 FX_DWORD tempLine = m_pToken->m_uLinenum; | 681 uint32_t tempLine = m_pToken->m_uLinenum; |
| 682 NextToken(); | 682 NextToken(); |
| 683 if (m_pToken->m_type == TOKlbracket) { | 683 if (m_pToken->m_type == TOKlbracket) { |
| 684 std::unique_ptr<CXFA_FMSimpleExpression> s(ParseIndexExpression()); | 684 std::unique_ptr<CXFA_FMSimpleExpression> s(ParseIndexExpression()); |
| 685 if (!(m_pErrorInfo->message.IsEmpty())) { | 685 if (!(m_pErrorInfo->message.IsEmpty())) { |
| 686 delete e; | 686 delete e; |
| 687 return nullptr; | 687 return nullptr; |
| 688 } | 688 } |
| 689 e = new CXFA_FMDotDotAccessorExpression(tempLine, e, TOKdotdot, | 689 e = new CXFA_FMDotDotAccessorExpression(tempLine, e, TOKdotdot, |
| 690 tempStr, s.release()); | 690 tempStr, s.release()); |
| 691 } else { | 691 } else { |
| 692 CXFA_FMSimpleExpression* s = new CXFA_FMIndexExpression( | 692 CXFA_FMSimpleExpression* s = new CXFA_FMIndexExpression( |
| 693 tempLine, ACCESSOR_NO_INDEX, NULL, FALSE); | 693 tempLine, ACCESSOR_NO_INDEX, NULL, FALSE); |
| 694 e = new CXFA_FMDotDotAccessorExpression(line, e, TOKdotdot, tempStr, | 694 e = new CXFA_FMDotDotAccessorExpression(line, e, TOKdotdot, tempStr, |
| 695 s); | 695 s); |
| 696 continue; | 696 continue; |
| 697 } | 697 } |
| 698 } else { | 698 } else { |
| 699 CFX_WideString ws_TempString = m_pToken->m_wstring; | 699 CFX_WideString ws_TempString = m_pToken->m_wstring; |
| 700 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, | 700 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_IDENTIFIER, |
| 701 ws_TempString.c_str()); | 701 ws_TempString.c_str()); |
| 702 return e; | 702 return e; |
| 703 } | 703 } |
| 704 break; | 704 break; |
| 705 case TOKdotscream: | 705 case TOKdotscream: |
| 706 NextToken(); | 706 NextToken(); |
| 707 if (m_pToken->m_type == TOKidentifier) { | 707 if (m_pToken->m_type == TOKidentifier) { |
| 708 CFX_WideStringC tempStr = m_pToken->m_wstring; | 708 CFX_WideStringC tempStr = m_pToken->m_wstring; |
| 709 FX_DWORD tempLine = m_pToken->m_uLinenum; | 709 uint32_t tempLine = m_pToken->m_uLinenum; |
| 710 NextToken(); | 710 NextToken(); |
| 711 if (m_pToken->m_type == TOKlbracket) { | 711 if (m_pToken->m_type == TOKlbracket) { |
| 712 std::unique_ptr<CXFA_FMSimpleExpression> s(ParseIndexExpression()); | 712 std::unique_ptr<CXFA_FMSimpleExpression> s(ParseIndexExpression()); |
| 713 if (!(m_pErrorInfo->message.IsEmpty())) { | 713 if (!(m_pErrorInfo->message.IsEmpty())) { |
| 714 delete e; | 714 delete e; |
| 715 return nullptr; | 715 return nullptr; |
| 716 } | 716 } |
| 717 e = new CXFA_FMDotAccessorExpression(tempLine, e, TOKdotscream, | 717 e = new CXFA_FMDotAccessorExpression(tempLine, e, TOKdotscream, |
| 718 tempStr, s.release()); | 718 tempStr, s.release()); |
| 719 } else { | 719 } else { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 739 default: | 739 default: |
| 740 return e; | 740 return e; |
| 741 } | 741 } |
| 742 NextToken(); | 742 NextToken(); |
| 743 } | 743 } |
| 744 return e; | 744 return e; |
| 745 } | 745 } |
| 746 | 746 |
| 747 CXFA_FMSimpleExpression* CXFA_FMParse::ParseIndexExpression() { | 747 CXFA_FMSimpleExpression* CXFA_FMParse::ParseIndexExpression() { |
| 748 std::unique_ptr<CXFA_FMSimpleExpression> pExp; | 748 std::unique_ptr<CXFA_FMSimpleExpression> pExp; |
| 749 FX_DWORD line = m_pToken->m_uLinenum; | 749 uint32_t line = m_pToken->m_uLinenum; |
| 750 NextToken(); | 750 NextToken(); |
| 751 std::unique_ptr<CXFA_FMSimpleExpression> s; | 751 std::unique_ptr<CXFA_FMSimpleExpression> s; |
| 752 XFA_FM_AccessorIndex accessorIndex = ACCESSOR_NO_RELATIVEINDEX; | 752 XFA_FM_AccessorIndex accessorIndex = ACCESSOR_NO_RELATIVEINDEX; |
| 753 if (m_pToken->m_type == TOKmul) { | 753 if (m_pToken->m_type == TOKmul) { |
| 754 pExp.reset( | 754 pExp.reset( |
| 755 new CXFA_FMIndexExpression(line, accessorIndex, s.release(), TRUE)); | 755 new CXFA_FMIndexExpression(line, accessorIndex, s.release(), TRUE)); |
| 756 NextToken(); | 756 NextToken(); |
| 757 if (m_pToken->m_type != TOKrbracket) { | 757 if (m_pToken->m_type != TOKrbracket) { |
| 758 CFX_WideString ws_TempString = m_pToken->m_wstring; | 758 CFX_WideString ws_TempString = m_pToken->m_wstring; |
| 759 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, | 759 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 783 | 783 |
| 784 CXFA_FMSimpleExpression* CXFA_FMParse::ParseParenExpression() { | 784 CXFA_FMSimpleExpression* CXFA_FMParse::ParseParenExpression() { |
| 785 Check(TOKlparen); | 785 Check(TOKlparen); |
| 786 | 786 |
| 787 if (m_pToken->m_type == TOKrparen) { | 787 if (m_pToken->m_type == TOKrparen) { |
| 788 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_NON_EMPTY_EXPRESSION); | 788 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_NON_EMPTY_EXPRESSION); |
| 789 NextToken(); | 789 NextToken(); |
| 790 return nullptr; | 790 return nullptr; |
| 791 } | 791 } |
| 792 | 792 |
| 793 FX_DWORD line = m_pToken->m_uLinenum; | 793 uint32_t line = m_pToken->m_uLinenum; |
| 794 std::unique_ptr<CXFA_FMSimpleExpression> pExp1(ParseLogicalOrExpression()); | 794 std::unique_ptr<CXFA_FMSimpleExpression> pExp1(ParseLogicalOrExpression()); |
| 795 | 795 |
| 796 while (m_pToken->m_type == TOKassign) { | 796 while (m_pToken->m_type == TOKassign) { |
| 797 NextToken(); | 797 NextToken(); |
| 798 std::unique_ptr<CXFA_FMSimpleExpression> pExp2(ParseLogicalOrExpression()); | 798 std::unique_ptr<CXFA_FMSimpleExpression> pExp2(ParseLogicalOrExpression()); |
| 799 if (m_pErrorInfo->message.IsEmpty()) { | 799 if (m_pErrorInfo->message.IsEmpty()) { |
| 800 pExp1.reset(new CXFA_FMAssignExpression(line, TOKassign, pExp1.release(), | 800 pExp1.reset(new CXFA_FMAssignExpression(line, TOKassign, pExp1.release(), |
| 801 pExp2.release())); | 801 pExp2.release())); |
| 802 } else { | 802 } else { |
| 803 pExp1.reset(); | 803 pExp1.reset(); |
| 804 } | 804 } |
| 805 } | 805 } |
| 806 Check(TOKrparen); | 806 Check(TOKrparen); |
| 807 return pExp1.release(); | 807 return pExp1.release(); |
| 808 } | 808 } |
| 809 | 809 |
| 810 CXFA_FMExpression* CXFA_FMParse::ParseBlockExpression() { | 810 CXFA_FMExpression* CXFA_FMParse::ParseBlockExpression() { |
| 811 FX_DWORD line = m_pToken->m_uLinenum; | 811 uint32_t line = m_pToken->m_uLinenum; |
| 812 CXFA_FMExpression* e = nullptr; | 812 CXFA_FMExpression* e = nullptr; |
| 813 std::unique_ptr<CFX_PtrArray> expression(new CFX_PtrArray()); | 813 std::unique_ptr<CFX_PtrArray> expression(new CFX_PtrArray()); |
| 814 while (1) { | 814 while (1) { |
| 815 switch (m_pToken->m_type) { | 815 switch (m_pToken->m_type) { |
| 816 case TOKeof: | 816 case TOKeof: |
| 817 case TOKendif: | 817 case TOKendif: |
| 818 case TOKelseif: | 818 case TOKelseif: |
| 819 case TOKelse: | 819 case TOKelse: |
| 820 case TOKendwhile: | 820 case TOKendwhile: |
| 821 case TOKendfor: | 821 case TOKendfor: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 842 if (m_pErrorInfo->message.IsEmpty()) { | 842 if (m_pErrorInfo->message.IsEmpty()) { |
| 843 pExp.reset(new CXFA_FMBlockExpression(line, expression.release())); | 843 pExp.reset(new CXFA_FMBlockExpression(line, expression.release())); |
| 844 } else { | 844 } else { |
| 845 for (int i = 0; i < expression->GetSize(); ++i) | 845 for (int i = 0; i < expression->GetSize(); ++i) |
| 846 delete static_cast<CXFA_FMExpression*>(expression->GetAt(i)); | 846 delete static_cast<CXFA_FMExpression*>(expression->GetAt(i)); |
| 847 } | 847 } |
| 848 return pExp.release(); | 848 return pExp.release(); |
| 849 } | 849 } |
| 850 | 850 |
| 851 CXFA_FMExpression* CXFA_FMParse::ParseIfExpression() { | 851 CXFA_FMExpression* CXFA_FMParse::ParseIfExpression() { |
| 852 FX_DWORD line = m_pToken->m_uLinenum; | 852 uint32_t line = m_pToken->m_uLinenum; |
| 853 const FX_WCHAR* pStartPos = m_lexer->SavePos(); | 853 const FX_WCHAR* pStartPos = m_lexer->SavePos(); |
| 854 NextToken(); | 854 NextToken(); |
| 855 Check(TOKlparen); | 855 Check(TOKlparen); |
| 856 std::unique_ptr<CXFA_FMSimpleExpression> pExpression; | 856 std::unique_ptr<CXFA_FMSimpleExpression> pExpression; |
| 857 while (m_pToken->m_type != TOKrparen) { | 857 while (m_pToken->m_type != TOKrparen) { |
| 858 pExpression.reset(ParseSimpleExpression()); | 858 pExpression.reset(ParseSimpleExpression()); |
| 859 if (m_pToken->m_type != TOKcomma) | 859 if (m_pToken->m_type != TOKcomma) |
| 860 break; | 860 break; |
| 861 NextToken(); | 861 NextToken(); |
| 862 } | 862 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 std::unique_ptr<CXFA_FMIfExpression> pExp; | 899 std::unique_ptr<CXFA_FMIfExpression> pExp; |
| 900 if (m_pErrorInfo->message.IsEmpty()) { | 900 if (m_pErrorInfo->message.IsEmpty()) { |
| 901 pExp.reset(new CXFA_FMIfExpression(line, pExpression.release(), | 901 pExp.reset(new CXFA_FMIfExpression(line, pExpression.release(), |
| 902 pIfExpression.release(), | 902 pIfExpression.release(), |
| 903 pElseExpression.release())); | 903 pElseExpression.release())); |
| 904 } | 904 } |
| 905 return pExp.release(); | 905 return pExp.release(); |
| 906 } | 906 } |
| 907 | 907 |
| 908 CXFA_FMExpression* CXFA_FMParse::ParseWhileExpression() { | 908 CXFA_FMExpression* CXFA_FMParse::ParseWhileExpression() { |
| 909 FX_DWORD line = m_pToken->m_uLinenum; | 909 uint32_t line = m_pToken->m_uLinenum; |
| 910 NextToken(); | 910 NextToken(); |
| 911 std::unique_ptr<CXFA_FMSimpleExpression> pCondition(ParseParenExpression()); | 911 std::unique_ptr<CXFA_FMSimpleExpression> pCondition(ParseParenExpression()); |
| 912 Check(TOKdo); | 912 Check(TOKdo); |
| 913 std::unique_ptr<CXFA_FMExpression> pExpression(ParseBlockExpression()); | 913 std::unique_ptr<CXFA_FMExpression> pExpression(ParseBlockExpression()); |
| 914 Check(TOKendwhile); | 914 Check(TOKendwhile); |
| 915 std::unique_ptr<CXFA_FMExpression> e; | 915 std::unique_ptr<CXFA_FMExpression> e; |
| 916 if (m_pErrorInfo->message.IsEmpty()) { | 916 if (m_pErrorInfo->message.IsEmpty()) { |
| 917 e.reset(new CXFA_FMWhileExpression(line, pCondition.release(), | 917 e.reset(new CXFA_FMWhileExpression(line, pCondition.release(), |
| 918 pExpression.release())); | 918 pExpression.release())); |
| 919 } | 919 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 931 Error(m_pToken->m_uLinenum, FMERR_UNEXPECTED_EXPRESSION, | 931 Error(m_pToken->m_uLinenum, FMERR_UNEXPECTED_EXPRESSION, |
| 932 ws_TempString.c_str()); | 932 ws_TempString.c_str()); |
| 933 NextToken(); | 933 NextToken(); |
| 934 break; | 934 break; |
| 935 } | 935 } |
| 936 return e.release(); | 936 return e.release(); |
| 937 } | 937 } |
| 938 | 938 |
| 939 CXFA_FMExpression* CXFA_FMParse::ParseForExpression() { | 939 CXFA_FMExpression* CXFA_FMParse::ParseForExpression() { |
| 940 CFX_WideStringC wsVariant; | 940 CFX_WideStringC wsVariant; |
| 941 FX_DWORD line = m_pToken->m_uLinenum; | 941 uint32_t line = m_pToken->m_uLinenum; |
| 942 NextToken(); | 942 NextToken(); |
| 943 if (m_pToken->m_type != TOKidentifier) { | 943 if (m_pToken->m_type != TOKidentifier) { |
| 944 CFX_WideString ws_TempString = m_pToken->m_wstring; | 944 CFX_WideString ws_TempString = m_pToken->m_wstring; |
| 945 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, | 945 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, |
| 946 XFA_FM_KeywordToString(m_pToken->m_type), ws_TempString.c_str()); | 946 XFA_FM_KeywordToString(m_pToken->m_type), ws_TempString.c_str()); |
| 947 } | 947 } |
| 948 wsVariant = m_pToken->m_wstring; | 948 wsVariant = m_pToken->m_wstring; |
| 949 NextToken(); | 949 NextToken(); |
| 950 std::unique_ptr<CXFA_FMSimpleExpression> pAssignment; | 950 std::unique_ptr<CXFA_FMSimpleExpression> pAssignment; |
| 951 if (m_pToken->m_type == TOKassign) { | 951 if (m_pToken->m_type == TOKassign) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 pStep.release(), pList.release())); | 983 pStep.release(), pList.release())); |
| 984 } | 984 } |
| 985 return e.release(); | 985 return e.release(); |
| 986 } | 986 } |
| 987 | 987 |
| 988 CXFA_FMExpression* CXFA_FMParse::ParseForeachExpression() { | 988 CXFA_FMExpression* CXFA_FMParse::ParseForeachExpression() { |
| 989 std::unique_ptr<CXFA_FMExpression> e; | 989 std::unique_ptr<CXFA_FMExpression> e; |
| 990 CFX_WideStringC wsIdentifier; | 990 CFX_WideStringC wsIdentifier; |
| 991 std::unique_ptr<CFX_PtrArray> pAccessors; | 991 std::unique_ptr<CFX_PtrArray> pAccessors; |
| 992 std::unique_ptr<CXFA_FMExpression> pList; | 992 std::unique_ptr<CXFA_FMExpression> pList; |
| 993 FX_DWORD line = m_pToken->m_uLinenum; | 993 uint32_t line = m_pToken->m_uLinenum; |
| 994 NextToken(); | 994 NextToken(); |
| 995 if (m_pToken->m_type != TOKidentifier) { | 995 if (m_pToken->m_type != TOKidentifier) { |
| 996 CFX_WideString ws_TempString = m_pToken->m_wstring; | 996 CFX_WideString ws_TempString = m_pToken->m_wstring; |
| 997 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, | 997 Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, |
| 998 XFA_FM_KeywordToString(m_pToken->m_type), ws_TempString.c_str()); | 998 XFA_FM_KeywordToString(m_pToken->m_type), ws_TempString.c_str()); |
| 999 } | 999 } |
| 1000 wsIdentifier = m_pToken->m_wstring; | 1000 wsIdentifier = m_pToken->m_wstring; |
| 1001 NextToken(); | 1001 NextToken(); |
| 1002 Check(TOKin); | 1002 Check(TOKin); |
| 1003 Check(TOKlparen); | 1003 Check(TOKlparen); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1031 if (pAccessors) { | 1031 if (pAccessors) { |
| 1032 for (int i = 0; i < pAccessors->GetSize(); ++i) | 1032 for (int i = 0; i < pAccessors->GetSize(); ++i) |
| 1033 delete static_cast<CXFA_FMSimpleExpression*>(pAccessors->GetAt(i)); | 1033 delete static_cast<CXFA_FMSimpleExpression*>(pAccessors->GetAt(i)); |
| 1034 } | 1034 } |
| 1035 } | 1035 } |
| 1036 return e.release(); | 1036 return e.release(); |
| 1037 } | 1037 } |
| 1038 | 1038 |
| 1039 CXFA_FMExpression* CXFA_FMParse::ParseDoExpression() { | 1039 CXFA_FMExpression* CXFA_FMParse::ParseDoExpression() { |
| 1040 std::unique_ptr<CXFA_FMExpression> e; | 1040 std::unique_ptr<CXFA_FMExpression> e; |
| 1041 FX_DWORD line = m_pToken->m_uLinenum; | 1041 uint32_t line = m_pToken->m_uLinenum; |
| 1042 NextToken(); | 1042 NextToken(); |
| 1043 e.reset(ParseBlockExpression()); | 1043 e.reset(ParseBlockExpression()); |
| 1044 Check(TOKend); | 1044 Check(TOKend); |
| 1045 if (m_pErrorInfo->message.IsEmpty()) { | 1045 if (m_pErrorInfo->message.IsEmpty()) { |
| 1046 e.reset(new CXFA_FMDoExpression(line, e.release())); | 1046 e.reset(new CXFA_FMDoExpression(line, e.release())); |
| 1047 } else { | 1047 } else { |
| 1048 e.reset(); | 1048 e.reset(); |
| 1049 } | 1049 } |
| 1050 return e.release(); | 1050 return e.release(); |
| 1051 } | 1051 } |
| OLD | NEW |