aboutsummaryrefslogtreecommitdiff
path: root/src/boot/strap/tokens.clisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/strap/tokens.clisp')
-rw-r--r--src/boot/strap/tokens.clisp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/boot/strap/tokens.clisp b/src/boot/strap/tokens.clisp
index d75c74a2..abb77212 100644
--- a/src/boot/strap/tokens.clisp
+++ b/src/boot/strap/tokens.clisp
@@ -6,12 +6,26 @@
(PROVIDE "tokens")
(EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
- (EXPORT '(|$InteractiveMode| |char|)))
+ (EXPORT '(|$InteractiveMode| |char| |subString|)))
(DECLAIM (FTYPE (FUNCTION (|%Symbol|) |%Char|) |char|))
(DEFPARAMETER |$InteractiveMode| NIL)
+(DEFSTRUCT (|%Token| (:COPIER |copy%Token|)) |cls| |val| |pos|)
+
+(DEFMACRO |mk%Token| (|cls| |val| |pos|)
+ (LIST '|MAKE-%Token| :|cls| |cls| :|val| |val| :|pos| |pos|))
+
+(DEFMACRO |tokenClass| (|bfVar#1|) (LIST '|%Token-cls| |bfVar#1|))
+
+(DEFMACRO |tokenValue| (|bfVar#1|) (LIST '|%Token-val| |bfVar#1|))
+
+(DEFMACRO |tokenPosition| (|bfVar#1|) (LIST '|%Token-pos| |bfVar#1|))
+
+(DEFUN |makeToken| (|lp| |b| |n|)
+ (|mk%Token| (CAR |b|) (CADR |b|) (CONS |lp| |n|)))
+
(DEFUN |char| (|x|) (SCHAR (SYMBOL-NAME |x|) 0))
(DEFUN |shoeStartsId| (|x|)