notepad-plus-plus/lexilla/lexlib/LexerSimple.cxx
Christian Grasser d8c6350918 Update to scintilla 5.5.1 & Lexilla 5.3.3
Release 5.5.1 ( https://www.scintilla.org/scintilla551.zip )

    Released 22 July 2024.
    SCI_CUTALLOWLINE added which is similar to SCI_COPYALLOWLINE but also deletes the copied text. Feature #1518.
    Can set font used for autocompletion lists with SCI_AUTOCSETSTYLE. Feature #1523.
    Increase maximum zoom set interactively to +60 points. Feature #1517.
    Fix flickering cursor after some mouse action sequences. Bug #2443.

Release 5.3.3 ( https://www.scintilla.org/lexilla533.zip )

    Released 22 July 2024.
    ASP: Control whether ASP is enabled for XML and HTML with lexer.xml.allow.asp and lexer.html.allow.asp. Issue #252.
    JavaScript: Recognize regular expressions at start or after '>' in JavaScript when lexer is cpp, hypertext, or xml. Issue #250, Bug #918.
    JavaScript: Recognize initial #! 'shebang' line as a comment in standalone files. Issue #253.
    Lua: Fix non-ASCII identifiers joined with '.' or ':'. Issue #242.
    Lua: Fix folding for multi-line SCE_LUA_LITERALSTRING and SCE_LUA_COMMENT when performed incrementally. Issue #247.
    PHP: Control whether PHP is enabled for XML and HTML with lexer.xml.allow.php and lexer.html.allow.php. Issue #252.

Close #15466
2024-07-23 13:07:50 +02:00

63 lines
1.7 KiB
C++

// Scintilla source code edit control
/** @file LexerSimple.cxx
** A simple lexer with no state.
**/
// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <cstdlib>
#include <cassert>
#include <string>
#include <string_view>
#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "PropSetSimple.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "LexerModule.h"
#include "LexerBase.h"
#include "LexerSimple.h"
using namespace Lexilla;
LexerSimple::LexerSimple(const LexerModule *module_) :
LexerBase(module_->LexClasses(), module_->NamedStyles()),
lexerModule(module_) {
for (int wl = 0; wl < lexerModule->GetNumWordLists(); wl++) {
if (!wordLists.empty())
wordLists += "\n";
wordLists += lexerModule->GetWordListDescription(wl);
}
}
const char * SCI_METHOD LexerSimple::DescribeWordListSets() {
return wordLists.c_str();
}
void SCI_METHOD LexerSimple::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Scintilla::IDocument *pAccess) {
Accessor astyler(pAccess, &props);
lexerModule->Lex(startPos, lengthDoc, initStyle, keyWordLists, astyler);
astyler.Flush();
}
void SCI_METHOD LexerSimple::Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Scintilla::IDocument *pAccess) {
if (props.GetInt("fold")) {
Accessor astyler(pAccess, &props);
lexerModule->Fold(startPos, lengthDoc, initStyle, keyWordLists, astyler);
astyler.Flush();
}
}
const char * SCI_METHOD LexerSimple::GetName() {
return lexerModule->languageName;
}
int SCI_METHOD LexerSimple::GetIdentifier() {
return lexerModule->GetLanguage();
}