Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dz4k/screed
a lexerless lexer
https://github.com/dz4k/screed
Last synced: 8 days ago
JSON representation
a lexerless lexer
- Host: GitHub
- URL: https://github.com/dz4k/screed
- Owner: dz4k
- License: mit
- Created: 2022-02-03T20:31:26.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-08T14:39:03.000Z (almost 3 years ago)
- Last Synced: 2024-11-22T00:54:46.296Z (about 1 month ago)
- Language: JavaScript
- Size: 91.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Screed
======Screed helps you parse text. It can do some things that a lexer can do, but it
doesn't generate tokens. Instead, you read characters directly in your parser.
You can:* Read individual characters
~~~ js
if (reader.matchChar('"')) {
const char = reader.eat()
...
}
~~~* Match strings
~~~ js
if (reader.matchString("...")) {
~~~* Match regular expressions
~~~ js
if (reader.matchRegex(/[A-Za-z0-9_\$]+/)) {
~~~I wrote screed in hopes that it could be used for [_hyperscript][].
[_hyperscript]: https://hyperscript.org