1 // Scintilla source code edit control
2 /** @file LexerNoExceptions.cxx
3 ** A simple lexer with no state which does not throw exceptions so can be used in an external lexer.
5 // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
12 #include "Scintilla.h"
15 #include "PropSetSimple.h"
17 #include "LexAccessor.h"
19 #include "LexerModule.h"
20 #include "LexerBase.h"
21 #include "LexerNoExceptions.h"
23 using namespace Scintilla
;
25 Sci_Position SCI_METHOD
LexerNoExceptions::PropertySet(const char *key
, const char *val
) {
27 return LexerBase::PropertySet(key
, val
);
29 // Should not throw into caller as may be compiled with different compiler or options
34 Sci_Position SCI_METHOD
LexerNoExceptions::WordListSet(int n
, const char *wl
) {
36 return LexerBase::WordListSet(n
, wl
);
38 // Should not throw into caller as may be compiled with different compiler or options
43 void SCI_METHOD
LexerNoExceptions::Lex(Sci_PositionU startPos
, Sci_Position lengthDoc
, int initStyle
, IDocument
*pAccess
) {
45 Accessor
astyler(pAccess
, &props
);
46 Lexer(startPos
, lengthDoc
, initStyle
, pAccess
, astyler
);
49 // Should not throw into caller as may be compiled with different compiler or options
50 pAccess
->SetErrorStatus(SC_STATUS_FAILURE
);
53 void SCI_METHOD
LexerNoExceptions::Fold(Sci_PositionU startPos
, Sci_Position lengthDoc
, int initStyle
, IDocument
*pAccess
) {
55 Accessor
astyler(pAccess
, &props
);
56 Folder(startPos
, lengthDoc
, initStyle
, pAccess
, astyler
);
59 // Should not throw into caller as may be compiled with different compiler or options
60 pAccess
->SetErrorStatus(SC_STATUS_FAILURE
);