aboutsummaryrefslogtreecommitdiff
path: root/src/boot/strap
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-06-20 14:08:58 +0000
committerdos-reis <gdr@axiomatics.org>2013-06-20 14:08:58 +0000
commit1102a65aec0ee0acf7f93ef3c1d780399ac479b7 (patch)
tree356433094e9a874e6c927ab4dbcf1852fb1d02cd /src/boot/strap
parentb0cf190c03229e5f09284c80b26c0b8a1feafba6 (diff)
downloadopen-axiom-1102a65aec0ee0acf7f93ef3c1d780399ac479b7.tar.gz
Allow inerts in Boot.
Diffstat (limited to 'src/boot/strap')
-rw-r--r--src/boot/strap/ast.clisp4
-rw-r--r--src/boot/strap/parser.clisp9
-rw-r--r--src/boot/strap/scanner.clisp6
-rw-r--r--src/boot/strap/tokens.clisp6
4 files changed, 20 insertions, 5 deletions
diff --git a/src/boot/strap/ast.clisp b/src/boot/strap/ast.clisp
index 6cb05e57..3fca935f 100644
--- a/src/boot/strap/ast.clisp
+++ b/src/boot/strap/ast.clisp
@@ -1223,7 +1223,9 @@
(DEFUN |bfKeyArg| (|k| |x|) (LIST '|%Key| |k| |x|))
-(DEFUN |lispKey| (|k|) (INTERN (STRING-UPCASE (SYMBOL-NAME |k|)) "KEYWORD"))
+(DEFUN |bfInert| (|x|) (INTERN (STRING-UPCASE |x|) "KEYWORD"))
+
+(DEFUN |lispKey| (|k|) (|bfInert| (SYMBOL-NAME |k|)))
(DEFUN |bfExpandKeys| (|l|)
(LET* (|x| |ISTMP#2| |k| |ISTMP#1| |a| |args|)
diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp
index fcb8a2ef..7684716b 100644
--- a/src/boot/strap/parser.clisp
+++ b/src/boot/strap/parser.clisp
@@ -466,7 +466,14 @@
((|bpEqPeek| |ps| 'QUOTE) (|bpNext| |ps|)
(AND (|bpRequire| |ps| #'|bpSexp|)
(|bpPush| |ps| (|bfSymbol| (|bpPop1| |ps|)))))
- (T (OR (|bpString| |ps|) (|bpFunction| |ps|)))))
+ (T (OR (|bpString| |ps|) (|bpFunction| |ps|) (|bpInert| |ps|)))))
+
+(DEFUN |bpInert| (|ps|)
+ (COND
+ ((EQ (|parserTokenClass| |ps|) 'INERT)
+ (AND (|bpPush| |ps| (|bfInert| (|parserTokenValue| |ps|)))
+ (|bpNext| |ps|)))
+ (T NIL)))
(DEFUN |bpChar| (|ps|)
(LET* (|ISTMP#1| |s| |a|)
diff --git a/src/boot/strap/scanner.clisp b/src/boot/strap/scanner.clisp
index 744d4e28..92912515 100644
--- a/src/boot/strap/scanner.clisp
+++ b/src/boot/strap/scanner.clisp
@@ -194,6 +194,7 @@
((DIGIT-CHAR-P |ch|) (|shoeNumber| |lex|))
((CHAR= |ch| (|char| '_)) (|shoeEscape| |lex|))
((EQUAL |ch| |shoeTAB|) (|lexerAdvancePosition!| |lex|) NIL)
+ ((CHAR= |ch| (|char| '&)) (|shoeInert| |lex|))
(T (|shoeError| |lex|))))
(COND ((NULL |b|) NIL) (T (|dqUnit| (|makeToken| |linepos| |b| |n|)))))))
@@ -426,6 +427,11 @@
((|shoeKeyWordP| |w|) (SETQ |$floatok| T) (|shoeLeafKey| |w|))
(T (|shoeLeafId| |w|))))))
+(DEFUN |shoeInert| (|lex|)
+ (PROGN
+ (|lexerAdvancePosition!| |lex|)
+ (LIST 'INERT (CADR (|shoeW| |lex| NIL)))))
+
(DEFUN |shoeInteger| (|lex|) (|shoeInteger1| |lex| NIL))
(DEFUN |shoeInteger1| (|lex| |zro|)
diff --git a/src/boot/strap/tokens.clisp b/src/boot/strap/tokens.clisp
index 55653a76..6fa7d340 100644
--- a/src/boot/strap/tokens.clisp
+++ b/src/boot/strap/tokens.clisp
@@ -225,9 +225,9 @@
(LIST '|flushOutput| 'FORCE-OUTPUT) (LIST '|fourth| 'CADDDR)
(LIST '|freshLine| 'FRESH-LINE) (LIST '|function?| 'FUNCTIONP)
(LIST '|functionSymbol?| 'FBOUNDP) (LIST '|gensym| 'GENSYM)
- (LIST '|genvar| 'GENVAR) (LIST '|inert?| 'KEYWORDP)
- (LIST '|integer?| 'INTEGERP) (LIST 'LAST '|last|)
- (LIST '|list| 'LIST) (LIST '|listEq?| 'EQUAL)
+ (LIST '|genvar| 'GENVAR) (LIST '|importSymbol| 'IMPORT)
+ (LIST '|inert?| 'KEYWORDP) (LIST '|integer?| 'INTEGERP)
+ (LIST 'LAST '|last|) (LIST '|list| 'LIST) (LIST '|listEq?| 'EQUAL)
(LIST '|lowerCase?| 'LOWER-CASE-P)
(LIST '|makeFilePath| 'MAKE-PATHNAME) (LIST '|makeSymbol| 'INTERN)
(LIST '|mergeFilePaths| 'MERGE-PATHNAMES) (LIST '|mkpf| 'MKPF)