1 // Scintilla source code edit control 2 /** @file LexNull.cxx 3 ** Lexer for no language. Used for plain text and unrecognized files. 4 **/ 5 // Copyright 1998-2001 by Neil Hodgson <[email protected]> 6 // The License.txt file describes the conditions under which this software may be distributed. 7 8 #include <stdlib.h> 9 #include <string.h> 10 #include <stdio.h> 11 #include <stdarg.h> 12 #include <assert.h> 13 #include <ctype.h> 14 15 #include "ILexer.h" 16 #include "Scintilla.h" 17 #include "SciLexer.h" 18 19 #include "WordList.h" 20 #include "LexAccessor.h" 21 #include "Accessor.h" 22 #include "StyleContext.h" 23 #include "CharacterSet.h" 24 #include "LexerModule.h" 25 26 using namespace Scintilla; 27 28 static void ColouriseNullDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], 29 Accessor &styler) { 30 // Null language means all style bytes are 0 so just mark the end - no need to fill in. 31 if (length > 0) { 32 styler.StartAt(startPos + length - 1); 33 styler.StartSegment(startPos + length - 1); 34 styler.ColourTo(startPos + length - 1, 0); 35 } 36 } 37 38 LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null"); 39