aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/lexers
AgeCommit message (Collapse)AuthorFilesLines
2017-11-16CPP lexer: support *.ino files (Arduino IDE sketches)Robin Haberkorn1-1/+2
* a proper Arduino lexer supporting the special Arduino keywords/classes could in principle be written, but for the time being they're treated just like regular C++ sources
2016-11-22womanpage lexer: fixed popup stylingRobin Haberkorn1-1/+1
* the ESSTYLECLEARALL$$ was resetting the STYLE_CALLTIP (and others) resulting in wrongly-styled popups. * We now only change STYLE_DEFAULT for Gtk UIs and use `color.init` to reinitialize the other styles (not very elegant).
2016-11-18implemented self-documenting (online) help systemRobin Haberkorn1-0/+20
* the new "?" (help) command can be used to look up help topics. * help topics are index from $SCITECOPATH/women/*.woman.tec files. * looking up a help topic opens the corresponding "womanpage" and jumps to the position of the topic (it acts like an anchor into the document). * styling is performed by *.woman.tec files. * Setting up the Scintilla view and munging the *.tec file is performed by the new "woman.tes" lexer. On supporting UIs (Gtk), womanpages are shown in a variable-width font. * Woman pages are usually not hand-written, but generated from manpages. A special Groff post-processor grosciteco has been introduced for this purpose. It is much like grotty, but can output SciTECO macros for styling the document (ie. the *.woman.tec files). It is documented in its own man-page. * grosciteco also introduces sciteco.tmac - special Troff macros for controlling the formatting of the document in SciTECO. It also defines .SCITECO_TOPIC which can be used to mark up help topics/terms in Troff markup. * Woman pages are generated/formatted by grosciteco at compile-time, so they will work on platforms without Groff (ie. as on windows). * Groff has been added as a hard compile-time requirement. * The sciteco(1) and sciteco(7) man pages have been augmented with help topic anchors.
2016-02-19fixed Objective C++ lexing: it is now handled by cpp.tesRobin Haberkorn2-11/+14
* the *.mm extension is for Objective C++. Therefore cpp.tes should be responsible. * Objective C keywords have been added to lexer.c.basekeywords. It does not hurt adding them to all C descendants.
2016-02-17added lexing support for Gob2 (GObject Builder)Robin Haberkorn1-0/+36
* this assumes that Gob2 produces plain-C output (no C++ keywords are added) and all Gob keywords are real keywords - even though they might be used in function bodies or %{ %} enclosed blocks.
2016-02-17The "cpp" lexer configuration has been split into "c.tes" and "cpp.tes"Robin Haberkorn2-23/+63
* The keyword list is too different in C when compared to C++. The many additional keywords are annoying when editing plain C files. * Underscored C99 and C11 keywords (like _Bool) have been added to the "c.tes" lexer configuration. The C++ language does not contain these keywords. However, C has stdbool.h to define bool which is part of standard C++. * Therefore a macro "lexer.c.basekeywords" has been defined for all languages __directly__ derived (more or less supersets) of C. It contains most of the C99/C11 standard header shortcuts. * Objective C lexing is set up by c.tes since Objective C is a relatively strict superset of C. All Objective C keywords are handled by c.tes. Since they begin with "@", this should not cause problems when editing plain C files.
2016-02-17simplified "lexer.test..." macros using the $$ return commandRobin Haberkorn42-186/+186
* this is slightly more efficient than using repeated conditionals * the last :EN does not require a conditional, as its return value can simply be forwarded. * even without $$, this could have been done easier using a once-only loop and breaking out of the loop if :EN fails using :;. The last :EN result is still stored in QReg "_". * :EN could also be used to match header lines if lexer.tes would leave the first line (header line) in some Q-Reg, like the local .[header]. However, repeated :ENs would be necessary as globbing currently does not support {...,...} expansions. Since sooner or later, the header line must be evaluated for some lexer.set macro, this is probably more efficient than the current solution using SciTECO patterns and [lexer.checkheader] could be removed as well.
2016-02-15lexer library: avoid unnecessary argument discards after SETLEXERLANGUAGERobin Haberkorn69-69/+69
* causes problems with the $$ command implemented * was already fixed in scite2co.lua but the existing code was manually updated and generated with an earlier version of scite2co.lua
2015-07-21fixed scite2co.lua: use SCI_SETLEXERLANGUAGE instead of SCI_SETLEXERRobin Haberkorn69-69/+69
* the lexer names used in SciTE property files are not SCLEX constants but the internal LexerModule names, so auto-generated SciTECO lexer configurations can only be set by name, i.e. via SETLEXERLANGUAGE, since we cannot easily map those names to SCLEX constants. * should be about as fast as using SCI_SETLEXER (since SciTECO has to look up symbolic names as well at runtime). * this especially fixes opening *.mak files -- often Makefiles but identified as "Mako" files. The macro "lexer.set.mako" used the wrong SCLEX_ symbol. * will also fix the HTML and all other lexers that use the SCLEX_HTML/hypertext lexer. * all lexer files have been updated, to be more compatible with scite2co.lua's output. This eases lexer updates in the future.
2015-05-25extended <EN> command and used it to optimize "lexer.test..." macrosRobin Haberkorn69-218/+308
* EN may now be used for matching file names (similar to fnmatch(3)). This is used to check the current buffers file extension in the lexer configuration macros instead of using expensive Q-Register manipulations. This halves the overall startup time - it is now acceptable even with the current amount of lexer configurations. * EN may now be used for checking file types. session.tes has been simplified. * BREAKS macro portability (EN now has 2 string arguments). * The Globber class has been extended to allow filtering of glob results by file type.
2015-03-24added new lexer configs auto-generated by scite2co.luaRobin Haberkorn62-0/+3123
* these are still not all languages supported by Scintilla. scite2co.lua does not do a good job of generating styles when SciTE's property files use hardcoded colors/fonts. This commit only includes reasonably good conversion results. The remaining languages need some additional manual labor. * Even these lexers are not perfect and should be revised by comparing them with SciTE's properties. * So many lexers make the "lexer.auto" macro too slow. We need some optimization. E.g. the search-command optimization described in TODO, or an extended EN command for globbing manually specified file names.
2015-03-24reformatted existing lexer definitionsRobin Haberkorn7-145/+111
* they are updated with the results of scite2co.lua This makes it easier in the future to update lexer settings based on the property files of new SciTE releases.
2014-11-22added globbing command ENRobin Haberkorn7-28/+0
* implements the same globbing as the EB command already did * uses Globber helper class that behaves more like UNIX glob(). glib only has a glob-style pattern matcher. * The Globber class may be extended later to provide more UNIX-like globbing. * lexer.tes has been updated to make use of globbing. Now, lexers can be automatically loaded and registered at startup. To install a new lexer, it's sufficient to copy a file to the lexers/ directory.
2014-11-20lexer library: added M[lexer.checkheader] and M[lexer.checkname] for ↵Robin Haberkorn7-15/+18
matching a pattern against the first line of a buffer or its filename. This simplifies the "lexer.test..." macros and allows us to select lexers based on the #! line.
2014-11-19added first draft of new modular lexer systemRobin Haberkorn7-0/+270