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