Quote macro expansion
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import re
|
||||
from typing import Any
|
||||
import lisp
|
||||
import atom
|
||||
|
||||
|
||||
class Reader:
|
||||
tokens: list[str|Any]
|
||||
tokens: list[str]
|
||||
|
||||
def __init__(self):
|
||||
self.tokens = []
|
||||
@@ -43,6 +40,10 @@ class Reader:
|
||||
token = self.peek()
|
||||
self.consume()
|
||||
return atomlist
|
||||
elif self.peek() == "'":
|
||||
# Expand the quote macro!
|
||||
self.consume()
|
||||
return ["quote", self.read_expression()]
|
||||
else:
|
||||
return self.read_atom()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user