LexNull.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 <neilh@scintilla.org>
  6. // The License.txt file describes the conditions under which this software may be distributed.
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #include <stdio.h>
  10. #include <stdarg.h>
  11. #include <assert.h>
  12. #include <ctype.h>
  13. #include "ILexer.h"
  14. #include "Scintilla.h"
  15. #include "SciLexer.h"
  16. #include "WordList.h"
  17. #include "LexAccessor.h"
  18. #include "Accessor.h"
  19. #include "StyleContext.h"
  20. #include "CharacterSet.h"
  21. #include "LexerModule.h"
  22. #ifdef SCI_NAMESPACE
  23. using namespace Scintilla;
  24. #endif
  25. static void ColouriseNullDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[],
  26. Accessor &styler) {
  27. // Null language means all style bytes are 0 so just mark the end - no need to fill in.
  28. if (length > 0) {
  29. styler.StartAt(startPos + length - 1);
  30. styler.StartSegment(startPos + length - 1);
  31. styler.ColourTo(startPos + length - 1, 0);
  32. }
  33. }
  34. LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null");