Comments (5)
Namespaces are supposed to be optional - you don't have to specify them if you are willing to receive a lexer with that name from any library. If you specifically want the Lua lexer can't you ask for lexer.$(file.patterns.name)=lpeg.name
?
from lexilla.
Which library is not providing a namespace? Lexilla as installed into SciTE should be using "lexilla" and Scintillua should be using "lpeg".
from lexilla.
My use case is the following: I would use the Lua lexer for a private DSL language and the standard Lexilla lexers for all the other files. I encounter the problem using Sc1. As far as I understand, the problem doesn't occur in SciTE because the lexilla.dll
is probed before the LexLPeg.dll
.
A minimal set of properties to reproduce the problem is the following:
SciTEGlobal.properties
import lexers/lpeg
lexers/lpeg.properties
lexilla.context.lpeg.home=$(SciteDefaultHome)/lexers
lexilla.context.lpeg.color.theme=scite
if PLAT_WIN
lexilla.path=.;$(lexilla.context.lpeg.home)/LexLPeg.dll
if PLAT_GTK
lexilla.path=.;$(lexilla.context.lpeg.home)/liblexlpeg.so
fold.by.indentation=0
fold.line.groups=0
fold.on.zero.sum.lines=0
With these settings, I would expect a file, e.g. a python file, to be styled with the static Lexilla lexer set in the embedded properties, but instead, it is styled with a default lpeg lexer.
I tried to to set the namespace, i.e. lexer.$(file.patterns.py)=lexilla.python
, but is is not recognized. Does the static lexilla library define the namespace?.
from lexilla.
The statically linked lexers are checked after the dynamically loaded lexers and don't have a namespace. You could grab a copy of Lexilla.dll from a full SciTE download and refer to it in lexilla.path.
There could be a second try of the static call inserting "lexilla." before the name.
from lexilla.
This patch implements a static
namespace that refers to statically linked lexers with statements like lexer.*.cpp=static.cpp
. That then requires the static.
name in other properties style.static.cpp.4=$(colour.number)
.
diff --git a/access/LexillaAccess.cxx b/access/LexillaAccess.cxx
index f612ce29..2a4b6450 100644
--- a/access/LexillaAccess.cxx
+++ b/access/LexillaAccess.cxx
@@ -234,6 +234,10 @@ Scintilla::ILexer5 *Lexilla::MakeLexer(std::string_view languageName) {
}
}
}
+ constexpr std::string_view builtin("static.");
+ if (HasPrefix(sLanguageName, builtin) && pCreateLexerDefault) {
+ return pCreateLexerDefault(sLanguageName.substr(builtin.size()).c_str());
+ }
// If no match with namespace, try to just match name
for (const LexLibrary &lexLib : libraries) {
if (lexLib.fnCL) {
The static
namespace is probed after the dynamically loaded lexer's namespaces but before checking for names without namespaces.
from lexilla.
Related Issues (20)
- Request: UML language support
- Inconsistent lexing of '-' at line start by bash lexer HOT 8
- [Bash] two bugs in test operator highlighting HOT 6
- Fold Issue in Verilog mode HOT 17
- LexerVerilog tries to set line state beyond EOF HOT 2
- R escape sequences don't terminate properly HOT 13
- Syntax highlighting for Svelte HOT 1
- [CSS] Nesting and &-selector HOT 4
- Fold issue in verilog with nested MACRO and nested if HOT 3
- nested square brackets, TeX files
- Syntax colour highlighting of HTML with JSON context in JavaScript section HOT 7
- Shell language lexing mistakes bitwise left shift operator for here document HOT 3
- [Bash] Don't nest `${}` parameter expansion on `{` HOT 1
- unreachable code HOT 1
- Feature Request: Folding by indentation in plain text HOT 2
- Update Assembly (Update Syntax Highlighting)
- Batch Syntax "keyword" + ":" => "keyword:" dont work properly HOT 5
- raw formatted string is not handled in Python lexer HOT 5
- prevent negative code folding level in lexer HOT 26
- [Ruby] fix `number.method` highlighting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lexilla.