This is a library that provides an abstract ForTheL lexer that is independent of concrete character encodings, position types, syntax highlighting specifications etc. and can thus be used as a generic basis for a wide range of ForTheL parsing frameworks.
-
-
If you already have a file called
cabal.project
in your project directory, addhttps://github.com/McEarl/ftlex/archive/refs/tags/v0.3.0.tar.gz
topackages
there. -
Otherwise, create a new file
cabal.project
that contains the following lines:packages: ./*.cabal https://github.com/McEarl/ftlex/archive/refs/tags/v0.3.0.tar.gz
-
-
Add
ftlex
tobuild-depends
in your<package name>.cabal
.
-
Add
https://github.com/McEarl/ftlex/archive/refs/tags/v0.3.0.tar.gz
toextra-deps
in yourstack.yaml
. -
Add
ftlex
todependencies
in yourpackage.yaml
.
-
The following character encodings are supported for the input text:
- UTF-8
- UTF-16 (little endian)
- UTF-16 (big endian)
- UTF-32 (little endian)
- UTF-32 (big endian)
-
The following types of line breaks are supported:
- CR, i.e.
\r
- LF, i.e.
\n
- CRLF, i.e.
\r\n
- CR, i.e.
-
Characters from the following Unicode blocks are supported:
- Basic Latin
- Latin-1 Supplement
- Latin Extended-A
- Latin Extended-B
- IPA Extensions
To run the test suites of this package, execute the following commands:
cabal configure --enable-tests
cabal build
cabal test --test-options="<file> <lexer> <character encoding> <line break type>" --test-show-details=streaming
The arguments passed to cabal test
by --test-options
are:
<file>
is the input file whose content will be lexed<lexer>
=FTL
|TEX
<character encoding>
=UTF-8
|UTF-16-LE
|UTF-16-BE
|UTF-32-LE
|UTF-32-BE
<line break type>
=CR
|LF
|CRLF
(Note: The option --test-show-details=streaming
is necessary to allow user
interaction during a test run.)
To generate a tarball of this package – which will be located at
dist-newstyle/sdist/ftlex-0.3.0.tar.gz
– simply execute the following command:
cabal sdist