aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ChangeLog35
-rw-r--r--INSTALL10
-rw-r--r--Makefile.am4
-rw-r--r--NEWS9
-rw-r--r--README26
-rw-r--r--TODO56
-rw-r--r--configure.ac30
m---------contrib/scintilla0
-rw-r--r--contrib/scintilla.am2
-rw-r--r--debian/changelog12
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/sciteco.1.in6
-rw-r--r--doc/sciteco.7.template45
-rw-r--r--freebsd/Makefile70
-rw-r--r--freebsd/distinfo6
-rw-r--r--[-rwxr-xr-x]freebsd/files/xvfb-run.sh (renamed from freebsd/scripts/xvfb-run.sh)0
-rw-r--r--freebsd/pkg-plist4
-rw-r--r--lib/Makefile.am3
-rw-r--r--lib/color.tes16
-rw-r--r--lib/colors/solarized.tes28
-rw-r--r--lib/colors/terminal.tes10
-rw-r--r--lib/lexer.tes8
-rw-r--r--lib/lexers/abaqus.tes2
-rw-r--r--lib/lexers/ada.tes2
-rw-r--r--lib/lexers/asl.tes2
-rw-r--r--lib/lexers/asm.tes2
-rw-r--r--lib/lexers/ave.tes2
-rw-r--r--lib/lexers/avs.tes2
-rw-r--r--lib/lexers/awk.tes2
-rw-r--r--lib/lexers/baan.tes2
-rw-r--r--lib/lexers/bash.tes12
-rw-r--r--lib/lexers/batch.tes8
-rw-r--r--lib/lexers/blitzbasic.tes2
-rw-r--r--lib/lexers/c.tes2
-rw-r--r--lib/lexers/caml.tes2
-rw-r--r--lib/lexers/ch.tes2
-rw-r--r--lib/lexers/cmake.tes6
-rw-r--r--lib/lexers/cobol.tes2
-rw-r--r--lib/lexers/cpp.tes4
-rw-r--r--lib/lexers/cs.tes2
-rw-r--r--lib/lexers/d.tes2
-rw-r--r--lib/lexers/diff.tes8
-rw-r--r--lib/lexers/docbook.tes2
-rw-r--r--lib/lexers/eiffel.tes2
-rw-r--r--lib/lexers/f77.tes2
-rw-r--r--lib/lexers/f95.tes2
-rw-r--r--lib/lexers/flagship.tes2
-rw-r--r--lib/lexers/flash.tes2
-rw-r--r--lib/lexers/freebasic.tes2
-rw-r--r--lib/lexers/gap.tes2
-rw-r--r--lib/lexers/git.tes7
-rw-r--r--lib/lexers/go.tes2
-rw-r--r--lib/lexers/idl.tes2
-rw-r--r--lib/lexers/inno.tes2
-rw-r--r--lib/lexers/java.tes2
-rw-r--r--lib/lexers/js.tes2
-rw-r--r--lib/lexers/kix.tes2
-rw-r--r--lib/lexers/lisp.tes2
-rw-r--r--lib/lexers/lout.tes4
-rw-r--r--lib/lexers/lua.tes2
-rw-r--r--lib/lexers/make.tes2
-rw-r--r--lib/lexers/mako.tes2
-rw-r--r--lib/lexers/matlab.tes2
-rw-r--r--lib/lexers/mmixal.tes2
-rw-r--r--lib/lexers/octave.tes2
-rw-r--r--lib/lexers/oscript.tes2
-rw-r--r--lib/lexers/pascal.tes2
-rw-r--r--lib/lexers/perl.tes2
-rw-r--r--lib/lexers/php.tes2
-rw-r--r--lib/lexers/pike.tes2
-rw-r--r--lib/lexers/pov.tes2
-rw-r--r--lib/lexers/powerpro.tes2
-rw-r--r--lib/lexers/purebasic.tes2
-rw-r--r--lib/lexers/r.tes2
-rw-r--r--lib/lexers/rc.tes2
-rw-r--r--lib/lexers/rebol.tes2
-rw-r--r--lib/lexers/rust.tes2
-rw-r--r--lib/lexers/scheme.tes2
-rw-r--r--lib/lexers/sciteco.tes21
-rw-r--r--lib/lexers/specman.tes2
-rw-r--r--lib/lexers/spice.tes2
-rw-r--r--lib/lexers/swift.tes2
-rw-r--r--lib/lexers/systemverilog.tes2
-rw-r--r--lib/lexers/tacl.tes2
-rw-r--r--lib/lexers/tal.tes2
-rw-r--r--lib/lexers/tcl.tes2
-rw-r--r--lib/lexers/test.tes2
-rw-r--r--lib/lexers/troff.tes8
-rw-r--r--lib/lexers/vala.tes2
-rw-r--r--lib/lexers/vb.tes2
-rw-r--r--lib/lexers/verilog.tes2
-rw-r--r--lib/lexers/vhdl.tes2
-rw-r--r--lib/lexers/vxml.tes2
-rw-r--r--lib/lexers/xml.tes22
-rw-r--r--lib/session.tesbin2624 -> 3066 bytes
-rw-r--r--lib/string.tes12
-rw-r--r--m4/ax_require_defined.m437
-rw-r--r--m4/ax_with_curses.m4582
-rw-r--r--sample.teco_ini64
-rw-r--r--src/Makefile.am1
-rw-r--r--src/core-commands.c25
-rw-r--r--src/doc.c3
-rw-r--r--src/error.h9
-rw-r--r--src/goto-commands.c64
-rw-r--r--src/interface-curses/interface.c30
-rw-r--r--src/interface-gtk/interface.c2
-rw-r--r--src/interface.c8
-rw-r--r--src/interface.h1
-rw-r--r--src/lexer.c250
-rw-r--r--src/lexer.h36
-rw-r--r--src/parser.h13
-rw-r--r--src/qreg-commands.h2
-rw-r--r--src/qreg.c14
-rw-r--r--src/search.c12
-rw-r--r--src/symbols.c108
-rw-r--r--src/view.c66
-rw-r--r--src/view.h2
-rw-r--r--tests/testsuite.at9
118 files changed, 1629 insertions, 327 deletions
diff --git a/ChangeLog b/ChangeLog
index b1f08ed..eb880f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,41 @@ using a prebuilt binary) are included.
Entries marked with "(!)" might break macro portability
compared to the preceding release.
+Version 2.3.0
+~~~~~~~~~~~~~
+
+38d1f4c session.tes now supports the Fossil VCS (session.fossil) for setting up
+ buffer sessions per Fossil repository.
+be23c9d Subversion/SVN support in session.tes (session.svn) now requires at least
+ Subversion v1.9.
+96ce8f0,
+caed2e4 Added AX_WITH_CURSES for more robust ncurses checks.
+ Should fix ./configure on Solaris-derived systems (OmniOS, OpenIndiana, ...).
+(!)ef897b4 Introduced true block and EOL comments:
+ !* block comment *! and !! EOL comment
+ You don't necessarily have to update your scripts since labels can still be
+ used as comments.
+e5d1253 Curses: don't install unnecessary PNG icons
+8aa8c05 Curses: fixed inserting null-byte (^@) by pressing Ctrl+@
+c293f72 Fixed crashes while setting special Q-Registers with EU (string-building characters).
+ E.g. fixes @EU*"" and @EU$"...".
+c174f9b Support external Scintilla lexer libraries and Scintillua in particular.
+ SciTECO does not ship with lexer scripts for Scintillua, though.
+ See https://github.com/rhaberkorn/sciteco/wiki/Integrating-Scintillua
+fb0d60c updated Scintilla to v5.5.4: contains a few optimizations
+715d7e1 sped up opening very large UTF-8 files
+cb1cb61 Fixed the initial dot after opening a file, whose syntax highlighting is
+ determined by a hash-bang line.
+ Has been broken since v2.2.0.
+8c2cac3 fixed ^Y after FK...$: take the deleted text into account
+e2313a7 documented the FK...$^SR idiom
+6cd143f,
+a673abe,
+6dcb454,
+7871c54,
+244a54a implemented Scintilla lexer for SciTECO code, i.e. TECO syntax highlighting
+d654d0a fixed some compiler warnings when building with --disable-debug
+
Version 2.2.0
~~~~~~~~~~~~~
diff --git a/INSTALL b/INSTALL
index d371333..0b497eb 100644
--- a/INSTALL
+++ b/INSTALL
@@ -60,6 +60,16 @@ as follows:
libglib2.0-dev libncurses-dev libgtk-3-dev \
groff doxygen
+The same on Fedora:
+
+ $ sudo dnf install git gcc gcc-c++ make pkg-config autoconf automake libtool \
+ glib2-devel ncurses-devel gtk3-devel groff doxygen
+
+And on FreeBSD:
+
+ $ sudo pkg install git gmake pkgconfig autoconf automake libtool \
+ glib gtk3 groff doxygen
+
Building from Source Tar Ball or Repository
===========================================
diff --git a/Makefile.am b/Makefile.am
index 3375ce8..c9ba183 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,11 +11,13 @@ dist_scitecodata_DATA = sample.teco_ini
EXTRA_DIST = README TODO
+if INTERFACE_GTK
# Only the lower resolution PNG icons are installed as they are
# required by the GTK UI.
-# Other uses are left to the distro package manager.
+# Other icons might be required for OS/distro-specific packaging.
dist_scitecodata_DATA += ico/sciteco-16.png ico/sciteco-32.png \
ico/sciteco-48.png
+endif
EXTRA_DIST += ico/sciteco-256.png ico/sciteco.ico
EXTRA_DIST += win32/loaders.cache
diff --git a/NEWS b/NEWS
index c2b8f29..4a69a86 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
News
====
-Should we have a SciTECO-related chatroom?
-Please [take part in the poll](https://github.com/rhaberkorn/sciteco/discussions/29).
+<span class="nf nf-md-new_box"></span>
+FreeBSD is the first operating system that adds an official [port/package for SciTECO](https://www.freshports.org/editors/sciteco/).
+But you will probably have to wait a few months until you can just `pkg install sciteco-curses`
+if you are following the quarterly branches.
+
+<span class="nf nf-md-new_box"></span>
+Join our new [IRC chatroom](https://web.libera.chat/#sciteco): #sciteco at irc.libera.chat
diff --git a/README b/README
index e955590..696ce5d 100644
--- a/README
+++ b/README
@@ -26,7 +26,8 @@ The Curses frontend is verified to work with [ncurses](https://www.gnu.org/softw
[PDCurses/XCurses](https://github.com/wmcbrine/PDCurses),
[PDCursesMod](https://github.com/Bill-Gray/PDCursesMod) and
[EMCurses](https://github.com/rhaberkorn/emcurses).
-Others might work as well.
+All X/Open-compatible libraries should be supported.
+SVr4 curses without enhanced definitions are **not** supported.
Linux, FreeBSD, [Mac OS X](https://github.com/rhaberkorn/sciteco/wiki/Mac-OS-Support),
Windows (MinGW 32/64) ~~and [Haiku](https://www.haiku-os.org/) (gcc4)~~ are tested and supported.
@@ -100,8 +101,9 @@ Features
across all supported platforms. Gtk+ builds allow further customization using CSS.
The user interface is kept minimalistic and is consistent in spirit across the
different platforms.
-* Syntax highlighting, styles, line numbers, etc. thanks to Scintilla.
+* Syntax highlighting, styles, line numbers, etc. thanks to Scintilla, Lexilla and Scintillua.
Low-level Scintilla commands can also be accessed to extend SciTECO.
+ SciTECO even syntax highlights code, written in the SciTECO language itself.
* A growing standard library of macros with frameworks for color schemes, syntax highlighting
and buffer sessions.
Optimized for hack-ability rather than completeness.
@@ -113,14 +115,15 @@ There are prebuilt binary packages and source bundles for your convenience:
* [Github Releases](https://github.com/rhaberkorn/sciteco/releases)
* [Download Archive at Sourceforge](https://sourceforge.net/projects/sciteco/files/)
+* [FreeBSD port](https://www.freshports.org/editors/sciteco/)
* [Ubuntu PPA](https://launchpad.net/~robin-haberkorn/+archive/sciteco)
* [Arch User Repository](https://aur.archlinux.org/packages/sciteco-git)
-* Users of OpenWrt may try to install the
- [`sciteco` package of this feed](https://github.com/rhaberkorn/nanonote-ports).
-* Yocto/OpenEmbedded users should try the
- [`sciteco` package from this layer](https://github.com/rhaberkorn/meta-rhaberkorn).
* [Chocolatey package](https://community.chocolatey.org/packages/SciTECO)
for Windows users.
+* Yocto/OpenEmbedded users should try the
+ [`sciteco` package from this layer](https://github.com/rhaberkorn/meta-rhaberkorn).
+* Users of OpenWrt may try to install the
+ [`sciteco` package of this feed](https://github.com/rhaberkorn/nanonote-ports).
These releases may be quite outdated and not all of them are provided or tested by the author.
So you may also try out the [nightly builds](https://github.com/rhaberkorn/sciteco/releases/tag/nightly) -
@@ -133,6 +136,17 @@ we currently only provide *experimental* ncurses builds.
If everything fails, you can try building from source.
See [`INSTALL`](https://github.com/rhaberkorn/sciteco/blob/master/INSTALL) for more details.
+Community
+=========
+
+* Join our new [IRC chatroom](https://web.libera.chat/#sciteco): #sciteco at irc.libera.chat
+* Report [bugs via Github](https://github.com/rhaberkorn/sciteco/issues)
+ if you can (or write an E-Mail to the author).
+* You can also use [Github Discussions](https://github.com/rhaberkorn/sciteco/discussions)
+ for asking questions.
+* We are also present in the [alt.lang.teco](https://newsgrouper.org.uk/alt.lang.teco) Usenet group,
+ but it is not restricted to SciTECO.
+
Additional Documentation
========================
diff --git a/TODO b/TODO
index cacb782..6801ee6 100644
--- a/TODO
+++ b/TODO
@@ -4,12 +4,9 @@ Tasks:
"edit" hook.
Known Bugs:
+ * Solaris/OmniOS: There are groff build errors.
* Gtk sometimes allows scrolling with the mouse when it shouldn't.
All mouse events should currently be blocked.
- * Editing very large files, or at least files with very long lines, is painstakingly slow.
- Try for instance openrussian-custom-2023-10-09.sql.
- For some strange reason, this affects both Curses and GTK.
- In UTF-8 mode, this doesn't even load anytime soon.
* PDCurses/WinGUI: There is still some flickering, but it got better
since key macros update the command line only once.
Could already be fixed upstream, see:
@@ -106,6 +103,8 @@ Known Bugs:
This feature would especially be important in order to support
e.g. the SCI_SETPROPERTY message with two strings in order to
set lexer properties.
+ * The lexer.sciteco.macrodef lexer property cannot currently
+ be set/disabled (see above).
* Mac OS: The colors are screwed up with the terminal.tes color scheme
(and with --no-profile) under Mac OS terminal emulators.
This does not happen under Linux with Darling.
@@ -202,8 +201,8 @@ Features:
integer and floating point types internally.
The operator decides how to interpret the arguments
and the return type.
- * Having a separate number parser state will simplify
- number syntax highlighting.
+ * Having a separate number parser state will slightly simplify
+ number syntax highlighting (see teco_lexer_getstyle())..
* Key macro masking flag for the beginning of the command
line. May be useful e.g. for solarized's F5 key (i.e. function
key macros that need to terminate the command line as they
@@ -346,9 +345,6 @@ Features:
* Command to free Q-Register (remove from table).
e.g. FQ (free Q). :FQ could free by QRegister prefix name for
the common use case of Q-Register subtables and lists.
- * TECO syntax highlighting.
- This should now be relatively easy to implement by reusing
- the parser.
* multiline commandline
* Perhaps use Scintilla view as mini buffer.
This means patching Scintilla, so it does not break lines
@@ -454,7 +450,7 @@ Features:
Furthermore, it may not be trivial to detect such dangling
Else/End-If statements as the parser state does not tell us enough.
There is nothing that makes code after a successful If-condition
- special. Even if we always incresed the nest_level, that
+ special. Even if we always increased the nest_level, that
variable does not discern Ifs and Whiles.
* Possible Nightly Build improvements (and therefore releases):
* Build 32-bit Ubuntu packages
@@ -482,7 +478,6 @@ Features:
Other editors use the +line[,col] syntax (see nano).
* <:EF> for saving and closing a buffer, similar to <:EX>.
* Bash completions.
- * Case-sensitive search command (modifier or flag).
* FreeBSD: rctl(8) theoretically allows setting up per-process actions
when exceeding the memory limit.
This however requires special system settings.
@@ -529,12 +524,10 @@ Features:
Also, parsers are not fully embeddable right now.
At the same time, it would need access to the view/document it's
supposed to style. Tricky, but not impossible.
- * Support external lexers.
- Eg. @ES/SCI_SETILEXER/scintillua:APL/
- automatically loads libscintillua.so or scintillua.dll, caches
- the library handle and creates the "APL" lexer.
- There would also have to be some kind of SCI_NAMEDSTYLE wrapper,
- so we can look up style ids by name (specifically for Scintillua).
+ * A generic Scintillua lexer could be added if we supported setting
+ lexer properties and if there was a way to retrieve SCI_PRIVATELEXERCALL(1, str).
+ Perhaps there should be an @EPq/SCI.../ call.
+ See "Lexer Detection" in https://orbitalquark.github.io/scintillua/manual.html
* Lexilla: Could also add an APL lexer to Lexilla.
APL has very simple lexical rules.
* ^^ in string building expanding to a single caret is not
@@ -583,14 +576,20 @@ Features:
Perhaps a few select local Q-Registers (-, _, ^X, ^R) should be
accessible with the global reg syntax as well, so G- is equivalent
to G.-?
- * Real block comments (!* ... *!) that don't spam the goto tables.
- TECO-64 has end of line comments beginning with !! as well.
- We may want both as 0<...> cannot be used to comment out all sorts
- of blocks as it necessarily drives the parser.
* `-` currently inverts the number sign in teco_state_start_minus().
So --1 == 1 and --C == C.
There is probably no need for this "feature" and an error
should be thrown instead on the second `-`.
+ * The command line replacement register (Escape) should be automatically
+ syntax highlighted.
+ I am not sure however how that could be done without a special
+ ED hook.
+ * Instead of defaulting to nothing in the absence of ~/.teco_ini,
+ we should load the installed sample.teco_ini, which
+ gives a more user-friendly experience.
+ * NLS (Native Language Support). I could at least add German and Russian.
+ There aren't many localizable strings in SciTECO.
+ Should be optional.
Optimizations:
* Use SC_DOCUMENTOPTION_STYLES_NONE in batch mode.
@@ -643,9 +642,9 @@ Optimizations:
so we would need a small wrapper to call it from C world.
* Perhaps replace glib with gnulib. Could improve
portability and reduce binary size on platforms where
- I have to ship the glib shared library.
- Also we could control memory allocations more tightly.
- We could also make use of the fnmatch and canonicalize
+ I currently have to ship the glib shared library.
+ Also, we could control memory allocations more tightly.
+ We could also make use of the "fnmatch" and "canonicalize"
modules.
On the other hand, this imports tons of sh*t into the
repository and chains us to Autotools.
@@ -658,6 +657,10 @@ Optimizations:
are defined.
But how to even test for glibc's ptmalloc?
Linux could use musl as well for instance.
+ * Resolve Coverity Scan issues.
+ If this turns out to be useful, perhaps we can automatically
+ upload builds via CI?
+ https://scan.coverity.com/projects/rhaberkorn-sciteco
Documentation:
* Doxygen docs could be deployed on Github pages
@@ -674,9 +677,10 @@ Documentation:
Object-oriented SciTECO ideoms etc. ;-)
* What to do with `--xembed`: tabbed, st
when used as the git editor, etc.
- * Perhaps there should be a Getting Started document,
- that is automatically opened by sample.teco_ini.
* People are demanding a Youtube tutorial.
+ * Vimtutor like tutorial. Could be a woman-page.
+ Perhaps sciteco-tutorial would copy the files to /tmp and
+ open them always with sample.teco_ini.
* The HTML manuals lack monospaced fonts.
This is partly because an.tmac removes the Courier family
in nroff mode, but it still doesn't work if you undo this.
diff --git a/configure.ac b/configure.ac
index 72fc56d..ad4d805 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
-AC_INIT([SciTECO], [2.2.0],
+AC_INIT([SciTECO], [2.3.0],
[robin.haberkorn@googlemail.com],
[sciteco],
[https://github.com/rhaberkorn/sciteco])
@@ -126,7 +126,7 @@ AC_SUBST(DOXYGEN_HAVE_DOT)
AC_CHECK_PROG(SCITECO, sciteco, sciteco)
# Checks for libraries.
-PKG_CHECK_MODULES(LIBGLIB, [glib-2.0 >= 2.44], [
+PKG_CHECK_MODULES(LIBGLIB, [glib-2.0 >= 2.44 gmodule-2.0], [
CFLAGS="$CFLAGS $LIBGLIB_CFLAGS"
CXXFLAGS="$CXXFLAGS $LIBGLIB_CFLAGS"
LIBS="$LIBS $LIBGLIB_LIBS"
@@ -246,20 +246,16 @@ case $INTERFACE in
*curses*)
case $INTERFACE in
ncurses | netbsd-curses)
- # The widechar version of ncurses is necessary for Unicode
- # support even when not using widechar APIs.
- PKG_CHECK_MODULES(NCURSES, [ncursesw], [
- CFLAGS="$CFLAGS $NCURSES_CFLAGS"
- CXXFLAGS="$CXXFLAGS $NCURSES_CFLAGS"
- LIBS="$LIBS $NCURSES_LIBS"
- ], [
- # This should be sufficient to detect non-widechar
- # ncurses versions as well, although we could also check
- # for an "ncurses" package.
- AC_CHECK_LIB(ncurses, initscr, , [
- AC_MSG_ERROR([libncurses missing!])
- ])
- ])
+ # This gives precendence to the widechar version of ncurses,
+ # which is necessary for Unicode support even when not using widechar APIs.
+ AX_WITH_CURSES
+ if [[ x$ax_cv_curses_enhanced != xyes -o x$ax_cv_curses_color != xyes ]]; then
+ AC_MSG_ERROR([X/Open curses compatible library not found!])
+ fi
+ CFLAGS="$CFLAGS $CURSES_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $CURSES_CFLAGS"
+ LIBS="$LIBS $CURSES_LIBS"
+
AC_CHECK_FUNCS([tigetstr])
if [[ x$INTERFACE = xnetbsd-curses ]]; then
@@ -348,6 +344,8 @@ case $INTERFACE in
;;
esac
+ # AX_WITH_CURSES defines per-header symbols, but we currently
+ # demand that CPPFLAGS are set up such, that we can find curses.h anyway.
AC_CHECK_HEADERS([curses.h], , [
AC_MSG_ERROR([Curses header missing!])
])
diff --git a/contrib/scintilla b/contrib/scintilla
-Subproject df71b092506451a227c81361986668ce69bcc09
+Subproject 26df8def5e3ad506c514a42262d98584011d544
diff --git a/contrib/scintilla.am b/contrib/scintilla.am
index 9ba728b..46159c1 100644
--- a/contrib/scintilla.am
+++ b/contrib/scintilla.am
@@ -26,7 +26,7 @@ MAKE_SCINTILLA = $(MAKE) -C @top_builddir@/contrib/scintilla/bin \
srcdir=@SCINTERM_PATH@ basedir=@SCINTILLA_PATH@ \
scintilla=$(LIBSCINTILLA) \
CXXFLAGS='@SCINTILLA_CXXFLAGS@' \
- CURSES_FLAGS='@PDCURSES_CFLAGS@ @XCURSES_CFLAGS@ @NCURSES_CFLAGS@'
+ CURSES_FLAGS='@PDCURSES_CFLAGS@ @XCURSES_CFLAGS@ @CURSES_CFLAGS@'
endif
# Pass toolchain configuration to Scintilla.
diff --git a/debian/changelog b/debian/changelog
index fea48b7..0351f90 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+sciteco (2.3.0-0) unstable; urgency=low
+
+ * new upstream version v2.3.0
+
+ -- Robin Haberkorn <robin.haberkorn@googlemail.com> Tue, 24 Dec 2024 23:06:51 +0000
+
+sciteco (2.2.0-0) unstable; urgency=low
+
+ * new upstream version v2.2.0
+
+ -- Robin Haberkorn <robin.haberkorn@googlemail.com> Mon, 09 Dec 2024 20:15:17 +0000
+
sciteco (2.1.1-0) unstable; urgency=low
* new upstream version v2.1.1
diff --git a/doc/Makefile.am b/doc/Makefile.am
index fac7b1b..765111a 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -34,7 +34,7 @@ dist_scitecodata_DATA = sciteco.tmac
# FIXME: This will patch the hash-bang line repeatedly.
install-exec-hook:
$(SCITECO_FULL) -e "@EB'$(DESTDIR)$(bindir)/*.tes' 1U* \
- EJ-1<%*^[ 0,L.@FR'#!^EM^Xsciteco'#!$(SCITECO_INSTALLED)'> \
+ EJ-1<%*^[ 0,^Q::@FR'#!^EM^Xsciteco'#!$(SCITECO_INSTALLED)'> \
:EX"
womendir = $(scitecolibdir)/women
diff --git a/doc/sciteco.1.in b/doc/sciteco.1.in
index 82c1a47..2b3d3bf 100644
--- a/doc/sciteco.1.in
+++ b/doc/sciteco.1.in
@@ -289,6 +289,12 @@ on Windows.
On all other platforms (including UNIX/Linux) this variable
defaults to the standard library installation path at
.BR "@scitecolibdir@" .
+.TP
+.SCITECO_TOPIC "$SCITECO_SCINTILLUA_LEXERS"
+.B SCITECO_SCINTILLUA_LEXERS
+The Scintillua \(lqlexers/\(rq directory.
+This is passed as the \(lqscintillua.lexers\(rq library property when
+loading a Scintillua lexer via the \fBSCI_SETILEXER\fP Scintilla message.
.
.LP
The \fBHOME\fP, \fBSCITECOCONFIG\fP and \fBSCITECOPATH\fP environment
diff --git a/doc/sciteco.7.template b/doc/sciteco.7.template
index 8c049ee..f9cad80 100644
--- a/doc/sciteco.7.template
+++ b/doc/sciteco.7.template
@@ -2085,7 +2085,8 @@ Labels are symbolic and are defined with the following syntax:
.br
.BI ! label !
.br
-Whereas \fIlabel\fP is an arbitrary string.
+Whereas \fIlabel\fP is an arbitrary non-empty string.
+Labels however cannot practically begin with an asterisk sign (*).
String building is not performed on \fIlabel\fP, i.e. it is used
verbatim.
When a label is encountered, it is cached in a macro-invocation level
@@ -2094,9 +2095,36 @@ Therefore every macro invocation has its own label namespace and gotos
to a label have constant complexity once a label has been parsed.
Terminating a macro execution (or command line) fails if a label that
is jumped to has not been defined.
+Labels are also historically used as comments in TECO code.
+.
+.SS Comments
.SCITECO_TOPIC comment
-Labels also have another important role in \*(ST \(em they are used
-as comments.
+.
+In addition to labels and unlike most classic TECO dialects,
+\*(ST also supports true comments.
+True comments are parsed faster than labels and do not
+take up memory in goto tables.
+.SCITECO_TOPIC "block comment"
+One form of comments is the block comment:
+.br
+.BI !* comment *!
+.br
+Single exclamation marks (!) can be embedded in the \fIcomment\fP if they are not
+following asterisk signs (unlike in goto-labels).
+Block comments can span multiple lines.
+They are analoguous to C's
+.BI /* ... */
+comments.
+.LP
+.SCITECO_TOPIC "EOL comment"
+The second form of real comments are end-of-line comments,
+which are analogous to C++'s \fB//\fP comments:
+.br
+.BI !! comment
+.LP
+The idiom \(lq0<\fIcommands\fP>\(rq
+is also sometimes useful to comment out large blocks of \*(ST code.
+However, all \fIcommands\fP must still be syntactically correct.
.
.SS Loops
.SCITECO_TOPIC < > loop
@@ -2383,9 +2411,14 @@ Scintilla messages and other documentation:
Scintilla
.UE
.TP
-Scinterm manual, documenting the mapping of \(lqRGB\(rq values to terminal colors on curses user interfaces:
-.UR http://foicica.com/scinterm/manual.html
-Scinterm manual
+Scinterm website, documenting the mapping of \(lqRGB\(rq values to terminal colors on curses user interfaces:
+.UR https://orbitalquark.github.io/scinterm/
+Scinterm website
+.UE
+.TP
+Scintillua manual, detailing usage of Lua-based Scintilla lexers:
+.UR https://orbitalquark.github.io/scintillua/manual.html
+Scintillua manual
.UE
.TP
Suitable terminal fonts for icon support in Curses (see \fBED\fP flags):
diff --git a/freebsd/Makefile b/freebsd/Makefile
index 8de1173..d8b7924 100644
--- a/freebsd/Makefile
+++ b/freebsd/Makefile
@@ -1,5 +1,5 @@
PORTNAME= sciteco
-DISTVERSION= 2.1.1
+DISTVERSION= 2.3.0
CATEGORIES= editors textproc devel
MASTER_SITES= https://github.com/rhaberkorn/${PORTNAME}/releases/download/v${DISTVERSION}/ \
SOURCEFORGE/${PORTNAME}/v${DISTVERSION}/
@@ -11,27 +11,32 @@ WWW= https://rhaberkorn.github.io/sciteco/
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING
-FLAVORS= curses gtk
-FLAVOR?= ${FLAVORS:[1]}
-curses_PKGNAMESUFFIX=-curses
-gtk_PKGNAMESUFFIX=-gtk
+FLAVORS= curses gtk
+FLAVOR?= ${FLAVORS:[1]}
+curses_PKGNAMESUFFIX= -curses
+gtk_PKGNAMESUFFIX= -gtk
# As SciTECO uses itself during the build process,
# it makes sense to compile it running under a dummy XServer.
# This is both faster and works in headless environments as well.
-gtk_BUILD_DEPENDS=Xvfb:x11-servers/xorg-server@xvfb \
- xauth:x11/xauth mcookie:devel/util-linux
+gtk_BUILD_DEPENDS= mcookie:devel/util-linux \
+ xauth:x11/xauth \
+ Xvfb:x11-servers/xorg-server@xvfb
-USES= gmake pkgconfig compiler:c11 compiler:c++17-lang gnome groff
+USES= compiler:c11 gmake gnome groff pkgconfig
USE_GNOME= glib20
-GNU_CONFIGURE= yes
+GNU_CONFIGURE= yes
CONFIGURE_ARGS=
-CONFIGURE_OUTSOURCE=yes
+CONFIGURE_OUTSOURCE= yes
MAKEFILE= GNUmakefile
TEST_TARGET= check
+# SciTECO uses an install-exec-hook to fix up hash-bang lines.
+# This is broken by the default 0555 mode.
+BINMODE= 755
+
# NOTE: Unlike on Debian, we cannot build a sciteco-common package.
# FreeBSD does not yet support subpackages.
# Therefore both flavors will install totally independant
@@ -43,38 +48,41 @@ DATADIR= ${PREFIX}/share/gsciteco
SUB_FILES= pkg-message
.if ${FLAVOR} == curses
-USES+= ncurses
-CONFIGURE_ARGS+=--with-interface=ncurses
-PLIST_SUB+= GTK="@comment " PROGRAM_PREFIX=""
+USES+= ncurses
+CONFIGURE_ARGS+= --with-interface=ncurses
+PLIST_SUB+= GTK="@comment " \
+ PROGRAM_PREFIX=""
.elif ${FLAVOR} == gtk
-USES+= desktop-file-utils
+USES+= desktop-file-utils
# FIXME: To appease QA checks, we would have to
# USE_GNOME+=cairo gdkpixbuf2 and
# gtk_LIB_DEPENDS+=libharfbuzz.so:print/harfbuzz
-USE_GNOME+= gtk30
-CONFIGURE_ARGS+=--with-interface=gtk --program-prefix=g \
- --with-scitecodatadir="${DATADIR}"
-PLIST_SUB+= GTK="" PROGRAM_PREFIX=g
+USE_GNOME+= gtk30
+CONFIGURE_ARGS+= --program-prefix=g \
+ --with-interface=gtk \
+ --with-scitecodatadir="${DATADIR}"
+PLIST_SUB+= GTK="" \
+ PROGRAM_PREFIX=g
.endif
-OPTIONS_DEFINE= LEXILLA MALLOC_REPLACEMENT TECO_INTEGER_32
-OPTIONS_DEFAULT=LEXILLA
-OPTIONS_SUB= yes
+OPTIONS_DEFINE= LEXILLA MALLOC_REPLACEMENT TECO_INTEGER_32
+OPTIONS_DEFAULT= LEXILLA
+OPTIONS_SUB= yes
+
+LEXILLA_DESC= Build with Lexilla lexer support (larger)
+MALLOC_REPLACEMENT_DESC= Force replacement of system malloc()
+TECO_INTEGER_32_DESC= Use 32-bit TECO integers
-LEXILLA_DESC=Build with Lexilla lexer support (larger)
-MALLOC_REPLACEMENT_DESC=Force replacement of system malloc()
-TECO_INTEGER_32_DESC=Use 32-bit TECO integers
+LEXILLA_CONFIGURE_OFF= --without-lexilla
+MALLOC_REPLACEMENT_CONFIGURE_ON= --enable-malloc-replacement
+TECO_INTEGER_32_CONFIGURE_ON= --with-teco-integer=32
-LEXILLA_CONFIGURE_OFF=--without-lexilla
-MALLOC_REPLACEMENT_CONFIGURE_ON=--enable-malloc-replacement
-TECO_INTEGER_32_CONFIGURE_ON=--with-teco-integer=32
+WITH_LTO= yes
.include <bsd.port.pre.mk>
.if ${FLAVOR} == gtk
-# Run under Xvfb (see above).
-# This is done only now, since USES=gmake would overwrite MAKE_CMD.
-MAKE_CMD="${SCRIPTDIR}/xvfb-run.sh" ${GMAKE}
+MAKE_CMD= ${SH} ${FILESDIR}/xvfb-run.sh ${GMAKE}
.endif
post-install:
@@ -83,8 +91,6 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/ico/sciteco-${SZ}.png \
${STAGEDIR}${PREFIX}/share/icons/hicolor/${SZ}x${SZ}/apps/sciteco.png
.endfor
- # To appease `make check-plist`:
- ${RM} ${STAGEDIR}${DATADIR}/*.png
${MKDIR} ${STAGEDIR}${PREFIX}/share/applications
${INSTALL_DATA} ${WRKSRC}/src/sciteco.desktop \
${STAGEDIR}${PREFIX}/share/applications/sciteco.desktop
diff --git a/freebsd/distinfo b/freebsd/distinfo
index 76b2d07..9da3f9c 100644
--- a/freebsd/distinfo
+++ b/freebsd/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1731881990
-SHA256 (sciteco-2.1.1.tar.gz) = 5f7f55b2d46f11f73cd122e821daccdfdba9f804473df6213e5f0982bf245c2e
-SIZE (sciteco-2.1.1.tar.gz) = 3983183
+TIMESTAMP = 1735085085
+SHA256 (sciteco-2.3.0.tar.gz) = f131cd88164bd4ee271813a7c6f448b9987ddb54ca6f39328beb979fba3e56a2
+SIZE (sciteco-2.3.0.tar.gz) = 4005903
diff --git a/freebsd/scripts/xvfb-run.sh b/freebsd/files/xvfb-run.sh
index b4fd5a0..b4fd5a0 100755..100644
--- a/freebsd/scripts/xvfb-run.sh
+++ b/freebsd/files/xvfb-run.sh
diff --git a/freebsd/pkg-plist b/freebsd/pkg-plist
index 5539757..c129643 100644
--- a/freebsd/pkg-plist
+++ b/freebsd/pkg-plist
@@ -73,6 +73,7 @@ share/man/man7/%%PROGRAM_PREFIX%%sciteco.7.gz
%%LEXILLA%%%%DATADIR%%/lib/lexers/rebol.tes
%%LEXILLA%%%%DATADIR%%/lib/lexers/rust.tes
%%LEXILLA%%%%DATADIR%%/lib/lexers/scheme.tes
+%%LEXILLA%%%%DATADIR%%/lib/lexers/sciteco.tes
%%LEXILLA%%%%DATADIR%%/lib/lexers/specman.tes
%%LEXILLA%%%%DATADIR%%/lib/lexers/spice.tes
%%LEXILLA%%%%DATADIR%%/lib/lexers/swift.tes
@@ -102,6 +103,9 @@ share/man/man7/%%PROGRAM_PREFIX%%sciteco.7.gz
%%DATADIR%%/lib/women/tedoc.tes.1.woman.tec
%%DATADIR%%/sample.teco_ini
%%DATADIR%%/sciteco.tmac
+%%GTK%%%%DATADIR%%/sciteco-16.png
+%%GTK%%%%DATADIR%%/sciteco-32.png
+%%GTK%%%%DATADIR%%/sciteco-48.png
%%GTK%%%%DATADIR%%/fallback.css
%%GTK%%share/icons/hicolor/16x16/apps/sciteco.png
%%GTK%%share/icons/hicolor/32x32/apps/sciteco.png
diff --git a/lib/Makefile.am b/lib/Makefile.am
index ac45c76..8bf80be 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -101,6 +101,7 @@ dist_lexer_DATA += lexers/verilog.tes \
lexers/markdown.tes \
lexers/asciidoc.tes \
lexers/troff.tes \
- lexers/git.tes
+ lexers/git.tes \
+ lexers/sciteco.tes
endif
diff --git a/lib/color.tes b/lib/color.tes
index 23c14f3..eaa0baa 100644
--- a/lib/color.tes
+++ b/lib/color.tes
@@ -1,10 +1,10 @@
-! <r,g,b>M[color.rgb] -> Scintilla color !
+!* <r,g,b>M[color.rgb] -> Scintilla color *!
@[color.rgb]{
U.bU.gU.r
(Q.r # Q.g*256 # Q.b*256*256)
}
-! These 8 colors should be available on every system !
+!* These 8 colors should be available on every system *!
000,000,000:M[color.rgb]U[color.black]
128,000,000:M[color.rgb]U[color.red]
000,128,000:M[color.rgb]U[color.green]
@@ -14,7 +14,7 @@
000,128,128:M[color.rgb]U[color.cyan]
192,192,192:M[color.rgb]U[color.white]
-! Light color variants, might not be available on every terminal !
+!* Light color variants, might not be available on every terminal *!
064,064,064:M[color.rgb]U[color.lblack]
255,000,000:M[color.rgb]U[color.lred]
000,255,000:M[color.rgb]U[color.lgreen]
@@ -24,7 +24,7 @@
000,255,255:M[color.rgb]U[color.lcyan]
255,255,255:M[color.rgb]U[color.lwhite]
-! <[[flags,]bg,]fg,style>M[color.set] !
+!* <[[flags,]bg,]fg,style>M[color.set] *!
@[color.set]{
U.s U.f "~0'U.b "~0'U.h
Q.f,Q.sESSTYLESETFORE
@@ -33,9 +33,9 @@
Q.h&2,Q.sESSTYLESETITALIC
}
-! Reset all styles and setup the standard ones !
+!* Reset all styles and setup the standard ones *!
@[color.init]{
- ! Default text colors !
+ !* Default text colors *!
:M[color.default],32M[color.set]
ESSTYLECLEARALL
:M[color.linenumber],33M[color.set]
@@ -44,9 +44,9 @@
1ESSETCARETLINEVISIBLE
Q[color.selfore],1ESSETSELFORE
Q[color.selback],1ESSETSELBACK
- ! Calltips and popup windows !
+ !* Calltips and popup windows *!
:M[color.calltip],38M[color.set]
- ! Set up brace lightning !
+ !* Set up brace lightning *!
:M[color.bracelight],34M[color.set]
:M[color.error],35M[color.set]
}
diff --git a/lib/colors/solarized.tes b/lib/colors/solarized.tes
index 25a256a..fd0823e 100644
--- a/lib/colors/solarized.tes
+++ b/lib/colors/solarized.tes
@@ -26,14 +26,14 @@
147,161,161:M[color.rgb],14,3EJ Q[color.lcyan] U[color.base1]
238,232,213:M[color.rgb],07,3EJ Q[color.white] U[color.base2]
253,246,227:M[color.rgb],15,3EJ Q[color.lwhite] U[color.base3]
- 181,137,000:M[color.rgb],03,3EJ ! yellow !
+ 181,137,000:M[color.rgb],03,3EJ !* yellow *!
203,075,022:M[color.rgb],09,3EJ Q[color.lred] U[color.orange]
- 220,050,047:M[color.rgb],01,3EJ ! red !
- 211,054,130:M[color.rgb],05,3EJ ! magenta !
+ 220,050,047:M[color.rgb],01,3EJ !* red *!
+ 211,054,130:M[color.rgb],05,3EJ !* magenta *!
108,113,196:M[color.rgb],13,3EJ Q[color.lmagenta]U[color.violet]
- 038,139,210:M[color.rgb],04,3EJ ! blue !
- 042,161,152:M[color.rgb],06,3EJ ! cyan !
- 133,153,000:M[color.rgb],02,3EJ ! green !
+ 038,139,210:M[color.rgb],04,3EJ !* blue *!
+ 042,161,152:M[color.rgb],06,3EJ !* cyan *!
+ 133,153,000:M[color.rgb],02,3EJ !* green *!
|
000,043,054:M[color.rgb]U[color.base03]
007,054,066:M[color.rgb]U[color.base02]
@@ -75,15 +75,15 @@
[color.variable] 0,Q[color.base3],Q[color.blue] 
[color.error] 1,Q[color.base3],Q[color.red] 
- ! Makes only sense for Makefiles (FIXME) !
+ !* Makes only sense for Makefiles (FIXME) *!
[color.target] 1,Q[color.base3],Q[color.yellow] 
- ! Makes only sense for Patch/Diff files !
+ !* Makes only sense for Patch/Diff files *!
[color.deletion] 0,Q[color.base2],Q[color.red] 
[color.addition] 0,Q[color.base2],Q[color.green] 
[color.change] 0,Q[color.base2],Q[color.yellow] 
- ! For highlighting braces !
+ !* For highlighting braces *!
[color.bracelight] 0,Q[color.base00],Q[color.base3] 
}
@@ -108,26 +108,26 @@
[color.variable] 0,Q[color.base03],Q[color.blue] 
[color.error] 1,Q[color.base03],Q[color.red] 
- ! Makes only sense for Makefiles (FIXME) !
+ !* Makes only sense for Makefiles (FIXME) *!
[color.target] 1,Q[color.base03],Q[color.yellow] 
- ! Makes only sense for Patch/Diff files !
+ !* Makes only sense for Patch/Diff files *!
[color.deletion] 0,Q[color.base02],Q[color.red] 
[color.addition] 0,Q[color.base02],Q[color.green] 
[color.change] 0,Q[color.base02],Q[color.yellow] 
- ! For highlighting braces !
+ !* For highlighting braces *!
[color.bracelight] 0,Q[color.base0],Q[color.base03] 
}
Q[solarized.light]"T :M[solarized.light] | :M[solarized.dark] '
-! Style the Q-Register view !
+!* Style the Q-Register view *!
[* EQ.b :M[color.init] ]*
@[solarized.toggle]{
Q[solarized.light]U[solarized.light]
Q[solarized.light]"T :M[solarized.light] | :M[solarized.dark] '
- ! restyle all buffers and update Q-Reg view !
+ !* restyle all buffers and update Q-Reg view *!
[*
EJ<%.bEB M[lexer.auto]>
EQ.b :M[color.init]
diff --git a/lib/colors/terminal.tes b/lib/colors/terminal.tes
index 43b67c7..2aa7354 100644
--- a/lib/colors/terminal.tes
+++ b/lib/colors/terminal.tes
@@ -1,4 +1,4 @@
-! Default terminal color scheme !
+!* Default terminal color scheme *!
[color.default] 0,Q[color.black],Q[color.white] 
[color.linenumber] 0,Q[color.black],Q[color.white] 
Q[color.black]U[color.caretline]
@@ -19,16 +19,16 @@ Q[color.white]U[color.selback]
[color.variable] 1,Q[color.black],Q[color.lblue] 
[color.error] 1,Q[color.black],Q[color.lred] 
-! Makes only sense for Makefiles !
+!* Makes only sense for Makefiles *!
[color.target] 1,Q[color.black],Q[color.lyellow] 
-! Makes only sense for Patch/Diff files !
+!* Makes only sense for Patch/Diff files *!
[color.deletion] 0,Q[color.black],Q[color.red] 
[color.addition] 0,Q[color.black],Q[color.green] 
[color.change] 0,Q[color.black],Q[color.yellow] 
-! For highlighting braces !
+!* For highlighting braces *!
[color.bracelight] 0,Q[color.white],Q[color.black] 
-! Style the Q-Register view !
+!* Style the Q-Register view *!
[* EQ.b :M[color.init] ]*
diff --git a/lib/lexer.tes b/lib/lexer.tes
index e807c80..2676e1b 100644
--- a/lib/lexer.tes
+++ b/lib/lexer.tes
@@ -1,8 +1,8 @@
-! Lexer configuration and styles (ED hook) !
+!* Lexer configuration and styles (ED hook) *!
-! Match Q-Reg "_" against beginning of current doc's first line !
+!* Match Q-Reg "_" against beginning of current doc's first line *!
@[lexer.checkheader]{
- 0,(1ESPOSITIONFROMLINE:)::S
+ [: 0,(1ESPOSITIONFROMLINE:)::S ]:
}
@[lexer.auto]{
@@ -16,7 +16,7 @@
[_
}
-! Automatically mung all the lexers and add them to "lexer.auto" !
+!* Automatically mung all the lexers and add them to "lexer.auto" *!
[*
EQ.[lexers]
[_ 1ENQ[$SCITECOPATH]/lexers/*.tes ]_ J
diff --git a/lib/lexers/abaqus.tes b/lib/lexers/abaqus.tes
index a21c847..f2b6c03 100644
--- a/lib/lexers/abaqus.tes
+++ b/lib/lexers/abaqus.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.abaqus]{
:EN*.inpQ*"S -1 '
diff --git a/lib/lexers/ada.tes b/lib/lexers/ada.tes
index 318a1e3..3ee5011 100644
--- a/lib/lexers/ada.tes
+++ b/lib/lexers/ada.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.ada]{
:EN*.adsQ*"S -1 '
diff --git a/lib/lexers/asl.tes b/lib/lexers/asl.tes
index 9a5888c..9d2ed65 100644
--- a/lib/lexers/asl.tes
+++ b/lib/lexers/asl.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.asl]{
:EN*.aslQ*"S -1 '
diff --git a/lib/lexers/asm.tes b/lib/lexers/asm.tes
index 816a7e2..7fe8dad 100644
--- a/lib/lexers/asm.tes
+++ b/lib/lexers/asm.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.asm]{
:EN*.asmQ*
diff --git a/lib/lexers/ave.tes b/lib/lexers/ave.tes
index 81b72b2..def268c 100644
--- a/lib/lexers/ave.tes
+++ b/lib/lexers/ave.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.ave]{
:EN*.aveQ*
diff --git a/lib/lexers/avs.tes b/lib/lexers/avs.tes
index 935ba90..1c3b4d3 100644
--- a/lib/lexers/avs.tes
+++ b/lib/lexers/avs.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.avs]{
:EN*.avsQ*"S -1 '
diff --git a/lib/lexers/awk.tes b/lib/lexers/awk.tes
index 75cf3f0..fd85d4c 100644
--- a/lib/lexers/awk.tes
+++ b/lib/lexers/awk.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.awk]{
:EN*.awkQ*
diff --git a/lib/lexers/baan.tes b/lib/lexers/baan.tes
index 87634ca..3e827c6 100644
--- a/lib/lexers/baan.tes
+++ b/lib/lexers/baan.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.baan]{
:EN*.bcQ*"S -1 '
diff --git a/lib/lexers/bash.tes b/lib/lexers/bash.tes
index 33d6664..862a0c1 100644
--- a/lib/lexers/bash.tes
+++ b/lib/lexers/bash.tes
@@ -1,6 +1,8 @@
-! Unix Shell
- It's called bash.tes only because SciTE calls it this way
- internally !
+!*
+ * Unix Shell
+ * It's called bash.tes only because SciTE calls it this way
+ * internally
+ *!
@[lexer.test.bash]{
_#!M[sh,bash,ksh]:M[lexer.checkheader]"S -1 '
@@ -35,8 +37,8 @@
:M[color.string],5M[color.set]
:M[color.string],6M[color.set]
:M[color.operator],7M[color.set]
- :M[color.target],8M[color.set] ! Identifiers, e.g. FOO=... !
+ :M[color.target],8M[color.set] !* Identifiers, e.g. FOO=... *!
:M[color.variable],9M[color.set]
:M[color.variable],10M[color.set]
- :M[color.string2],11M[color.set] ! Backticks !
+ :M[color.string2],11M[color.set] !* Backticks *!
}
diff --git a/lib/lexers/batch.tes b/lib/lexers/batch.tes
index a3a2a80..dddd802 100644
--- a/lib/lexers/batch.tes
+++ b/lib/lexers/batch.tes
@@ -1,4 +1,4 @@
-! DOS, Windows, OS/2 Batch Files !
+!* DOS, Windows, OS/2 Batch Files *!
@[lexer.test.batch]{
:EN*.batQ*"S -1 '
@@ -15,9 +15,9 @@
color copy defined else not start
:M[color.comment],1M[color.set]
:M[color.keyword],2M[color.set]
- :M[color.target],3M[color.set] ! Labels !
- :M[color.preproc],4M[color.set] ! Hide Cmd @ !
- :M[color.preproc2],5M[color.set] ! External Cmd !
+ :M[color.target],3M[color.set] !* Labels *!
+ :M[color.preproc],4M[color.set] !* Hide Cmd @ *!
+ :M[color.preproc2],5M[color.set] !* External Cmd *!
:M[color.variable],6M[color.set]
:M[color.operator],7M[color.set]
}
diff --git a/lib/lexers/blitzbasic.tes b/lib/lexers/blitzbasic.tes
index fee1f96..88f99f9 100644
--- a/lib/lexers/blitzbasic.tes
+++ b/lib/lexers/blitzbasic.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.blitzbasic]{
:EN*.bbQ*
diff --git a/lib/lexers/c.tes b/lib/lexers/c.tes
index 7ed79d2..c0acea2 100644
--- a/lib/lexers/c.tes
+++ b/lib/lexers/c.tes
@@ -41,7 +41,7 @@
0ESSETKEYWORDS
Q[lexer.c.basekeywords] _Alignas _Alignof _Atomic
_Bool _Complex _Generic _Imaginary _Noreturn _Static_assert _Thread_local
- ! Doxygen keywords !
+ !* Doxygen keywords *!
2ESSETKEYWORDSQ[lexer.c.doxygenkeywords]
:M[color.comment],1M[color.set]
:M[color.comment],2M[color.set]
diff --git a/lib/lexers/caml.tes b/lib/lexers/caml.tes
index 0b681a1..3735eee 100644
--- a/lib/lexers/caml.tes
+++ b/lib/lexers/caml.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.caml]{
:EN*.mlQ*"S -1 '
diff --git a/lib/lexers/ch.tes b/lib/lexers/ch.tes
index b0a1f4d..ea33b2c 100644
--- a/lib/lexers/ch.tes
+++ b/lib/lexers/ch.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.ch]{
:EN*.chQ*"S -1 '
diff --git a/lib/lexers/cmake.tes b/lib/lexers/cmake.tes
index 3b7c5f7..198ad32 100644
--- a/lib/lexers/cmake.tes
+++ b/lib/lexers/cmake.tes
@@ -1,4 +1,4 @@
-! CMake Lexing !
+!* CMake Lexing *!
@[lexer.test.cmake]{
:EN*/CMakeLists.txtQ*"S -1 '
@@ -8,7 +8,7 @@
@[lexer.set.cmake]{
ESSETILEXERcmake
- ! Commands !
+ !* Commands *!
0ESSETKEYWORDS
add_custom_command add_custom_target add_definitions add_dependencies
add_executable add_library add_subdirectory add_test aux_source_directory build_command
@@ -25,7 +25,7 @@
site_name source_group string subdir_depends subdirs target_link_libraries try_compile
try_run use_mangled_mesa utility_source variable_requires vtk_make_instantiator
vtk_wrap_java vtk_wrap_python vtk_wrap_tcl while write_file
- ! Special command arguments !
+ !* Special command arguments *!
1ESSETKEYWORDS
ABSOLUTE ABSTRACT ADDITIONAL_MAKE_CLEAN_FILES ALL AND APPEND ARGS ASCII
BEFORE CACHE CACHE_VARIABLES CLEAR COMMAND COMMANDS COMMAND_NAME COMMENT COMPARE
diff --git a/lib/lexers/cobol.tes b/lib/lexers/cobol.tes
index 7d9b6cb..921d948 100644
--- a/lib/lexers/cobol.tes
+++ b/lib/lexers/cobol.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.cobol]{
:EN*.cobQ*
diff --git a/lib/lexers/cpp.tes b/lib/lexers/cpp.tes
index 5c3ce4a..0f6a01a 100644
--- a/lib/lexers/cpp.tes
+++ b/lib/lexers/cpp.tes
@@ -12,7 +12,7 @@
:EN*.hppQ*"S -1 '
:EN*.hxxQ*"S -1 '
:EN*.ippQ*"S -1 '
- !*:EN*.mmQ*"S -1 '*!
+ !!:EN*.mmQ*"S -1 '
:EN*.smaQ*"S -1 '
:EN*.inoQ*
}
@@ -25,7 +25,7 @@
explicit export friend mutable namespace new not not_eq operator or or_eq
private protected public reinterpret_cast static_cast template this
throw try typeid typename using virtual xor xor_eq
- ! Doxygen keywords !
+ !* Doxygen keywords *!
2ESSETKEYWORDSQ[lexer.c.doxygenkeywords]
:M[color.comment],1M[color.set]
:M[color.comment],2M[color.set]
diff --git a/lib/lexers/cs.tes b/lib/lexers/cs.tes
index 592332a..1721130 100644
--- a/lib/lexers/cs.tes
+++ b/lib/lexers/cs.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.cs]{
:EN*.csQ*
diff --git a/lib/lexers/d.tes b/lib/lexers/d.tes
index 9a00fc9..b0f310a 100644
--- a/lib/lexers/d.tes
+++ b/lib/lexers/d.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.d]{
:EN*.dQ*
diff --git a/lib/lexers/diff.tes b/lib/lexers/diff.tes
index a254f49..db658b4 100644
--- a/lib/lexers/diff.tes
+++ b/lib/lexers/diff.tes
@@ -1,4 +1,4 @@
-! Patch/Diff Files !
+!* Patch/Diff Files *!
@[lexer.test.diff]{
:EN*.diffQ*"S -1 '
@@ -8,9 +8,9 @@
@[lexer.set.diff]{
ESSETILEXERdiff
:M[color.comment],1M[color.set]
- :M[color.keyword],2M[color.set] ! Command !
- :M[color.preproc],3M[color.set] ! Source/Dest !
- :M[color.operator],4M[color.set] ! Position @@ !
+ :M[color.keyword],2M[color.set] !* Command *!
+ :M[color.preproc],3M[color.set] !* Source/Dest *!
+ :M[color.operator],4M[color.set] !* Position @@ *!
:M[color.deletion],5M[color.set]
:M[color.addition],6M[color.set]
:M[color.change],7M[color.set]
diff --git a/lib/lexers/docbook.tes b/lib/lexers/docbook.tes
index ea60702..e5f3687 100644
--- a/lib/lexers/docbook.tes
+++ b/lib/lexers/docbook.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.docbook]{
:EN*.docbookQ*
diff --git a/lib/lexers/eiffel.tes b/lib/lexers/eiffel.tes
index c22f5df..a932588 100644
--- a/lib/lexers/eiffel.tes
+++ b/lib/lexers/eiffel.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.eiffel]{
:EN*.eQ*
diff --git a/lib/lexers/f77.tes b/lib/lexers/f77.tes
index e06243c..83feb85 100644
--- a/lib/lexers/f77.tes
+++ b/lib/lexers/f77.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.f77]{
:EN*.fQ*"S -1 '
diff --git a/lib/lexers/f95.tes b/lib/lexers/f95.tes
index 7544375..5c9e2c3 100644
--- a/lib/lexers/f95.tes
+++ b/lib/lexers/f95.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.f95]{
:EN*.f90Q*"S -1 '
diff --git a/lib/lexers/flagship.tes b/lib/lexers/flagship.tes
index 485d351..66a7c92 100644
--- a/lib/lexers/flagship.tes
+++ b/lib/lexers/flagship.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.flagship]{
:EN*.prgQ*
diff --git a/lib/lexers/flash.tes b/lib/lexers/flash.tes
index 27be2bf..6464254 100644
--- a/lib/lexers/flash.tes
+++ b/lib/lexers/flash.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.flash]{
:EN*.asQ*"S -1 '
diff --git a/lib/lexers/freebasic.tes b/lib/lexers/freebasic.tes
index 16b7ace..c333c55 100644
--- a/lib/lexers/freebasic.tes
+++ b/lib/lexers/freebasic.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.freebasic]{
:EN*.basQ*"S -1 '
diff --git a/lib/lexers/gap.tes b/lib/lexers/gap.tes
index 7a680c7..cf3081b 100644
--- a/lib/lexers/gap.tes
+++ b/lib/lexers/gap.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.gap]{
:EN*.gQ*"S -1 '
diff --git a/lib/lexers/git.tes b/lib/lexers/git.tes
index 567859b..d4c3aa2 100644
--- a/lib/lexers/git.tes
+++ b/lib/lexers/git.tes
@@ -1,4 +1,9 @@
-!* Git commit and rebase messages *!
+!*
+ * Git commit and rebase messages
+ *
+ * NOTE: This is not a real lexer.
+ * It only styles the document once.
+ *!
@[lexer.test.git]{
:EN*/COMMIT_EDITMSGQ*"S -1 '
diff --git a/lib/lexers/go.tes b/lib/lexers/go.tes
index a637b5c..319af88 100644
--- a/lib/lexers/go.tes
+++ b/lib/lexers/go.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.go]{
:EN*.goQ*
diff --git a/lib/lexers/idl.tes b/lib/lexers/idl.tes
index 9180ae0..088b72a 100644
--- a/lib/lexers/idl.tes
+++ b/lib/lexers/idl.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.idl]{
:EN*.idlQ*"S -1 '
diff --git a/lib/lexers/inno.tes b/lib/lexers/inno.tes
index c963b1d..1d0b7eb 100644
--- a/lib/lexers/inno.tes
+++ b/lib/lexers/inno.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.inno]{
:EN*.issQ*"S -1 '
diff --git a/lib/lexers/java.tes b/lib/lexers/java.tes
index a9a592a..1462a51 100644
--- a/lib/lexers/java.tes
+++ b/lib/lexers/java.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.java]{
:EN*.javaQ*"S -1 '
diff --git a/lib/lexers/js.tes b/lib/lexers/js.tes
index 3e8ed8e..75bb500 100644
--- a/lib/lexers/js.tes
+++ b/lib/lexers/js.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.js]{
:EN*.jsQ*"S -1 '
diff --git a/lib/lexers/kix.tes b/lib/lexers/kix.tes
index f63b5c5..0030c66 100644
--- a/lib/lexers/kix.tes
+++ b/lib/lexers/kix.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.kix]{
:EN*.kixQ*
diff --git a/lib/lexers/lisp.tes b/lib/lexers/lisp.tes
index c17196a..60ce61c 100644
--- a/lib/lexers/lisp.tes
+++ b/lib/lexers/lisp.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.lisp]{
:EN*.lspQ*"S -1 '
diff --git a/lib/lexers/lout.tes b/lib/lexers/lout.tes
index cb161b7..baa4e71 100644
--- a/lib/lexers/lout.tes
+++ b/lib/lexers/lout.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.lout]{
:EN*.ltQ*
@@ -23,7 +23,7 @@
@SysPrependGraphic @Target @Null @PageLabel @Galley @ForceGalley @LInput @Split @Tag @Key
@Optimize @Merge @Enclose @Begin @End @Moment @Second @Minute @Hour @Day @Month @Year
@Century @WeekDay @YearDay @DaylightSaving @SetContext @GetContext
- ! NOTE: carets are doubled to escape them !
+ !* NOTE: carets are doubled to escape them *!
1ESSETKEYWORDS
&&& && & ^^// ^^/ ^^|| ^^| ^^& // / || |
2ESSETKEYWORDS
diff --git a/lib/lexers/lua.tes b/lib/lexers/lua.tes
index 7ffe54a..0cf898a 100644
--- a/lib/lexers/lua.tes
+++ b/lib/lexers/lua.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.lua]{
_#!Mlua:M[lexer.checkheader]"S -1 '
diff --git a/lib/lexers/make.tes b/lib/lexers/make.tes
index 2e1d661..4ff519a 100644
--- a/lib/lexers/make.tes
+++ b/lib/lexers/make.tes
@@ -1,4 +1,4 @@
-! Makefile Lexing !
+!* Makefile Lexing *!
@[lexer.test.make]{
:EN*/MakefileQ*"S -1 '
diff --git a/lib/lexers/mako.tes b/lib/lexers/mako.tes
index 5cbf9fd..b38ee13 100644
--- a/lib/lexers/mako.tes
+++ b/lib/lexers/mako.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.mako]{
:EN*.makQ*"S -1 '
diff --git a/lib/lexers/matlab.tes b/lib/lexers/matlab.tes
index d63a6f8..c8dc44d 100644
--- a/lib/lexers/matlab.tes
+++ b/lib/lexers/matlab.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.matlab]{
:EN*.m.matlabQ*
diff --git a/lib/lexers/mmixal.tes b/lib/lexers/mmixal.tes
index 7f7df43..e9047cb 100644
--- a/lib/lexers/mmixal.tes
+++ b/lib/lexers/mmixal.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.mmixal]{
:EN*.mmsQ*
diff --git a/lib/lexers/octave.tes b/lib/lexers/octave.tes
index 2df769a..41c0563 100644
--- a/lib/lexers/octave.tes
+++ b/lib/lexers/octave.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.octave]{
:EN*.m.octaveQ*
diff --git a/lib/lexers/oscript.tes b/lib/lexers/oscript.tes
index 949e564..d4f2eb8 100644
--- a/lib/lexers/oscript.tes
+++ b/lib/lexers/oscript.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.oscript]{
:EN*.osxQ*
diff --git a/lib/lexers/pascal.tes b/lib/lexers/pascal.tes
index 66e705c..57bd3e8 100644
--- a/lib/lexers/pascal.tes
+++ b/lib/lexers/pascal.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.pascal]{
:EN*.dprQ*"S -1 '
diff --git a/lib/lexers/perl.tes b/lib/lexers/perl.tes
index 213dd4b..44d7148 100644
--- a/lib/lexers/perl.tes
+++ b/lib/lexers/perl.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.perl]{
_#!M[perl,pl]:M[lexer.checkheader]"S -1 '
diff --git a/lib/lexers/php.tes b/lib/lexers/php.tes
index e60c769..7265408 100644
--- a/lib/lexers/php.tes
+++ b/lib/lexers/php.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.php]{
:EN*.php3Q*"S -1 '
diff --git a/lib/lexers/pike.tes b/lib/lexers/pike.tes
index 9686fe2..c530622 100644
--- a/lib/lexers/pike.tes
+++ b/lib/lexers/pike.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.pike]{
:EN*.pikeQ*
diff --git a/lib/lexers/pov.tes b/lib/lexers/pov.tes
index 257ce19..90fe0f8 100644
--- a/lib/lexers/pov.tes
+++ b/lib/lexers/pov.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.pov]{
:EN*.povQ*"S -1 '
diff --git a/lib/lexers/powerpro.tes b/lib/lexers/powerpro.tes
index e487604..fac1ef8 100644
--- a/lib/lexers/powerpro.tes
+++ b/lib/lexers/powerpro.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.powerpro]{
:EN*.powerproQ*
diff --git a/lib/lexers/purebasic.tes b/lib/lexers/purebasic.tes
index e9e20a7..6f98975 100644
--- a/lib/lexers/purebasic.tes
+++ b/lib/lexers/purebasic.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.purebasic]{
:EN*.pbQ*
diff --git a/lib/lexers/r.tes b/lib/lexers/r.tes
index 9fb393e..5ecaa86 100644
--- a/lib/lexers/r.tes
+++ b/lib/lexers/r.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.r]{
:EN*.RQ*"S -1 '
diff --git a/lib/lexers/rc.tes b/lib/lexers/rc.tes
index db2203d..132f9c9 100644
--- a/lib/lexers/rc.tes
+++ b/lib/lexers/rc.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.rc]{
:EN*.rcQ*"S -1 '
diff --git a/lib/lexers/rebol.tes b/lib/lexers/rebol.tes
index cef071c..1a310bb 100644
--- a/lib/lexers/rebol.tes
+++ b/lib/lexers/rebol.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.rebol]{
:EN*.rQ*"S -1 '
diff --git a/lib/lexers/rust.tes b/lib/lexers/rust.tes
index 4ffd9b5..06a0154 100644
--- a/lib/lexers/rust.tes
+++ b/lib/lexers/rust.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.rust]{
:EN*.rsQ*
diff --git a/lib/lexers/scheme.tes b/lib/lexers/scheme.tes
index 31af808..3f5e8fe 100644
--- a/lib/lexers/scheme.tes
+++ b/lib/lexers/scheme.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.scheme]{
:EN*.scmQ*"S -1 '
diff --git a/lib/lexers/sciteco.tes b/lib/lexers/sciteco.tes
new file mode 100644
index 0000000..106c12b
--- /dev/null
+++ b/lib/lexers/sciteco.tes
@@ -0,0 +1,21 @@
+!* SciTECO syntax highlighting *!
+
+@[lexer.test.sciteco]{
+ _#!Msciteco:M[lexer.checkheader]"S -1 '
+ :EN*.tesQ*"S -1 '
+ :EN*.tecQ*"S -1 '
+ :EN*.teco_iniQ*
+}
+
+@[lexer.set.sciteco]{
+ 1ESSETIDENTIFIER
+ :M[color.keyword],1M[color.set]
+ :M[color.operator],2M[color.set]
+ !!:M[color.variable],3M[color.set]
+ :M[color.string],4M[color.set]
+ :M[color.number],5M[color.set]
+ :M[color.preproc],6M[color.set] !* labels *!
+ :M[color.comment],7M[color.set]
+ !* invalid commands or byte sequences *!
+ :M[color.error],8M[color.set]
+}
diff --git a/lib/lexers/specman.tes b/lib/lexers/specman.tes
index 3d83590..0710679 100644
--- a/lib/lexers/specman.tes
+++ b/lib/lexers/specman.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.specman]{
:EN*.eQ*
diff --git a/lib/lexers/spice.tes b/lib/lexers/spice.tes
index 5178d01..8883239 100644
--- a/lib/lexers/spice.tes
+++ b/lib/lexers/spice.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.spice]{
:EN*.scpQ*"S -1 '
diff --git a/lib/lexers/swift.tes b/lib/lexers/swift.tes
index 4a20509..a2466c9 100644
--- a/lib/lexers/swift.tes
+++ b/lib/lexers/swift.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.swift]{
:EN*.swiftQ*
diff --git a/lib/lexers/systemverilog.tes b/lib/lexers/systemverilog.tes
index 3df1225..4edbde1 100644
--- a/lib/lexers/systemverilog.tes
+++ b/lib/lexers/systemverilog.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.systemverilog]{
:EN*.svQ*"S -1 '
diff --git a/lib/lexers/tacl.tes b/lib/lexers/tacl.tes
index a0d5bc9..faa9e3d 100644
--- a/lib/lexers/tacl.tes
+++ b/lib/lexers/tacl.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.tacl]{
:EN*.taclQ*
diff --git a/lib/lexers/tal.tes b/lib/lexers/tal.tes
index 247c451..8dc56a4 100644
--- a/lib/lexers/tal.tes
+++ b/lib/lexers/tal.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.tal]{
:EN*.talQ*
diff --git a/lib/lexers/tcl.tes b/lib/lexers/tcl.tes
index d5fd022..102cb11 100644
--- a/lib/lexers/tcl.tes
+++ b/lib/lexers/tcl.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.tcl]{
:EN*.tclQ*"S -1 '
diff --git a/lib/lexers/test.tes b/lib/lexers/test.tes
index cc719db..adac64f 100644
--- a/lib/lexers/test.tes
+++ b/lib/lexers/test.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.test]{
:EN*.plnQ*"S -1 '
diff --git a/lib/lexers/troff.tes b/lib/lexers/troff.tes
index a10d3e9..fe8063f 100644
--- a/lib/lexers/troff.tes
+++ b/lib/lexers/troff.tes
@@ -69,8 +69,10 @@
2ESSETKEYWORDSel nop
!* Requests and commands, initiating ignore blocks *!
3ESSETKEYWORDSig
- !* Requests and commands with end-macros.
- Mom macros alias MAC to de. *!
+ !*
+ * Requests and commands with end-macros.
+ * Mom macros alias MAC to de.
+ *!
4ESSETKEYWORDSam am1 de de1 MAC
:M[color.keyword],1M[color.set]
@@ -79,7 +81,7 @@
:M[color.operator],4M[color.set]
:M[color.string],5M[color.set]
:M[color.comment],6M[color.set]
- !*:M[color.comment],7M[color.set]*!
+ !!:M[color.comment],7M[color.set]
7U.i 20<:M[color.variable],%.iM[color.set]>
:M[color.preproc2],17M[color.set]
}
diff --git a/lib/lexers/vala.tes b/lib/lexers/vala.tes
index 85b9ceb..d5329d2 100644
--- a/lib/lexers/vala.tes
+++ b/lib/lexers/vala.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.vala]{
:EN*.valaQ*
diff --git a/lib/lexers/vb.tes b/lib/lexers/vb.tes
index c37752b..8bb82fb 100644
--- a/lib/lexers/vb.tes
+++ b/lib/lexers/vb.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.vb]{
:EN*.vbQ*"S -1 '
diff --git a/lib/lexers/verilog.tes b/lib/lexers/verilog.tes
index 23f874f..f8fea22 100644
--- a/lib/lexers/verilog.tes
+++ b/lib/lexers/verilog.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.verilog]{
:EN*.vQ*"S -1 '
diff --git a/lib/lexers/vhdl.tes b/lib/lexers/vhdl.tes
index 37fe9bf..a13ba71 100644
--- a/lib/lexers/vhdl.tes
+++ b/lib/lexers/vhdl.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.vhdl]{
:EN*.vhdQ*"S -1 '
diff --git a/lib/lexers/vxml.tes b/lib/lexers/vxml.tes
index 60dc060..c044824 100644
--- a/lib/lexers/vxml.tes
+++ b/lib/lexers/vxml.tes
@@ -1,4 +1,4 @@
-! AUTO-GENERATED FROM SCITE PROPERTY SET !
+!* AUTO-GENERATED FROM SCITE PROPERTY SET *!
@[lexer.test.vxml]{
:EN*.vxmlQ*
diff --git a/lib/lexers/xml.tes b/lib/lexers/xml.tes
index 87ed9b7..081c2ec 100644
--- a/lib/lexers/xml.tes
+++ b/lib/lexers/xml.tes
@@ -1,4 +1,4 @@
-! Lexing for XML and its applications !
+!* Lexing for XML and its applications *!
@[lexer.test.xml]{
:EN*.xmlQ*"S -1 '
@@ -16,20 +16,20 @@
@[lexer.set.xml]{
ESSETILEXERxml
0ESSETKEYWORDS 
- ! DTD keywords !
+ !* DTD keywords *!
5ESSETKEYWORDS
ELEMENT DOCTYPE ATTLIST ENTITY NOTATION
- :M[color.keyword],1M[color.set] ! Tags !
- :M[color.keyword],2M[color.set] ! Tags !
- :M[color.variable],3M[color.set] ! Attributes !
- :M[color.variable],4M[color.set] ! Attributes !
+ :M[color.keyword],1M[color.set] !* Tags *!
+ :M[color.keyword],2M[color.set] !* Tags *!
+ :M[color.variable],3M[color.set] !* Attributes *!
+ :M[color.variable],4M[color.set] !* Attributes *!
:M[color.number],5M[color.set]
:M[color.string],6M[color.set]
:M[color.string],7M[color.set]
:M[color.comment],9M[color.set]
- :M[color.preproc],10M[color.set] ! Entities !
- :M[color.keyword],11M[color.set] ! Tag Ends /> !
- :M[color.preproc2],12M[color.set] ! PI !
- :M[color.preproc2],13M[color.set] ! PI !
- :M[color.string2],14M[color.set] ! CDATA !
+ :M[color.preproc],10M[color.set] !* Entities *!
+ :M[color.keyword],11M[color.set] !* Tag Ends /> *!
+ :M[color.preproc2],12M[color.set] !* PI *!
+ :M[color.preproc2],13M[color.set] !* PI *!
+ :M[color.string2],14M[color.set] !* CDATA *!
}
diff --git a/lib/session.tes b/lib/session.tes
index 56634a5..775a484 100644
--- a/lib/session.tes
+++ b/lib/session.tes
Binary files differ
diff --git a/lib/string.tes b/lib/string.tes
index e6ec4a1..fe049a9 100644
--- a/lib/string.tes
+++ b/lib/string.tes
@@ -1,7 +1,9 @@
-! String utility macros !
+!* String utility macros *!
-! <pos1,pos2>M[symcasecmp] - Compare symbol at pos1 with symbol at pos2 (caseless)
- this case-folds to lower case so "_"<"A" which is compatible with g_ascii_strcasecmp() !
+!*
+ * <pos1,pos2>M[symcasecmp] - Compare symbol at pos1 with symbol at pos2 (caseless)
+ * this case-folds to lower case so "_"<"A" which is compatible with g_ascii_strcasecmp()
+ *!
@[symcasecmp]{
U.2U.1 -.%.1 -.%.2
@.#lo{
@@ -13,7 +15,7 @@
Q.c
}
-! <i,j>M[exchange] - Exchange line at I with line at J (I < J), returning new J !
+!* <i,j>M[exchange] - Exchange line at I with line at J (I < J), returning new J *!
@[exchange]{
U.jU.i
Q.jJ @X.x
@@ -22,7 +24,7 @@
Q.j
}
-! <i,j>M[qsort] - Sort lines beginning at I until J using Quicksort algorithm !
+!* <i,j>M[qsort] - Sort lines beginning at I until J using Quicksort algorithm *!
@[qsort]{
U.rU.l
diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4
new file mode 100644
index 0000000..17c3eab
--- /dev/null
+++ b/m4/ax_require_defined.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_REQUIRE_DEFINED(MACRO)
+#
+# DESCRIPTION
+#
+# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
+# been defined and thus are available for use. This avoids random issues
+# where a macro isn't expanded. Instead the configure script emits a
+# non-fatal:
+#
+# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
+#
+# It's like AC_REQUIRE except it doesn't expand the required macro.
+#
+# Here's an example:
+#
+# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
+#
+# LICENSE
+#
+# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 2
+
+AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
+ m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
+])dnl AX_REQUIRE_DEFINED
diff --git a/m4/ax_with_curses.m4 b/m4/ax_with_curses.m4
new file mode 100644
index 0000000..dcdc129
--- /dev/null
+++ b/m4/ax_with_curses.m4
@@ -0,0 +1,582 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_with_curses.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_WITH_CURSES
+#
+# DESCRIPTION
+#
+# This macro checks whether a SysV or X/Open-compatible Curses library is
+# present, along with the associated header file. The NcursesW
+# (wide-character) library is searched for first, followed by Ncurses,
+# then the system-default plain Curses. The first library found is the
+# one returned. Finding libraries will first be attempted by using
+# pkg-config, and should the pkg-config files not be available, will
+# fallback to combinations of known flags itself.
+#
+# The following options are understood: --with-ncursesw, --with-ncurses,
+# --without-ncursesw, --without-ncurses. The "--with" options force the
+# macro to use that particular library, terminating with an error if not
+# found. The "--without" options simply skip the check for that library.
+# The effect on the search pattern is:
+#
+# (no options) - NcursesW, Ncurses, Curses
+# --with-ncurses --with-ncursesw - NcursesW only [*]
+# --without-ncurses --with-ncursesw - NcursesW only [*]
+# --with-ncursesw - NcursesW only [*]
+# --with-ncurses --without-ncursesw - Ncurses only [*]
+# --with-ncurses - NcursesW, Ncurses [**]
+# --without-ncurses --without-ncursesw - Curses only
+# --without-ncursesw - Ncurses, Curses
+# --without-ncurses - NcursesW, Curses
+#
+# [*] If the library is not found, abort the configure script.
+#
+# [**] If the second library (Ncurses) is not found, abort configure.
+#
+# The following preprocessor symbols may be defined by this macro if the
+# appropriate conditions are met:
+#
+# HAVE_CURSES - if any SysV or X/Open Curses library found
+# HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions
+# HAVE_CURSES_COLOR - if library supports color (enhanced functions)
+# HAVE_CURSES_OBSOLETE - if library supports certain obsolete features
+# HAVE_NCURSESW - if NcursesW (wide char) library is to be used
+# HAVE_NCURSES - if the Ncurses library is to be used
+#
+# HAVE_CURSES_H - if <curses.h> is present and should be used
+# HAVE_NCURSESW_H - if <ncursesw.h> should be used
+# HAVE_NCURSES_H - if <ncurses.h> should be used
+# HAVE_NCURSESW_CURSES_H - if <ncursesw/curses.h> should be used
+# HAVE_NCURSES_CURSES_H - if <ncurses/curses.h> should be used
+#
+# (These preprocessor symbols are discussed later in this document.)
+#
+# The following output variables are defined by this macro; they are
+# precious and may be overridden on the ./configure command line:
+#
+# CURSES_LIBS - library to add to xxx_LDADD
+# CURSES_CFLAGS - include paths to add to xxx_CPPFLAGS
+#
+# In previous versions of this macro, the flags CURSES_LIB and
+# CURSES_CPPFLAGS were defined. These have been renamed, in keeping with
+# AX_WITH_CURSES's close bigger brother, PKG_CHECK_MODULES, which should
+# eventually supersede the use of AX_WITH_CURSES. Neither the library
+# listed in CURSES_LIBS, nor the flags in CURSES_CFLAGS are added to LIBS,
+# respectively CPPFLAGS, by default. You need to add both to the
+# appropriate xxx_LDADD/xxx_CPPFLAGS line in your Makefile.am. For
+# example:
+#
+# prog_LDADD = @CURSES_LIBS@
+# prog_CPPFLAGS = @CURSES_CFLAGS@
+#
+# If CURSES_LIBS is set on the configure command line (such as by running
+# "./configure CURSES_LIBS=-lmycurses"), then the only header searched for
+# is <curses.h>. If the user needs to specify an alternative path for a
+# library (such as for a non-standard NcurseW), the user should use the
+# LDFLAGS variable.
+#
+# The following shell variables may be defined by this macro:
+#
+# ax_cv_curses - set to "yes" if any Curses library found
+# ax_cv_curses_enhanced - set to "yes" if Enhanced functions present
+# ax_cv_curses_color - set to "yes" if color functions present
+# ax_cv_curses_obsolete - set to "yes" if obsolete features present
+#
+# ax_cv_ncursesw - set to "yes" if NcursesW library found
+# ax_cv_ncurses - set to "yes" if Ncurses library found
+# ax_cv_plaincurses - set to "yes" if plain Curses library found
+# ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no"
+#
+# These variables can be used in your configure.ac to determine the level
+# of support you need from the Curses library. For example, if you must
+# have either Ncurses or NcursesW, you could include:
+#
+# AX_WITH_CURSES
+# if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
+# AC_MSG_ERROR([requires either NcursesW or Ncurses library])
+# fi
+#
+# If any Curses library will do (but one must be present and must support
+# color), you could use:
+#
+# AX_WITH_CURSES
+# if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then
+# AC_MSG_ERROR([requires an X/Open-compatible Curses library with color])
+# fi
+#
+# Certain preprocessor symbols and shell variables defined by this macro
+# can be used to determine various features of the Curses library. In
+# particular, HAVE_CURSES and ax_cv_curses are defined if the Curses
+# library found conforms to the traditional SysV and/or X/Open Base Curses
+# definition. Any working Curses library conforms to this level.
+#
+# HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the
+# library supports the X/Open Enhanced Curses definition. In particular,
+# the wide-character types attr_t, cchar_t and wint_t, the functions
+# wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES
+# are checked. The Ncurses library does NOT conform to this definition,
+# although NcursesW does.
+#
+# HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library
+# supports color functions and macros such as COLOR_PAIR, A_COLOR,
+# COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the
+# X/Open Base Curses definition, but are part of the Enhanced set of
+# functions. The Ncurses library DOES support these functions, as does
+# NcursesW.
+#
+# HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the
+# library supports certain features present in SysV and BSD Curses but not
+# defined in the X/Open definition. In particular, the functions
+# getattrs(), getcurx() and getmaxx() are checked.
+#
+# To use the HAVE_xxx_H preprocessor symbols, insert the following into
+# your system.h (or equivalent) header file:
+#
+# #if defined HAVE_NCURSESW_CURSES_H
+# # include <ncursesw/curses.h>
+# #elif defined HAVE_NCURSESW_H
+# # include <ncursesw.h>
+# #elif defined HAVE_NCURSES_CURSES_H
+# # include <ncurses/curses.h>
+# #elif defined HAVE_NCURSES_H
+# # include <ncurses.h>
+# #elif defined HAVE_CURSES_H
+# # include <curses.h>
+# #else
+# # error "SysV or X/Open-compatible Curses header file required"
+# #endif
+#
+# For previous users of this macro: you should not need to change anything
+# in your configure.ac or Makefile.am, as the previous (serial 10)
+# semantics are still valid. However, you should update your system.h (or
+# equivalent) header file to the fragment shown above. You are encouraged
+# also to make use of the extended functionality provided by this version
+# of AX_WITH_CURSES, as well as in the additional macros
+# AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM.
+#
+# LICENSE
+#
+# Copyright (c) 2009 Mark Pulford <mark@kyne.com.au>
+# Copyright (c) 2009 Damian Pietras <daper@daper.net>
+# Copyright (c) 2012 Reuben Thomas <rrt@sc3d.org>
+# Copyright (c) 2011 John Zaitseff <J.Zaitseff@zap.org.au>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 18
+
+# internal function to factorize common code that is used by both ncurses
+# and ncursesw
+AC_DEFUN([_FIND_CURSES_FLAGS], [
+ AC_MSG_CHECKING([for $1 via pkg-config])
+
+ AX_REQUIRE_DEFINED([PKG_CHECK_EXISTS])
+ _PKG_CONFIG([_ax_cv_$1_libs], [libs], [$1])
+ _PKG_CONFIG([_ax_cv_$1_cppflags], [cflags], [$1])
+
+ AS_IF([test "x$pkg_failed" = "xyes" || test "x$pkg_failed" = "xuntried"],[
+ AC_MSG_RESULT([no])
+ # No suitable .pc file found, have to find flags via fallback
+ AC_CACHE_CHECK([for $1 via fallback], [ax_cv_$1], [
+ AS_ECHO()
+ pkg_cv__ax_cv_$1_libs="-l$1"
+ pkg_cv__ax_cv_$1_cppflags="-D_GNU_SOURCE $CURSES_CFLAGS"
+ LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
+ CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags"
+
+ AC_MSG_CHECKING([for initscr() with $pkg_cv__ax_cv_$1_libs])
+ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
+ [
+ AC_MSG_RESULT([yes])
+ AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs])
+ AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[
+ ax_cv_$1=yes
+ ],[
+ AC_MSG_RESULT([no])
+ m4_if(
+ [$1],[ncursesw],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfow"],
+ [$1],[ncurses],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfo"]
+ )
+ LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
+
+ AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs])
+ AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[
+ ax_cv_$1=yes
+ ],[
+ ax_cv_$1=no
+ ])
+ ])
+ ],[
+ ax_cv_$1=no
+ ])
+ ])
+ ],[
+ AC_MSG_RESULT([yes])
+ # Found .pc file, using its information
+ LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
+ CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags"
+ ax_cv_$1=yes
+ ])
+])
+
+AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES])
+AC_DEFUN([AX_WITH_CURSES], [
+ AC_ARG_VAR([CURSES_LIBS], [linker library for Curses, e.g. -lcurses])
+ AC_ARG_VAR([CURSES_CFLAGS], [preprocessor flags for Curses, e.g. -I/usr/include/ncursesw])
+ AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses],
+ [force the use of Ncurses or NcursesW])],
+ [], [with_ncurses=check])
+ AC_ARG_WITH([ncursesw], [AS_HELP_STRING([--without-ncursesw],
+ [do not use NcursesW (wide character support)])],
+ [], [with_ncursesw=check])
+
+ ax_saved_LIBS=$LIBS
+ ax_saved_CPPFLAGS=$CPPFLAGS
+
+ AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes],
+ [ax_with_plaincurses=no], [ax_with_plaincurses=check])
+
+ ax_cv_curses_which=no
+
+ # Test for NcursesW
+ AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncursesw" != xno], [
+ _FIND_CURSES_FLAGS([ncursesw])
+
+ AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [
+ AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library])
+ ])
+
+ AS_IF([test "x$ax_cv_ncursesw" = xyes], [
+ ax_cv_curses=yes
+ ax_cv_curses_which=ncursesw
+ CURSES_LIBS="$pkg_cv__ax_cv_ncursesw_libs"
+ CURSES_CFLAGS="$pkg_cv__ax_cv_ncursesw_cppflags"
+ AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present])
+ AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
+
+ AC_CACHE_CHECK([for working ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ @%:@define _XOPEN_SOURCE_EXTENDED 1
+ @%:@include <ncursesw/curses.h>
+ ]], [[
+ chtype a = A_BOLD;
+ int b = KEY_LEFT;
+ chtype c = COLOR_PAIR(1) & A_COLOR;
+ attr_t d = WA_NORMAL;
+ cchar_t e;
+ wint_t f;
+ int g = getattrs(stdscr);
+ int h = getcurx(stdscr) + getmaxx(stdscr);
+ initscr();
+ init_pair(1, COLOR_WHITE, COLOR_RED);
+ wattr_set(stdscr, d, 0, NULL);
+ wget_wch(stdscr, &f);
+ ]])],
+ [ax_cv_header_ncursesw_curses_h=yes],
+ [ax_cv_header_ncursesw_curses_h=no])
+ ])
+ AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xyes], [
+ ax_cv_curses_enhanced=yes
+ ax_cv_curses_color=yes
+ ax_cv_curses_obsolete=yes
+ AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
+ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
+ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
+ AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if <ncursesw/curses.h> is present])
+ ])
+
+ AC_CACHE_CHECK([for working ncursesw.h], [ax_cv_header_ncursesw_h], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ @%:@define _XOPEN_SOURCE_EXTENDED 1
+ @%:@include <ncursesw.h>
+ ]], [[
+ chtype a = A_BOLD;
+ int b = KEY_LEFT;
+ chtype c = COLOR_PAIR(1) & A_COLOR;
+ attr_t d = WA_NORMAL;
+ cchar_t e;
+ wint_t f;
+ int g = getattrs(stdscr);
+ int h = getcurx(stdscr) + getmaxx(stdscr);
+ initscr();
+ init_pair(1, COLOR_WHITE, COLOR_RED);
+ wattr_set(stdscr, d, 0, NULL);
+ wget_wch(stdscr, &f);
+ ]])],
+ [ax_cv_header_ncursesw_h=yes],
+ [ax_cv_header_ncursesw_h=no])
+ ])
+ AS_IF([test "x$ax_cv_header_ncursesw_h" = xyes], [
+ ax_cv_curses_enhanced=yes
+ ax_cv_curses_color=yes
+ ax_cv_curses_obsolete=yes
+ AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
+ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
+ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
+ AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if <ncursesw.h> is present])
+ ])
+
+ AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ @%:@define _XOPEN_SOURCE_EXTENDED 1
+ @%:@include <ncurses.h>
+ ]], [[
+ chtype a = A_BOLD;
+ int b = KEY_LEFT;
+ chtype c = COLOR_PAIR(1) & A_COLOR;
+ attr_t d = WA_NORMAL;
+ cchar_t e;
+ wint_t f;
+ int g = getattrs(stdscr);
+ int h = getcurx(stdscr) + getmaxx(stdscr);
+ initscr();
+ init_pair(1, COLOR_WHITE, COLOR_RED);
+ wattr_set(stdscr, d, 0, NULL);
+ wget_wch(stdscr, &f);
+ ]])],
+ [ax_cv_header_ncurses_h_with_ncursesw=yes],
+ [ax_cv_header_ncurses_h_with_ncursesw=no])
+ ])
+ AS_IF([test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes], [
+ ax_cv_curses_enhanced=yes
+ ax_cv_curses_color=yes
+ ax_cv_curses_obsolete=yes
+ AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
+ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
+ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
+ AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if <ncurses.h> is present])
+ ])
+
+ AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno], [
+ AC_MSG_WARN([could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h])
+ ])
+ ])
+ ])
+ unset pkg_cv__ax_cv_ncursesw_libs
+ unset pkg_cv__ax_cv_ncursesw_cppflags
+
+ # Test for Ncurses
+ AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [
+ _FIND_CURSES_FLAGS([ncurses])
+
+ AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [
+ AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library])
+ ])
+
+ AS_IF([test "x$ax_cv_ncurses" = xyes], [
+ ax_cv_curses=yes
+ ax_cv_curses_which=ncurses
+ CURSES_LIBS="$pkg_cv__ax_cv_ncurses_libs"
+ CURSES_CFLAGS="$pkg_cv__ax_cv_ncurses_cppflags"
+ AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present])
+ AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
+
+ AC_CACHE_CHECK([for working ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ @%:@include <ncurses/curses.h>
+ ]], [[
+ chtype a = A_BOLD;
+ int b = KEY_LEFT;
+ chtype c = COLOR_PAIR(1) & A_COLOR;
+ int g = getattrs(stdscr);
+ int h = getcurx(stdscr) + getmaxx(stdscr);
+ initscr();
+ init_pair(1, COLOR_WHITE, COLOR_RED);
+ ]])],
+ [ax_cv_header_ncurses_curses_h=yes],
+ [ax_cv_header_ncurses_curses_h=no])
+ ])
+ AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xyes], [
+ ax_cv_curses_color=yes
+ ax_cv_curses_obsolete=yes
+ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
+ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
+ AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if <ncurses/curses.h> is present])
+ ])
+
+ AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ @%:@include <ncurses.h>
+ ]], [[
+ chtype a = A_BOLD;
+ int b = KEY_LEFT;
+ chtype c = COLOR_PAIR(1) & A_COLOR;
+ int g = getattrs(stdscr);
+ int h = getcurx(stdscr) + getmaxx(stdscr);
+ initscr();
+ init_pair(1, COLOR_WHITE, COLOR_RED);
+ ]])],
+ [ax_cv_header_ncurses_h=yes],
+ [ax_cv_header_ncurses_h=no])
+ ])
+ AS_IF([test "x$ax_cv_header_ncurses_h" = xyes], [
+ ax_cv_curses_color=yes
+ ax_cv_curses_obsolete=yes
+ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
+ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
+ AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if <ncurses.h> is present])
+ ])
+
+ AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [
+ AC_MSG_WARN([could not find a working ncurses/curses.h or ncurses.h])
+ ])
+ ])
+ ])
+ unset pkg_cv__ax_cv_ncurses_libs
+ unset pkg_cv__ax_cv_ncurses_cppflags
+
+ # Test for plain Curses (or if CURSES_LIBS was set by user)
+ AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [
+ AS_IF([test "x$CURSES_LIBS" != x], [
+ LIBS="$ax_saved_LIBS $CURSES_LIBS"
+ ], [
+ LIBS="$ax_saved_LIBS -lcurses"
+ ])
+
+ AC_CACHE_CHECK([for Curses library], [ax_cv_plaincurses], [
+ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
+ [ax_cv_plaincurses=yes], [ax_cv_plaincurses=no])
+ ])
+
+ AS_IF([test "x$ax_cv_plaincurses" = xyes], [
+ ax_cv_curses=yes
+ ax_cv_curses_which=plaincurses
+ AS_IF([test "x$CURSES_LIBS" = x], [
+ CURSES_LIBS="-lcurses"
+ ])
+ AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
+
+ # Check for base conformance (and header file)
+
+ AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ @%:@include <curses.h>
+ ]], [[
+ chtype a = A_BOLD;
+ int b = KEY_LEFT;
+ initscr();
+ ]])],
+ [ax_cv_header_curses_h=yes],
+ [ax_cv_header_curses_h=no])
+ ])
+ AS_IF([test "x$ax_cv_header_curses_h" = xyes], [
+ AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if <curses.h> is present])
+
+ # Check for X/Open Enhanced conformance
+
+ AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ @%:@define _XOPEN_SOURCE_EXTENDED 1
+ @%:@include <curses.h>
+ @%:@ifndef _XOPEN_CURSES
+ @%:@error "this Curses library is not enhanced"
+ "this Curses library is not enhanced"
+ @%:@endif
+ ]], [[
+ chtype a = A_BOLD;
+ int b = KEY_LEFT;
+ chtype c = COLOR_PAIR(1) & A_COLOR;
+ attr_t d = WA_NORMAL;
+ cchar_t e;
+ wint_t f;
+ initscr();
+ init_pair(1, COLOR_WHITE, COLOR_RED);
+ wattr_set(stdscr, d, 0, NULL);
+ wget_wch(stdscr, &f);
+ ]])],
+ [ax_cv_plaincurses_enhanced=yes],
+ [ax_cv_plaincurses_enhanced=no])
+ ])
+ AS_IF([test "x$ax_cv_plaincurses_enhanced" = xyes], [
+ ax_cv_curses_enhanced=yes
+ ax_cv_curses_color=yes
+ AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
+ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
+ ])
+
+ # Check for color functions
+
+ AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ @%:@define _XOPEN_SOURCE_EXTENDED 1
+ @%:@include <curses.h>
+ ]], [[
+ chtype a = A_BOLD;
+ int b = KEY_LEFT;
+ chtype c = COLOR_PAIR(1) & A_COLOR;
+ initscr();
+ init_pair(1, COLOR_WHITE, COLOR_RED);
+ ]])],
+ [ax_cv_plaincurses_color=yes],
+ [ax_cv_plaincurses_color=no])
+ ])
+ AS_IF([test "x$ax_cv_plaincurses_color" = xyes], [
+ ax_cv_curses_color=yes
+ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
+ ])
+
+ # Check for obsolete functions
+
+ AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ @%:@include <curses.h>
+ ]], [[
+ chtype a = A_BOLD;
+ int b = KEY_LEFT;
+ int g = getattrs(stdscr);
+ int h = getcurx(stdscr) + getmaxx(stdscr);
+ initscr();
+ ]])],
+ [ax_cv_plaincurses_obsolete=yes],
+ [ax_cv_plaincurses_obsolete=no])
+ ])
+ AS_IF([test "x$ax_cv_plaincurses_obsolete" = xyes], [
+ ax_cv_curses_obsolete=yes
+ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
+ ])
+ ])
+
+ AS_IF([test "x$ax_cv_header_curses_h" = xno], [
+ AC_MSG_WARN([could not find a working curses.h])
+ ])
+ ])
+ ])
+
+ AS_IF([test "x$ax_cv_curses" != xyes], [ax_cv_curses=no])
+ AS_IF([test "x$ax_cv_curses_enhanced" != xyes], [ax_cv_curses_enhanced=no])
+ AS_IF([test "x$ax_cv_curses_color" != xyes], [ax_cv_curses_color=no])
+ AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no])
+
+ LIBS=$ax_saved_LIBS
+ CPPFLAGS=$ax_saved_CPPFLAGS
+
+ unset ax_saved_LIBS
+ unset ax_saved_CPPFLAGS
+])dnl
diff --git a/sample.teco_ini b/sample.teco_ini
index 2935d95..02c8bcb 100644
--- a/sample.teco_ini
+++ b/sample.teco_ini
@@ -1,18 +1,18 @@
-! TECO.INI !
+!* TECO.INI *!
-! Set default terminal color scheme !
+!* Set default terminal color scheme *!
EMQ[$SCITECOPATH]/color.tes
:EMQ[$SCITECOPATH]/colors/terminal.tes
-! Load lexer and buffer session libraries !
+!* Load lexer and buffer session libraries *!
EMQ[$SCITECOPATH]/lexer.tes
EMQ[$SCITECOPATH]/session.tes
-! Automatic lexing and session management using ED hooks !
+!* Automatic lexing and session management using ED hooks *!
@#ED{
Oadd,edit,close,quit
!add!
- ! Add code here to execute when a document is added !
+ !* Add code here to execute when a document is added *!
:Q*+1Oedit
32,0ED
@@ -21,7 +21,7 @@ EMQ[$SCITECOPATH]/session.tes
M[lexer.auto]
- ! Set up margins !
+ !* Set up margins *!
[_:M[lexer.test.woman]]_"F
33ESTEXTWIDTH9U.w
5*Q.w,0ESSETMARGINWIDTHN
@@ -29,52 +29,58 @@ EMQ[$SCITECOPATH]/session.tes
'
0,32ED
- ! fall through !
+ !* fall through *!
!edit!
- ! Add code here to execute when a document is edited !
+ !* Add code here to execute when a document is edited *!
ESGETCOLUMN,4EJ

