From bc5640c92aa84839992ef6d316fbe415abd88465 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 3 Apr 2021 08:52:21 +1100 Subject: Update information on lexing removing content superceded by Lexilla. --- doc/ScintillaDoc.html | 58 +++++++++++++++------------------------------------ 1 file changed, 17 insertions(+), 41 deletions(-) (limited to 'doc/ScintillaDoc.html') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 14ae49586..b8484e507 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -119,7 +119,7 @@

Scintilla Documentation

-

Last edited 29 March 2021 NH

+

Last edited 3 April 2021 NH

Scintilla 5 has moved the lexers from Scintilla into a new Lexilla project.
@@ -284,19 +284,13 @@

Lexilla

-

For Scintilla 5.0, lexers will be split off into a separate Lexilla library. - Scintilla will be responsible for the GUI and calling lexers with Lexilla providing the lexers. - To allow work towards this with Scintilla 4.x, the first stage is to allow building Lexilla but - also include the lexers in Scintilla.

+

For Scintilla 5.0, lexers have been split off into a separate Lexilla library. + Scintilla is responsible for the GUI and calling lexers with Lexilla providing the lexers.

Lexilla is built as both a shared library and static library and applications may choose to link to one or the other.

-

To build Lexilla, in the lexilla/src directory, run make (for gcc or clang)
- make
- or nmake for MSVC
- nmake -f lexilla.mak
-

+

See the Lexilla documentation for instructions on building and using Lexilla.

Lexilla follows the external lexer protocol so can be loaded by applications that support this. As the protocol only supports object lexers, an additional function CreateLexer(const char *name) @@ -304,21 +298,11 @@

Lexer libraries that provide the same functions as Lexilla may provide lexers for use by Scintilla, - augmenting or replacing those provided by Lexilla. - To allow initialisation of lexer libraries, a SetLibraryProperty(const char *key, const char *value) - may optionally be implemented. For example, a lexer library that uses XML based lexer definitions may - be provided with a directory to search for such definitions. - Lexer libraries should ignore any properties that they do not understand. - The set of properties supported by a lexer library is specified as a '\n' separated list of property names by - an optional const char *GetLibraryPropertyNames() function. -

+ augmenting or replacing those provided by Lexilla.

A lexer created by Lexilla may be used in Scintilla by calling SCI_SETILEXER.

-

Lexilla and its contained lexers can be tested with the TestLexers program in lexilla/test. - Read lexilla/test/README for information on building and using TestLexers.

-

Contents

@@ -7211,19 +7195,13 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){

Lexer

-

If you define the symbol SCI_LEXER when building Scintilla, (this is sometimes - called the SciLexer version of Scintilla), lexing support for a wide range of programming - languages is included and the messages in this section are supported. If you want to set - styling and fold points for an unsupported language you can either do this in the container or - better still, write your own lexer following the pattern of one of the existing ones.

- -

If the symbol SCI_EMPTYCATALOGUE is defined when building - Scintilla, then no lexers are made available but other lexing support code may be present.

+

+ To style files in different languages, different 'lexers' are used. + These are objects that are called by Scintilla with a range of text and some context information and which + then set styles and folding information for that range. + Lexers for Scintilla are now provided by the Lexilla project. + Before 5.0, lexers were built into most versions of Scintilla.

-

Scintilla also supports external lexers. These are DLLs (on Windows), .dylib modules (on macOS), - or .so modules (on GTK/Linux) that export three - functions: GetLexerCount, GetLexerName, and - GetLexerFactory. See ExternalLexer.cxx for more information.

SCI_GETLEXER → int
SCI_GETLEXERLANGUAGE(<unused>, char *language) → int
SCI_SETILEXER(<unused>, pointer ilexer)
@@ -7440,7 +7418,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){

Lexer Objects

-

Lexers are programmed as objects that implement the ILexer4 interface and that interact +

Lexers are programmed as objects that implement the ILexer5 interface and that interact with the document they are lexing through the IDocument interface. Previously lexers were defined by providing lexing and folding functions but creating an object to handle the interaction of a lexer with a document allows the lexer to store state information that @@ -7515,7 +7493,9 @@ optimisation could be to remember where a setting first affects the document and

Version returns an enumerated value specifying which version of the interface is implemented: -lvRelease4 for ILexer4. Prior to Scintilla 4.0 different values were possible.

+lvRelease5 for ILexer5 and lvRelease4 for ILexer4. +ILexer5 must be provided for Scintilla version 5.0 or later. +

Release is called to destroy the lexer object.

@@ -7613,15 +7593,11 @@ The pWidth argument can be NULL if the caller doe bytes in the character.

-

The ILexer4 and IDocument interfaces may be -expanded in the future with extended versions (ILexer5...). +

The ILexer5 and IDocument interfaces may be +expanded in the future with extended versions (ILexer6...). The Version method indicates which interface is implemented and thus which methods may be called.

-

Scintilla 4 changed the definition of IDocument by merging the previously separate -IDocumentWithLineEnd interface and -removing the mask parameter to StartStyling.

-

Notifications

Notifications are sent (fired) from the Scintilla control to its container when an event has -- cgit v1.2.3