aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/lexer.tes
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-22 05:31:31 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-22 05:31:31 +0100
commit427c9d16ce7e62cbe2671748cd8434132ce60482 (patch)
treeb3b4657c8178dcc9308790abaa1c2cf9bbc4c09b /lib/lexer.tes
parent28fd3dbdc831f28c91d521e1804a9d9ff5bbf3db (diff)
downloadsciteco-427c9d16ce7e62cbe2671748cd8434132ce60482.tar.gz
added globbing command EN
* implements the same globbing as the EB command already did * uses Globber helper class that behaves more like UNIX glob(). glib only has a glob-style pattern matcher. * The Globber class may be extended later to provide more UNIX-like globbing. * lexer.tes has been updated to make use of globbing. Now, lexers can be automatically loaded and registered at startup. To install a new lexer, it's sufficient to copy a file to the lexers/ directory.
Diffstat (limited to 'lib/lexer.tes')
-rw-r--r--lib/lexer.tes21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/lexer.tes b/lib/lexer.tes
index 01c3bf1..0a4622c 100644
--- a/lib/lexer.tes
+++ b/lib/lexer.tes
@@ -19,14 +19,19 @@
:M[color.error],35M[color.set]
}
-! individual tests are appended by the lexers/*.tes files !
-EMQ[$SCITECOPATH]/lexers/batch.tes
-EMQ[$SCITECOPATH]/lexers/cmake.tes
-EMQ[$SCITECOPATH]/lexers/cpp.tes
-EMQ[$SCITECOPATH]/lexers/make.tes
-EMQ[$SCITECOPATH]/lexers/patch.tes
-EMQ[$SCITECOPATH]/lexers/sh.tes
-EMQ[$SCITECOPATH]/lexers/xml.tes
+! Automatically mung all the lexers and them to "lexer.auto" !
+Q*U.#cd EQ.[lexers]
+ENQ[$SCITECOPATH]/lexers/*.tes J
+<:L;R
+ 0X.[filename] .-4U.p -S/ .,Q.pX.[name]
+ EMQ.[filename]
+ EQ[lexer.auto] ZJ
+ @I{
+ :M[lexer.test.Q.[name]]"S :M[lexer.set.Q.[name]] Oend '
+ }
+ EQ.[lexers]
+L>
+Q.#cdEB
! append an "end" label !
:[lexer.auto]!end!