diff options
Diffstat (limited to 'xfa/src/fxfa')
-rw-r--r-- | xfa/src/fxfa/src/fm2js/xfa_lexer.cpp | 10 | ||||
-rw-r--r-- | xfa/src/fxfa/src/fm2js/xfa_lexer.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp b/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp index 957c21b874..2902f8c70b 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp +++ b/xfa/src/fxfa/src/fm2js/xfa_lexer.cpp @@ -83,7 +83,7 @@ inline FX_BOOL XFA_FMDChar::isUnicodeAlpha(uint16_t ch) { return TRUE; } -XFA_FMKeyword keyWords[] = { +const XFA_FMKeyword keyWords[] = { {TOKand, 0x00000026, L"&"}, {TOKlparen, 0x00000028, L"("}, {TOKrparen, 0x00000029, L")"}, @@ -145,13 +145,15 @@ XFA_FMKeyword keyWords[] = { {TOKendif, 0xe0e8fee6, L"endif"}, }; -const FX_WORD KEYWORD_START = TOKdo; -const FX_WORD KEYWORD_END = TOKendif; +const XFA_FM_TOKEN KEYWORD_START = TOKdo; +const XFA_FM_TOKEN KEYWORD_END = TOKendif; } // namespace const FX_WCHAR* XFA_FM_KeywordToString(XFA_FM_TOKEN op) { - return keyWords[op].m_keword; + if (op < KEYWORD_START || op > KEYWORD_END) + return L""; + return keyWords[op].m_keyword; } CXFA_FMToken::CXFA_FMToken() : m_type(TOKreserver), m_uLinenum(1) {} diff --git a/xfa/src/fxfa/src/fm2js/xfa_lexer.h b/xfa/src/fxfa/src/fm2js/xfa_lexer.h index 5db3b093cd..ccfa9f546e 100644 --- a/xfa/src/fxfa/src/fm2js/xfa_lexer.h +++ b/xfa/src/fxfa/src/fm2js/xfa_lexer.h @@ -83,7 +83,7 @@ enum XFA_FM_TOKEN { struct XFA_FMKeyword { XFA_FM_TOKEN m_type; uint32_t m_uHash; - const FX_WCHAR* m_keword; + const FX_WCHAR* m_keyword; }; const FX_WCHAR* XFA_FM_KeywordToString(XFA_FM_TOKEN op); |