This list contains general structure of the nodes represented with queries.
Note
Some of the nodes were omitted for clarity purposes.
list
:: list literal()
(list
open: "("
call: (_)?
item: (_)*
close: ")")
sequence
:: sequence literal, otherwise known as sequential table[]
(sequence
open: "["
item: (_)*
close: "]")
table
:: table literal{}
(table
open: "{"
item: (table_pair
key: (_)
value: (_))*
close: "}")
string
:: either colon string:abc
or double quote string"abc"
;; colon string
(string
open: ":"
content: (string_content))
;; double quote string
(string
open: "\""
content: (string_content
(escape_sequence)*)
close: "\"")
number
:: any valid number
(number)
nil
:: justnil
(nil)
boolean
:: eithertrue
orfalse
(boolean
"true")
(boolean
"false")
symbol
:: anything that's not explicitly defined in the grammar is a symbol
(symbol)
symbol_option
:: a symbol that starts with&
(symbol_option)
symbol_fragment
:: same assymbol
, but only used in multi-symbols
(symbol_fragment)
multi_symbol
:: a comma separated mush of symbolsa.b.c.d
(multi_symbol
base: (symbol_fragment)
("."
.
member: (symbol_fragment))+)
multi_symbol_method
:: method calla.b.c:deeznuts
(multi_symbol_method
base: [
(symbol_fragment)
(multi_symbol)
]
":"
method: (symbol_fragment))
All reader macros do is wrap an S-expression, so their structure is identical.
hashfn_reader_macro
::#expr
(hashfn_reader_macro
macro: "#"
expression: (_))
quote_reader_macro
::'expr
(quote_reader_macro
macro: "'"
expression: (_))
quasi_quote_reader_macro
::`expr
(quasi_quote_reader_macro
macro: "`"
expression: (_))
unquote_reader_macro
::,expr
(unquote_reader_macro
macro: ","
expression: (_))
shebang
:: matches#!
if it's the very first parsed node
(shebang)
comment
:: a comment; comment
(comment
colons: ";"
body: (comment_body))
#
::#
is recognized as a reader macro if it's immediately followed by an expression, and a symbol otherwise
;; #hello
(reader_macro
macro: "#"
expression: (symbol))
;; (# my-table)
(list
call: (symbol)
item: (symbol))