!close!
- ! Add code here to execute when a document is closed !
+ !* Add code here to execute when a document is closed *!

!quit!
- ! Add code here to execute when SciTECO quits !
+ !* Add code here to execute when SciTECO quits *!
M[session.save]
}
0,32ED
-! Uncomment to enable automatic case folding !
-! 0,8ED !
+!* Uncomment to enable automatic case folding *!
+!!0,8ED
-! Tweak the default font name and size.
- The size unit is 1pt/100 !
-! [lexer.font]Monospace 1300U[lexer.font] !
+!*
+ * Tweak the default font name and size.
+ * The size unit is 1pt/100
+ *!
+!![lexer.font]Monospace 1300U[lexer.font]
-! Enable default function key macros !
+!* Enable default function key macros *!
EMQ[$SCITECOPATH]/fnkeys.tes
-! Uncomment if terminal supports OSC-52 clipboards !
-! 0,256ED !
+!* Uncomment if terminal supports OSC-52 clipboards *!
+!!0,256ED
-! Uncomment to enable Unicode icons in the Curses UI !
-! 0,512ED !
+!* Uncomment to enable Unicode icons in the Curses UI *!
+!!0,512ED
-! Uncomment to tweak the memory limit !
-! 500*1000*1000,2EJ !
+!* Uncomment to tweak the memory limit *!
+!!500*1000*1000,2EJ
-! If files are given on the command-line, open them
- and disable session saving.
- Otherwise open a buffer session. !
+!*
+ * If files are given on the command-line, open them
+ * and disable session saving.
+ * Otherwise open a buffer session.
+ *!
Z"=
- ! Uncomment to use a separate session per VCS repository or
- working copy (see session.tes): !
- ! M[session.vcs] !
+ !*
+ * Uncomment to use a separate session per VCS repository or
+ * working copy (see session.tes):
+ *!
+ !!M[session.vcs]
M[session.load]
|
- [session.path] ! disables session saving !
+ [session.path] !* disables session saving *!
[.f
<:L;R 0X.f [* EBN.f ]* L>
].f
diff --git a/src/Makefile.am b/src/Makefile.am
index 1e2056e..055cde7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,6 +52,7 @@ libsciteco_base_la_SOURCES = main.c sciteco.h list.h \
help.c help.h \
rb3str.c rb3str.h \
symbols.c symbols.h \
+ lexer.c lexer.h \
view.c view.h \
interface.c interface.h
# NOTE: We cannot link in Scintilla (static library) into
diff --git a/src/core-commands.c b/src/core-commands.c
index 2f473ce..4ee0c5c 100644
--- a/src/core-commands.c
+++ b/src/core-commands.c
@@ -31,6 +31,7 @@
#include "expressions.h"
#include "ring.h"
#include "parser.h"
+#include "lexer.h"
#include "symbols.h"
#include "search.h"
#include "spawn.h"
@@ -1293,7 +1294,8 @@ teco_state_start_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
TECO_DEFINE_STATE_CASEINSENSITIVE(teco_state_start,
.end_of_macro_cb = NULL, /* Allowed at the end of a macro! */
.is_start = TRUE,
- .keymacro_mask = TECO_KEYMACRO_MASK_START | TECO_KEYMACRO_MASK_CASEINSENSITIVE
+ .keymacro_mask = TECO_KEYMACRO_MASK_START | TECO_KEYMACRO_MASK_CASEINSENSITIVE,
+ .style = SCE_SCITECO_COMMAND
);
/*$ F<
@@ -1450,7 +1452,9 @@ teco_state_fcommand_input(teco_machine_main_t *ctx, gunichar chr, GError **error
teco_ascii_toupper(chr), error);
}
-TECO_DEFINE_STATE_CASEINSENSITIVE(teco_state_fcommand);
+TECO_DEFINE_STATE_CASEINSENSITIVE(teco_state_fcommand,
+ .style = SCE_SCITECO_COMMAND
+);
static void
teco_undo_change_dir_action(gchar **dir, gboolean run)
@@ -1657,7 +1661,9 @@ teco_state_condcommand_input(teco_machine_main_t *ctx, gunichar chr, GError **er
return &teco_state_start;
}
-TECO_DEFINE_STATE_CASEINSENSITIVE(teco_state_condcommand);
+TECO_DEFINE_STATE_CASEINSENSITIVE(teco_state_condcommand,
+ .style = SCE_SCITECO_OPERATOR
+);
/*$ ^_ negate
* n^_ -> ~n -- Binary negation
@@ -1984,6 +1990,8 @@ teco_state_control_last_range(teco_machine_main_t *ctx, GError **error)
*
* A common idiom \(lq^SC\(rq can be used for jumping to the
* beginning of the matched pattern or inserted string.
+ * Since the result is always negative, you can use \(lq^SR\(rq
+ * to skip the matched pattern after \fBFK\fP.
*/
static void
teco_state_control_last_length(teco_machine_main_t *ctx, GError **error)
@@ -2055,7 +2063,9 @@ teco_state_control_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
teco_ascii_toupper(chr), error);
}
-TECO_DEFINE_STATE_CASEINSENSITIVE(teco_state_control);
+TECO_DEFINE_STATE_CASEINSENSITIVE(teco_state_control,
+ .style = SCE_SCITECO_COMMAND
+);
static teco_state_t *
teco_state_ascii_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
@@ -2188,7 +2198,8 @@ TECO_DEFINE_STATE_CASEINSENSITIVE(teco_state_escape,
* when it comes to function key macro masking.
*/
.is_start = TRUE,
- .keymacro_mask = TECO_KEYMACRO_MASK_START | TECO_KEYMACRO_MASK_CASEINSENSITIVE
+ .keymacro_mask = TECO_KEYMACRO_MASK_START | TECO_KEYMACRO_MASK_CASEINSENSITIVE,
+ .style = SCE_SCITECO_COMMAND
);
/*$ EF close
@@ -2956,7 +2967,9 @@ teco_state_ecommand_input(teco_machine_main_t *ctx, gunichar chr, GError **error
teco_ascii_toupper(chr), error);
}
-TECO_DEFINE_STATE_CASEINSENSITIVE(teco_state_ecommand);
+TECO_DEFINE_STATE_CASEINSENSITIVE(teco_state_ecommand,
+ .style = SCE_SCITECO_COMMAND
+);
gboolean
teco_state_insert_initial(teco_machine_main_t *ctx, GError **error)
diff --git a/src/doc.c b/src/doc.c
index a1ebe2c..019603a 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -176,7 +176,8 @@ teco_doc_undo_set_string(teco_doc_t *ctx)
* @param str Pointer to a variable to hold the return string.
* It can be NULL if you are interested only in the string's length.
* Strings must be freed via g_free().
- * @param len Where to store the string's length (mandatory).
+ * @param len Where to store the string's length or NULL
+ * if that information is not necessary.
* @param codepage Where to store the document's codepage or NULL
* if that information is not necessary.
*
diff --git a/src/error.h b/src/error.h
index c51f528..021f759 100644
--- a/src/error.h
+++ b/src/error.h
@@ -17,6 +17,7 @@
#pragma once
#include <glib.h>
+#include <gmodule.h>
#include "sciteco.h"
#include "string-utils.h"
@@ -53,6 +54,7 @@ typedef enum {
TECO_ERROR_MEMLIMIT,
TECO_ERROR_CLIPBOARD,
TECO_ERROR_WIN32,
+ TECO_ERROR_MODULE,
/** Interrupt current operation */
TECO_ERROR_INTERRUPTED,
@@ -165,6 +167,13 @@ teco_error_win32_set(GError **error, const gchar *prefix, gint err)
#endif
static inline void
+teco_error_module_set(GError **error, const gchar *prefix)
+{
+ g_set_error(error, TECO_ERROR, TECO_ERROR_MODULE, "%s: %s",
+ prefix, g_module_error());
+}
+
+static inline void
teco_error_interrupted_set(GError **error)
{
g_set_error_literal(error, TECO_ERROR, TECO_ERROR_INTERRUPTED, "Interrupted");
diff --git a/src/goto-commands.c b/src/goto-commands.c
index a8a9689..2035277 100644
--- a/src/goto-commands.c
+++ b/src/goto-commands.c
@@ -27,11 +27,15 @@
#include "string-utils.h"
#include "expressions.h"
#include "parser.h"
+#include "lexer.h"
#include "core-commands.h"
#include "undo.h"
#include "goto.h"
#include "goto-commands.h"
+TECO_DECLARE_STATE(teco_state_blockcomment);
+TECO_DECLARE_STATE(teco_state_eolcomment);
+
teco_string_t teco_goto_skip_label = {NULL, 0};
static gboolean
@@ -45,16 +49,18 @@ teco_state_label_initial(teco_machine_main_t *ctx, GError **error)
* NOTE: The comma is theoretically not allowed in a label
* (see <O> syntax), but is accepted anyway since labels
* are historically used as comments.
- *
- * TODO: Add support for "true" comments of the form !* ... *!
- * This would be almost trivial to implement, but if we don't
- * want any (even temporary) overhead for comments at all, we need
- * to add a new parser state.
- * I'm unsure whether !-signs should be allowed within comments.
+ * SciTECO has true block and EOL comments, though as well.
*/
static teco_state_t *
teco_state_label_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
{
+ if (!ctx->goto_label.len) {
+ switch (chr) {
+ case '*': return &teco_state_blockcomment; /* `!*` */
+ case '!': return &teco_state_eolcomment; /* `!!` */
+ }
+ }
+
if (chr == '!') {
/*
* NOTE: If the label already existed, its PC will be restored
@@ -83,6 +89,12 @@ teco_state_label_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
return &teco_state_start;
}
+ /*
+ * The goto label is collected in parse-only mode as well
+ * since we could jump into a currently dead branch later.
+ *
+ * FIXME: Theoretically, we could avoid that at least in TECO_MODE_LEXING.
+ */
if (ctx->parent.must_undo)
undo__teco_string_truncate(&ctx->goto_label, ctx->goto_label.len);
teco_string_append_wc(&ctx->goto_label, chr);
@@ -90,7 +102,8 @@ teco_state_label_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
}
TECO_DEFINE_STATE(teco_state_label,
- .initial_cb = (teco_state_initial_cb_t)teco_state_label_initial
+ .initial_cb = (teco_state_initial_cb_t)teco_state_label_initial,
+ .style = SCE_SCITECO_LABEL
);
static teco_state_t *
@@ -169,3 +182,40 @@ gboolean teco_state_goto_process_edit_cmd(teco_machine_main_t *ctx, teco_machine
TECO_DEFINE_STATE_EXPECTSTRING(teco_state_goto,
.process_edit_cmd_cb = (teco_state_process_edit_cmd_cb_t)teco_state_goto_process_edit_cmd
);
+
+/*
+ * True comments:
+ * They don't add entries to the goto table.
+ *
+ * NOTE: This still needs some special handling in the Scintilla lexer
+ * (for syntax highlighting) since comments always start with `!`.
+ */
+#define TECO_DEFINE_STATE_COMMENT(NAME, ...) \
+ TECO_DEFINE_STATE(NAME, \
+ .style = SCE_SCITECO_COMMENT, \
+ ##__VA_ARGS__ \
+ )
+
+static teco_state_t *
+teco_state_blockcomment_star_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
+{
+ return chr == '!' ? &teco_state_start : &teco_state_blockcomment;
+}
+
+TECO_DEFINE_STATE_COMMENT(teco_state_blockcomment_star);
+
+static teco_state_t *
+teco_state_blockcomment_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
+{
+ return chr == '*' ? &teco_state_blockcomment_star : &teco_state_blockcomment;
+}
+
+TECO_DEFINE_STATE_COMMENT(teco_state_blockcomment);
+
+static teco_state_t *
+teco_state_eolcomment_input(teco_machine_main_t *ctx, gunichar chr, GError **error)
+{
+ return chr == '\n' ? &teco_state_start : &teco_state_eolcomment;
+}
+
+TECO_DEFINE_STATE_COMMENT(teco_state_eolcomment);
diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c
index 5984bcb..f713bc1 100644
--- a/src/interface-curses/interface.c
+++ b/src/interface-curses/interface.c
@@ -276,7 +276,7 @@ teco_xterm_version(void)
static void
teco_view_scintilla_notify(void *sci, int iMessage, SCNotification *notify, void *user_data)
{
- teco_interface_process_notify(notify);
+ teco_view_process_notify((teco_view_t *)sci, notify);
}
teco_view_t *
@@ -575,13 +575,13 @@ teco_interface_init_screen(void)
if (isatty(1)) {
teco_interface.stdout_orig = dup(1);
g_assert(teco_interface.stdout_orig >= 0);
- FILE *stdout_new = g_freopen("/dev/null", "a+", stdout);
+ G_GNUC_UNUSED FILE *stdout_new = g_freopen("/dev/null", "a+", stdout);
g_assert(stdout_new != NULL);
}
if (isatty(2)) {
teco_interface.stderr_orig = dup(2);
g_assert(teco_interface.stderr_orig >= 0);
- FILE *stderr_new = g_freopen("/dev/null", "a+", stderr);
+ G_GNUC_UNUSED FILE *stderr_new = g_freopen("/dev/null", "a+", stderr);
g_assert(stderr_new != NULL);
}
}
@@ -1706,15 +1706,15 @@ teco_interface_event_loop_iter(void)
return;
#ifdef __PDCURSES__
- /*
- * Especially PDCurses/WinGUI likes to report two keypresses,
- * e.g. for CTRL+Shift+6 (CTRL+^).
- * Make sure we don't filter out AltGr, which may be reported as CTRL+ALT.
- */
- if ((PDC_get_key_modifiers() &
- (PDC_KEY_MODIFIER_CONTROL | PDC_KEY_MODIFIER_ALT)) == PDC_KEY_MODIFIER_CONTROL &&
- !TECO_IS_CTL(key))
- return;
+ /*
+ * Especially PDCurses/WinGUI likes to report two keypresses,
+ * e.g. for CTRL+Shift+6 (CTRL+^).
+ * Make sure we don't filter out AltGr, which may be reported as CTRL+ALT.
+ */
+ if ((PDC_get_key_modifiers() &
+ (PDC_KEY_MODIFIER_CONTROL | PDC_KEY_MODIFIER_ALT)) == PDC_KEY_MODIFIER_CONTROL &&
+ !TECO_IS_CTL(key))
+ return;
#endif
/*
@@ -1723,10 +1723,10 @@ teco_interface_event_loop_iter(void)
*/
keybuf[keybuf_i++] = key;
gsize len = keybuf_i;
- gunichar cp = g_utf8_get_char_validated(keybuf, len);
- if (keybuf_i >= sizeof(keybuf) || cp != (gunichar)-2)
+ gint32 cp = *keybuf ? g_utf8_get_char_validated(keybuf, len) : 0;
+ if (keybuf_i >= sizeof(keybuf) || cp != -2)
keybuf_i = 0;
- if ((gint32)cp < 0)
+ if (cp < 0)
/* incomplete or invalid */
return;
switch (teco_cmdline_keymacro(keybuf, len, error)) {
diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c
index 829310a..0dbd2ba 100644
--- a/src/interface-gtk/interface.c
+++ b/src/interface-gtk/interface.c
@@ -112,7 +112,7 @@ static void
teco_view_scintilla_notify(ScintillaObject *sci, gint iMessage,
SCNotification *notify, gpointer user_data)
{
- teco_interface_process_notify(notify);
+ teco_view_process_notify((teco_view_t *)sci, notify);
}
teco_view_t *
diff --git a/src/interface.c b/src/interface.c
index 2e2d64e..2973dd2 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -110,11 +110,3 @@ teco_interface_stdio_vmsg(teco_msg_t type, const gchar *fmt, va_list ap)
g_vfprintf(stream, fmt, ap);
fputc('\n', stream);
}
-
-void
-teco_interface_process_notify(SCNotification *notify)
-{
-#ifdef DEBUG
- g_printf("SCINTILLA NOTIFY: code=%d\n", notify->nmhdr.code);
-#endif
-}
diff --git a/src/interface.h b/src/interface.h
index 32db6b5..80da8d9 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -149,7 +149,6 @@ gboolean teco_interface_event_loop(GError **error);
*/
/** @protected */
void teco_interface_stdio_vmsg(teco_msg_t type, const gchar *fmt, va_list ap);
-void teco_interface_process_notify(SCNotification *notify);
/** @pure */
void teco_interface_cleanup(void);
diff --git a/src/lexer.c b/src/lexer.c
new file mode 100644
index 0000000..c0c7847
--- /dev/null
+++ b/src/lexer.c
@@ -0,0 +1,250 @@
+/*
+ * Copyright (C) 2012-2024 Robin Haberkorn
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <string.h>
+
+#include <glib.h>
+
+#include "sciteco.h"
+#include "view.h"
+#include "parser.h"
+#include "lexer.h"
+
+static teco_style_t
+teco_lexer_getstyle(teco_view_t *view, teco_machine_main_t *machine,
+ gunichar chr)
+{
+ teco_style_t style = machine->parent.current->style;
+
+ /*
+ * FIXME: At least this special workaround for numbers might be
+ * unnecessary once we get a special parser state for parsing numbers.
+ *
+ * FIXME: What about ^* and ^/?
+ * They are currently highlighted as commands.
+ */
+ if (machine->parent.current->keymacro_mask & TECO_KEYMACRO_MASK_START &&
+ chr <= 0xFF) {
+ if (g_ascii_isdigit(chr))
+ style = SCE_SCITECO_NUMBER;
+ else if (strchr("+-*/#&", chr))
+ style = SCE_SCITECO_OPERATOR;
+ }
+
+ /*
+ * FIXME: Perhaps as an optional lexer property, we should support
+ * styling commands with SCE_SCITECO_DEFAULT or SCE_SCITECO_COMMAND
+ * in alternating order, so you can discern chains of commands.
+ */
+ if (!teco_machine_input(&machine->parent, chr, NULL)) {
+ /*
+ * Probably a syntax error, so the erroneous symbol
+ * is highlighted and we reset the parser's state machine.
+ *
+ * FIXME: Perhaps we should simply reset the state to teco_state_start?
+ */
+ gsize macro_pc = machine->macro_pc;
+ teco_machine_main_clear(machine);
+ teco_machine_main_init(machine, NULL, FALSE);
+ machine->mode = TECO_MODE_LEXING;
+ machine->macro_pc = macro_pc;
+
+ return SCE_SCITECO_INVALID;
+ }
+
+ /*
+ * Don't highlight the leading `!` in comments as SCE_SCITECO_COMMAND.
+ * True comments also begin with `!`, so make sure they are highlighted
+ * already from the second character.
+ * This is then extended back by one character in teco_lexer_step().
+ */
+ switch (machine->parent.current->style) {
+ case SCE_SCITECO_COMMENT:
+ case SCE_SCITECO_LABEL:
+ return machine->parent.current->style;
+ default:
+ break;
+ }
+
+ return style;
+}
+
+static void
+teco_lexer_step(teco_view_t *view, teco_machine_main_t *machine,
+ teco_machine_main_t *macrodef_machine,
+ const gchar *macro, gsize start, gsize max_len,
+ guint *cur_line, guint *cur_col, gint *safe_col)
+{
+ if (*cur_line == 0 && *cur_col == 0 && *macro == '#') {
+ /* hash-bang line */
+ machine->macro_pc = teco_view_ssm(view, SCI_POSITIONFROMLINE, 1, 0);
+ teco_view_ssm(view, SCI_STARTSTYLING, 0, 0);
+ teco_view_ssm(view, SCI_SETSTYLING, machine->macro_pc, SCE_SCITECO_COMMENT);
+ teco_view_ssm(view, SCI_SETLINESTATE, 0, -1);
+ (*cur_line)++;
+ *safe_col = 0;
+ return;
+ }
+
+ gssize old_pc = machine->macro_pc;
+
+ teco_style_t style = SCE_SCITECO_DEFAULT;
+
+ /*
+ * g_utf8_get_char_validated() sometimes(?) returns -2 for "\0".
+ */
+ gint32 chr = macro[machine->macro_pc]
+ ? g_utf8_get_char_validated(macro+machine->macro_pc,
+ max_len-machine->macro_pc) : 0;
+ if (chr < 0) {
+ /*
+ * Invalid UTF-8 byte sequence:
+ * A source file could contain all sorts of data garbage or
+ * you could manually M[lexer.set.sciteco] on an ANSI-encoded file.
+ */
+ machine->macro_pc++;
+ style = SCE_SCITECO_INVALID;
+ } else {
+ machine->macro_pc = g_utf8_next_char(macro+machine->macro_pc) - macro;
+
+ gunichar escape_char = machine->expectstring.machine.escape_char;
+ style = teco_lexer_getstyle(view, machine, chr);
+
+ /*
+ * Optionally style @^Uq{ ... } contents like macro definitions.
+ * The curly braces will be styled like regular commands.
+ *
+ * FIXME: This will not work with nested macro definitions.
+ * FIXME: This cannot currently be disabled since SCI_SETPROPERTY
+ * cannot be accessed with ES.
+ * We could only map it to an ED flag.
+ */
+ if ((escape_char == '{' || machine->expectstring.machine.escape_char == '{') &&
+ teco_view_ssm(view, SCI_GETPROPERTYINT, (uptr_t)"lexer.sciteco.macrodef", TRUE))
+ style = teco_lexer_getstyle(view, macrodef_machine, chr);
+ }
+
+ *cur_col += machine->macro_pc - old_pc;
+
+ /*
+ * True comments begin with `!*` or `!!`, but only the second character gets
+ * the correct style by default, so we extend it backwards.
+ */
+ if (style == SCE_SCITECO_COMMENT)
+ old_pc--;
+
+ teco_view_ssm(view, SCI_STARTSTYLING, start+old_pc, 0);
+ teco_view_ssm(view, SCI_SETSTYLING, machine->macro_pc-old_pc, style);
+
+ if (chr == '\n') {
+ /* update line state to the last column with a clean start state */
+ teco_view_ssm(view, SCI_SETLINESTATE, *cur_line, *safe_col);
+ (*cur_line)++;
+ *cur_col = 0;
+ *safe_col = -1; /* no clean state by default */
+ }
+
+ if (style != SCE_SCITECO_INVALID &&
+ machine->parent.current->keymacro_mask & TECO_KEYMACRO_MASK_START &&
+ !machine->modifier_at)
+ /* clean parser state */
+ *safe_col = *cur_col;
+}
+
+/**
+ * Style SciTECO source code, i.e. perform syntax highlighting
+ * for the SciTECO language.
+ *
+ * @para view The Scintilla view to operate on.
+ * @para end The position in bytes where to stop styling.
+ */
+void
+teco_lexer_style(teco_view_t *view, gsize end)
+{
+ /* should always be TRUE */
+ gboolean old_undo_enabled = teco_undo_enabled;
+ teco_undo_enabled = FALSE;
+
+ gsize start = teco_view_ssm(view, SCI_GETENDSTYLED, 0, 0);
+ guint start_line = teco_view_ssm(view, SCI_LINEFROMPOSITION, start, 0);
+ gint start_col = 0;
+
+ /*
+ * The line state stores the laster character (column) in bytes,
+ * that starts from a fresh parser state.
+ * It's -1 if the line does not have a clean parser state.
+ * Therefore we search for the first line before `start` that has a
+ * known clean parser state.
+ */
+ if (start_line > 0) {
+ do
+ start_line--;
+ while ((start_col = teco_view_ssm(view, SCI_GETLINESTATE, start_line, 0)) < 0 &&
+ start_line > 0);
+ start_col = MAX(start_col, 0);
+ }
+ start = teco_view_ssm(view, SCI_POSITIONFROMLINE, start_line, 0) + start_col;
+ g_assert(end > start);
+
+ g_auto(teco_machine_main_t) machine;
+ teco_machine_main_init(&machine, NULL, FALSE);
+ machine.mode = TECO_MODE_LEXING;
+
+ /* for lexing the contents of @^Uq{...} */
+ g_auto(teco_machine_main_t) macrodef_machine;
+ teco_machine_main_init(&macrodef_machine, NULL, FALSE);
+ macrodef_machine.mode = TECO_MODE_LEXING;
+
+ g_assert(start_col >= 0);
+ guint col = start_col;
+
+ /*
+ * NOTE: We could have also used teco_view_get_character(),
+ * but this will use much less Scintilla messages without
+ * removing dot.
+ */
+ const gchar *macro;
+ sptr_t gap = teco_view_ssm(view, SCI_GETGAPPOSITION, 0, 0);
+ if (start < gap && gap < end) {
+ macro = (const gchar *)teco_view_ssm(view, SCI_GETRANGEPOINTER, start, gap);
+ while (machine.macro_pc < gap-start)
+ teco_lexer_step(view, &machine, &macrodef_machine,
+ macro, start, gap-start,
+ &start_line, &col, &start_col);
+ /*
+ * This might have lexed more than gap-start bytes
+ * (e.g. a hash-bang line)
+ */
+ start += machine.macro_pc;
+ }
+
+ macro = (const gchar *)teco_view_ssm(view, SCI_GETRANGEPOINTER, start, end-start);
+ machine.macro_pc = 0;
+ while (machine.macro_pc < end-start)
+ teco_lexer_step(view, &machine, &macrodef_machine,
+ macro, start, end-start,
+ &start_line, &col, &start_col);
+
+ /* set line state on the very last line */
+ teco_view_ssm(view, SCI_SETLINESTATE, start_line, start_col);
+
+ teco_undo_enabled = old_undo_enabled;
+}
diff --git a/src/lexer.h b/src/lexer.h
new file mode 100644
index 0000000..87b0d0f
--- /dev/null
+++ b/src/lexer.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2012-2024 Robin Haberkorn
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+#include <glib.h>
+
+#include "view.h"
+
+/** Scintilla style ids for lexing SciTECO code */
+typedef enum {
+ SCE_SCITECO_DEFAULT = 0,
+ SCE_SCITECO_COMMAND = 1,
+ SCE_SCITECO_OPERATOR = 2,
+ SCE_SCITECO_QREG = 3,
+ SCE_SCITECO_STRING = 4,
+ SCE_SCITECO_NUMBER = 5,
+ SCE_SCITECO_LABEL = 6,
+ SCE_SCITECO_COMMENT = 7,
+ SCE_SCITECO_INVALID = 8
+} teco_style_t;
+
+void teco_lexer_style(teco_view_t *view, gsize end);
diff --git a/src/parser.h b/src/parser.h
index 20f73fb..7ca5ab3 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -27,6 +27,7 @@
#include "goto.h"
#include "undo.h"
#include "qreg.h"
+#include "lexer.h"
/*
* Forward Declarations
@@ -203,6 +204,12 @@ struct teco_state_t {
teco_keymacro_mask_t keymacro_mask : 8;
/**
+ * Scintilla style to apply to all input characters in this state
+ * when syntax highlighting SciTECO code.
+ */
+ teco_style_t style : 8;
+
+ /**
* Additional state-dependent callbacks and settings.
* This wastes some bytes compared to other techniques for extending teco_state_t
* but this is acceptable since there is only a limited number of constant instances.
@@ -241,6 +248,7 @@ gboolean teco_state_process_edit_cmd(teco_machine_t *ctx, teco_machine_t *parent
.process_edit_cmd_cb = teco_state_process_edit_cmd, \
.is_start = FALSE, \
.keymacro_mask = TECO_KEYMACRO_MASK_DEFAULT, \
+ .style = SCE_SCITECO_DEFAULT, \
##__VA_ARGS__ \
}
@@ -441,7 +449,9 @@ typedef enum {
/** Parse, but don't execute until reaching end of conditional or its else-clause */
TECO_MODE_PARSE_ONLY_COND,
/** Parse, but don't execute until reaching the very end of conditional */
- TECO_MODE_PARSE_ONLY_COND_FORCE
+ TECO_MODE_PARSE_ONLY_COND_FORCE,
+ /** Parse, but don't execute until end of macro (for Scintilla lexing) */
+ TECO_MODE_LEXING
} teco_mode_t;
/** @extends teco_machine_t */
@@ -568,6 +578,7 @@ gboolean teco_state_expectstring_process_edit_cmd(teco_machine_main_t *ctx, teco
.process_edit_cmd_cb = (teco_state_process_edit_cmd_cb_t) \
teco_state_expectstring_process_edit_cmd, \
.keymacro_mask = TECO_KEYMACRO_MASK_STRING, \
+ .style = SCE_SCITECO_STRING, \
.expectstring.string_building = TRUE, \
.expectstring.last = TRUE, \
.expectstring.process_cb = NULL, /* do nothing */ \
diff --git a/src/qreg-commands.h b/src/qreg-commands.h
index 27a6a5c..d999587 100644
--- a/src/qreg-commands.h
+++ b/src/qreg-commands.h
@@ -20,6 +20,7 @@
#include "sciteco.h"
#include "parser.h"
+#include "lexer.h"
#include "qreg.h"
static inline void
@@ -55,6 +56,7 @@ gboolean teco_state_expectqreg_process_edit_cmd(teco_machine_main_t *ctx, teco_m
.initial_cb = (teco_state_initial_cb_t)teco_state_expectqreg_initial, \
.process_edit_cmd_cb = (teco_state_process_edit_cmd_cb_t) \
teco_state_expectqreg_process_edit_cmd, \
+ .style = SCE_SCITECO_QREG, \
.expectqreg.type = TECO_QREG_REQUIRED, \
.expectqreg.got_register_cb = NAME##_got_register, /* always required */ \
##__VA_ARGS__ \
diff --git a/src/qreg.c b/src/qreg.c
index 061b685..271e7cb 100644
--- a/src/qreg.c
+++ b/src/qreg.c
@@ -539,7 +539,7 @@ teco_qreg_external_get_character(teco_qreg_t *qreg, teco_int_t position,
* The sign bit in UCS-4/UTF-32 is unused, so this will even
* suffice if TECO_INTEGER == 32.
*/
- *chr = (gint32)g_utf8_get_char_validated(p, -1);
+ *chr = *p ? (gint32)g_utf8_get_char_validated(p, -1) : 0;
return TRUE;
}
@@ -665,9 +665,6 @@ teco_qreg_bufferinfo_append_string(teco_qreg_t *qreg, const gchar *str, gsize le
return FALSE;
}
-/*
- * NOTE: The `string` component is currently unused on the "*" register.
- */
static gboolean
teco_qreg_bufferinfo_get_string(teco_qreg_t *qreg, gchar **str, gsize *len,
guint *codepage, GError **error)
@@ -684,7 +681,8 @@ teco_qreg_bufferinfo_get_string(teco_qreg_t *qreg, gchar **str, gsize *len,
/*
* NOTE: teco_file_normalize_path() does not change the size of the string.
*/
- *len = teco_ring_current->filename ? strlen(teco_ring_current->filename) : 0;
+ if (len)
+ *len = teco_ring_current->filename ? strlen(teco_ring_current->filename) : 0;
if (codepage)
*codepage = teco_default_codepage();
return TRUE;
@@ -775,7 +773,8 @@ teco_qreg_workingdir_get_string(teco_qreg_t *qreg, gchar **str, gsize *len,
* the return value for str == NULL is still correct.
*/
gchar *dir = g_get_current_dir();
- *len = strlen(dir);
+ if (len)
+ *len = strlen(dir);
if (str)
*str = teco_file_normalize_path(dir);
else
@@ -919,11 +918,12 @@ teco_qreg_clipboard_get_string(teco_qreg_t *qreg, gchar **str, gsize *len,
&str_converted.len, error) == G_IO_STATUS_ERROR)
return FALSE;
+ if (len)
+ *len = str_converted.len;
if (str)
*str = str_converted.data;
else
teco_string_clear(&str_converted);
- *len = str_converted.len;
if (codepage)
*codepage = teco_default_codepage();
diff --git a/src/search.c b/src/search.c
index e05a6b9..1945f5c 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1075,18 +1075,24 @@ teco_state_search_kill_done(teco_machine_main_t *ctx, const teco_string_t *str,
if (teco_search_parameters.dot < dot) {
/* kill forwards */
sptr_t anchor = teco_interface_ssm(SCI_GETANCHOR, 0, 0);
+ gsize len = anchor - teco_search_parameters.dot;
if (teco_current_doc_must_undo())
undo__teco_interface_ssm(SCI_GOTOPOS, dot, 0);
teco_interface_ssm(SCI_GOTOPOS, anchor, 0);
- teco_interface_ssm(SCI_DELETERANGE, teco_search_parameters.dot,
- anchor - teco_search_parameters.dot);
+ teco_interface_ssm(SCI_DELETERANGE, teco_search_parameters.dot, len);
/* NOTE: An undo action is not always created. */
if (teco_current_doc_must_undo() &&
teco_search_parameters.dot != anchor)
undo__teco_interface_ssm(SCI_UNDO, 0, 0);
+
+ /* fix up ranges (^Y) */
+ for (guint i = 0; i < teco_ranges_count; i++) {
+ teco_ranges[i].from -= len;
+ teco_ranges[i].to -= len;
+ }
} else {
/* kill backwards */
teco_interface_ssm(SCI_DELETERANGE, dot, teco_search_parameters.dot - dot);
@@ -1113,7 +1119,7 @@ teco_state_search_kill_done(teco_machine_main_t *ctx, const teco_string_t *str,
* from,to:FK[pattern]$ -> Success|Failure
*
* \fBFK\fP searches for <pattern> just like the regular search
- * command (\fBS\fP) but when found deletes all text from dot
+ * command (\fBS\fP) but when found, deletes all text from dot
* up to but not including the found text instance.
* When searching backwards the characters beginning after
* the occurrence of <pattern> up to dot are deleted.
diff --git a/src/symbols.c b/src/symbols.c
index 944d01d..7198639 100644
--- a/src/symbols.c
+++ b/src/symbols.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <glib.h>
+#include <gmodule.h>
#include <Scintilla.h>
#ifdef HAVE_LEXILLA
@@ -288,6 +289,27 @@ gboolean teco_state_scintilla_symbols_process_edit_cmd(teco_machine_main_t *ctx,
* Lexilla lexer name as a string argument for the \fBSCI_SETILEXER\fP
* message, i.e. in order to load a Lexilla lexer
* (this works similar to the old \fBSCI_SETLEXERLANGUAGE\fP message).
+ * If the lexer name contains a null-byte, the second string
+ * argument is split into two:
+ * Up until the null-byte, the path of an external lexer library
+ * (shared library or DLL) is expected,
+ * that implements the Lexilla protocol.
+ * The \(lq.so\(rq or \(lq.dll\(rq extension is optional.
+ * The concrete lexer name is the remaining of the string after
+ * the null-byte.
+ * This allows you to use lexers from external lexer libraries
+ * like Scintillua.
+ * When detecting Scintillua, \*(ST will automatically pass down
+ * the \fBSCITECO_SCINTILLUA_LEXERS\fP environment variable as
+ * the \(lqscintillua.lexers\(rq library property for specifying
+ * the location of Scintillua's Lua lexer files.
+ *
+ * In order to facilitate the use of Scintillua lexers, the semantics
+ * of \fBSCI_NAMEOFSTYLE\fP have also been changed.
+ * Instead of returning the name for a given style id, it now
+ * returns the style id when given the name of a style in the
+ * second string argument of \fBES\fP, i.e. it allows you
+ * to look up style ids by name.
*
* .BR Warning :
* Almost all Scintilla messages may be dispatched using
@@ -321,24 +343,94 @@ teco_state_scintilla_lparam_done(teco_machine_main_t *ctx, const teco_string_t *
sptr_t lParam = 0;
-#ifdef HAVE_LEXILLA
- if (ctx->scintilla.iMessage == SCI_SETILEXER) {
+ if (ctx->scintilla.iMessage == SCI_NAMEOFSTYLE) {
+ /*
+ * FIXME: This customized version of SCI_NAMEOFSTYLE could be avoided
+ * if we had a way to call Scintilla messages that return strings into
+ * Q-Registers.
+ */
if (teco_string_contains(str, '\0')) {
g_set_error_literal(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Lexer name must not contain null-byte.");
+ "Style name must not contain null-byte.");
return NULL;
}
- const gchar *lexer = str->data ? : "";
- lParam = (sptr_t)CreateLexer(lexer);
+ /*
+ * FIXME: Should we cache the name to style id?
+ */
+ guint count = teco_interface_ssm(SCI_GETNAMEDSTYLES, 0, 0);
+ for (guint id = 0; id < count; id++) {
+ gchar style[128] = "";
+ teco_interface_ssm(SCI_NAMEOFSTYLE, id, (sptr_t)style);
+ if (!teco_string_cmp(str, style, strlen(style))) {
+ teco_expressions_push(id);
+ return &teco_state_start;
+ }
+ }
+
+ g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
+ "Style name \"%s\" not found.", str->data ? : "");
+ return NULL;
+ }
+#ifdef HAVE_LEXILLA
+ else if (ctx->scintilla.iMessage == SCI_SETILEXER) {
+ CreateLexerFn CreateLexerFn = CreateLexer;
+
+ const gchar *lexer = memchr(str->data ? : "", '\0', str->len);
+ if (lexer) {
+ /* external lexer */
+ lexer++;
+
+ /*
+ * NOTE: The same module can be opened multiple times.
+ * They are internally reference counted.
+ */
+ GModule *module = g_module_open(str->data, G_MODULE_BIND_LAZY);
+ if (!module) {
+ teco_error_module_set(error, "Error opening lexer module");
+ return NULL;
+ }
+
+ GetNameSpaceFn GetNameSpaceFn;
+ SetLibraryPropertyFn SetLibraryPropertyFn;
+
+ if (!g_module_symbol(module, LEXILLA_GETNAMESPACE, (gpointer *)&GetNameSpaceFn) ||
+ !g_module_symbol(module, LEXILLA_SETLIBRARYPROPERTY, (gpointer *)&SetLibraryPropertyFn) ||
+ !g_module_symbol(module, LEXILLA_CREATELEXER, (gpointer *)&CreateLexerFn)) {
+ teco_error_module_set(error, "Cannot find lexer function");
+ return NULL;
+ }
+
+ if (!g_strcmp0(GetNameSpaceFn(), "scintillua")) {
+ /*
+ * Scintillua's lexer directory must be configured before calling CreateLexer().
+ *
+ * FIXME: In Scintillua distributions, the lexers are usually contained in the
+ * same directory as the prebuilt shared libraries.
+ * Perhaps we should default scintillua.lexers to the dirname in str->data?
+ */
+ teco_qreg_t *reg = teco_qreg_table_find(&teco_qreg_table_globals, "$SCITECO_SCINTILLUA_LEXERS", 26);
+ if (reg) {
+ teco_string_t dir;
+ if (!reg->vtable->get_string(reg, &dir.data, &dir.len, NULL, error))
+ return NULL;
+ SetLibraryPropertyFn("scintillua.lexers", dir.data ? : "");
+ }
+ }
+ } else {
+ /* Lexilla lexer */
+ lexer = str->data ? : "";
+ }
+
+ lParam = (sptr_t)CreateLexerFn(lexer);
if (!lParam) {
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Lexilla lexer \"%s\" not found.", lexer);
+ "Lexer \"%s\" not found.", lexer);
return NULL;
}
- } else
+ }
#endif
- if (str->len > 0) {
+ else if (str->len > 0) {
/*
* NOTE: There may even be messages that read strings
* with embedded nulls.
diff --git a/src/view.c b/src/view.c
index 7cdc987..b8c72a5 100644
--- a/src/view.c
+++ b/src/view.c
@@ -46,6 +46,7 @@
#include "qreg.h"
#include "eol.h"
#include "memory.h"
+#include "lexer.h"
#include "view.h"
/** @memberof teco_view_t */
@@ -205,9 +206,24 @@ teco_view_set_representations(teco_view_t *ctx)
gboolean
teco_view_load_from_channel(teco_view_t *ctx, GIOChannel *channel, GError **error)
{
+ gboolean ret = TRUE;
+
g_auto(teco_eol_reader_t) reader;
teco_eol_reader_init_gio(&reader, channel);
+ /*
+ * Temporarily disable the line character index.
+ * This tremendously speeds up reading UTF-8 documents.
+ * The reason is, that UTF-8 consistency checks are rather
+ * costly. Also, when reading in chunks of 1024 bytes,
+ * we can very well add incomplete UTF-8 sequences,
+ * resulting in unnecessary recalculations of the line index.
+ */
+ guint cp = teco_view_get_codepage(ctx);
+ if (cp == SC_CP_UTF8)
+ teco_interface_ssm(SCI_RELEASELINECHARACTERINDEX,
+ SC_LINECHARACTERINDEX_UTF32, 0);
+
teco_view_ssm(ctx, SCI_BEGINUNDOACTION, 0, 0);
teco_view_ssm(ctx, SCI_CLEARALL, 0, 0);
@@ -221,8 +237,9 @@ teco_view_load_from_channel(teco_view_t *ctx, GIOChannel *channel, GError **erro
struct stat stat_buf = {.st_size = 0};
if (!fstat(g_io_channel_unix_get_fd(channel), &stat_buf) &&
stat_buf.st_size > 0) {
- if (!teco_memory_check(stat_buf.st_size, error))
- goto error;
+ ret = teco_memory_check(stat_buf.st_size, error);
+ if (!ret)
+ goto cleanup;
teco_view_ssm(ctx, SCI_ALLOCATE, stat_buf.st_size, 0);
}
@@ -234,8 +251,10 @@ teco_view_load_from_channel(teco_view_t *ctx, GIOChannel *channel, GError **erro
teco_string_t str;
GIOStatus rc = teco_eol_reader_convert(&reader, &str.data, &str.len, error);
- if (rc == G_IO_STATUS_ERROR)
- goto error;
+ if (rc == G_IO_STATUS_ERROR) {
+ ret = FALSE;
+ goto cleanup;
+ }
if (rc == G_IO_STATUS_EOF)
break;
@@ -245,12 +264,14 @@ teco_view_load_from_channel(teco_view_t *ctx, GIOChannel *channel, GError **erro
* Even if we checked initially, knowing the file size,
* Scintilla could allocate much more bytes.
*/
- if (!teco_memory_check(0, error))
- goto error;
+ ret = teco_memory_check(0, error);
+ if (!ret)
+ goto cleanup;
if (G_UNLIKELY(teco_interface_is_interrupted())) {
teco_error_interrupted_set(error);
- goto error;
+ ret = FALSE;
+ goto cleanup;
}
}
@@ -271,12 +292,14 @@ teco_view_load_from_channel(teco_view_t *ctx, GIOChannel *channel, GError **erro
teco_interface_msg(TECO_MSG_WARNING,
"Inconsistent EOL styles normalized");
+cleanup:
teco_view_ssm(ctx, SCI_ENDUNDOACTION, 0, 0);
- return TRUE;
-error:
- teco_view_ssm(ctx, SCI_ENDUNDOACTION, 0, 0);
- return FALSE;
+ if (cp == SC_CP_UTF8)
+ teco_interface_ssm(SCI_ALLOCATELINECHARACTERINDEX,
+ SC_LINECHARACTERINDEX_UTF32, 0);
+
+ return ret;
}
/**
@@ -634,5 +657,24 @@ teco_view_get_character(teco_view_t *ctx, gsize pos, gsize len)
* The sign bit in UCS-4/UTF-32 is unused, so this will even
* suffice if TECO_INTEGER == 32.
*/
- return (gint32)g_utf8_get_char_validated(buf, -1);
+ return *buf ? (gint32)g_utf8_get_char_validated(buf, -1) : 0;
+}
+
+void
+teco_view_process_notify(teco_view_t *ctx, SCNotification *notify)
+{
+#ifdef DEBUG
+ g_printf("SCINTILLA NOTIFY: code=%d\n", notify->nmhdr.code);
+#endif
+
+ /*
+ * Lexing in the container: only used for SciTECO.
+ *
+ * The "identifier" is abused to enable/disable lexing.
+ * It could be extended later on for several internal lexers.
+ * The alternative would be an ILexer5 wrapper, written in C++.
+ */
+ if (notify->nmhdr.code == SCN_STYLENEEDED &&
+ teco_view_ssm(ctx, SCI_GETIDENTIFIER, 0, 0) != 0)
+ teco_lexer_style(ctx, notify->position);
}
diff --git a/src/view.h b/src/view.h
index 8f54fdd..eebafbf 100644
--- a/src/view.h
+++ b/src/view.h
@@ -83,3 +83,5 @@ teco_int_t teco_view_bytes2glyphs(teco_view_t *ctx, gsize pos);
gssize teco_view_glyphs2bytes_relative(teco_view_t *ctx, gsize pos, teco_int_t n);
teco_int_t teco_view_get_character(teco_view_t *ctx, gsize pos, gsize len);
+
+void teco_view_process_notify(teco_view_t *ctx, SCNotification *notify);
diff --git a/tests/testsuite.at b/tests/testsuite.at
index ffb3941..f17a711 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -244,6 +244,15 @@ AT_CHECK([$SCITECO -e '@I/^E@a/'], 0, ignore, ignore)
AT_CHECK([$SCITECO -e '@I/^ENa/'], 0, ignore, ignore)
AT_CLEANUP
+AT_SETUP([Setting special Q-Registers with EU])
+# NOTE: The clipboard registers also suffered from this, but the test suite
+# should not influence the clipboard (and it's not in Curses anyway).
+#
+# Should fail, but not crash
+AT_CHECK([$SCITECO -e '@EU*""'], 1, ignore, ignore)
+AT_CHECK([$SCITECO -e '@EU$"."'], 0, ignore, ignore)
+AT_CLEANUP
+
AT_SETUP([Empty help topic])
AT_CHECK([$SCITECO -e '@?//'], 1, ignore, ignore)
AT_CLEANUP