# README
jig/scanner
Lisp lexer (scanner) implemented in GO used by jig/lisp
and 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
orFloat
respectively) - character tokens are not supported anymore (e.g.
'A'
) as'
is used as synonym ofquote
- 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 ofquasiquote
. Raw strings might include¬
by doublind them¬¬
#{
is specially handled to support Lisp set literals~
,@
and~@
are specially handled to support them as synonyms ofunquote
,deref
andsplice-unquote
respectively- support of Lisp keywords (e.g.
:key
) as a single token of typeKeyword
Documentation
# Functions
TokenString returns a printable string for a token or Unicode character.
# Constants
The result of Scan is one of these tokens or a Unicode character.
The result of Scan is one of these tokens or a Unicode character.
The result of Scan is one of these tokens or a Unicode character.
The result of Scan is one of these tokens or a Unicode character.
The result of Scan is one of these tokens or a Unicode character.
The result of Scan is one of these tokens or a Unicode character.
Predefined mode bits to control recognition of tokens.
LispWhitespace is the default value for the Scanner's Whitespace field.
The result of Scan is one of these tokens or a Unicode character.
Predefined mode bits to control recognition of tokens.
includes Ints and hexadecimal floats.
Predefined mode bits to control recognition of tokens.
Predefined mode bits to control recognition of tokens.
Predefined mode bits to control recognition of tokens.
Predefined mode bits to control recognition of tokens.
Predefined mode bits to control recognition of tokens.
if set with ScanComments, comments become white space.
The result of Scan is one of these tokens or a Unicode character.