Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jig/scanner
Lisp source code scanner
https://github.com/jig/scanner
go golang lisp tinygo
Last synced: 30 days ago
JSON representation
Lisp source code scanner
- Host: GitHub
- URL: https://github.com/jig/scanner
- Owner: jig
- License: bsd-3-clause
- Created: 2022-08-21T16:19:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-27T08:45:53.000Z (over 2 years ago)
- Last Synced: 2024-11-13T08:15:22.836Z (3 months ago)
- Topics: go, golang, lisp, tinygo
- Language: Go
- Homepage:
- Size: 144 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jig/scanner
Lisp lexer (scanner) implemented in GO used by [`jig/lisp`](https://github.com/jig/lisp) and [`jig/tinylisp`](https://github.com/jig/tinylisp)
Code adapted from the Go `text/scanner` standard package, and mostly compatible with it (beside the fact this is for Lisp and that is for Go syntax).
Major differences:
- identifier allowed characters is more expansive than Go is (e.g. `+`, `-`, `*host-name*`, or `<=` are valid identifiers)
- negative integers or negative floats are supported as a single token (of type `Int` or `Float` respectively)
- character tokens are not supported anymore (e.g. `'A'`) as `'` is used as synonym of `quote`
- parsing errors are not printed to `os.Stdout` by default
- raw strings in `jig/lisp` are quoted with `¬` character (instead of `` ` ``) as `` ` `` is used as synonym of `quasiquote`. Raw strings might include `¬` by doublind them `¬¬`
- `#{` is specially handled to support Lisp set literals
- `~`, `@` and `~@` are specially handled to support them as synonyms of `unquote`, `deref` and `splice-unquote` respectively
- support of Lisp keywords (e.g. `:key`) as a single token of type `Keyword`# Documentation
See [pkg.go.dev/jig/scanner](https://pkg.go.dev/github.com/jig/scanner)