aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/boot/includer.boot12
-rw-r--r--src/boot/initial-env.lisp11
-rw-r--r--src/boot/strap/includer.clisp2
-rw-r--r--src/boot/strap/tokens.clisp14
-rw-r--r--src/boot/tokens.boot11
6 files changed, 35 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d2a64671..6c28c380 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2010-12-27 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * boot/includer.boot (char): Move to token.boot.
+ * boot/tokens.boot (shoeStartsId): Move from initial-env.lisp
+ (shoeIdChar): Likewise.
+ * boot/initial-env.lisp (CHARMEM): Remove.
+
2010-12-19 Gabriel Dos Reis <gdr@cs.tamu.edu>
* algebra/files.spad.pamphlet (KeyedAccessFile): Use try/finally
diff --git a/src/boot/includer.boot b/src/boot/includer.boot
index f6056139..21498198 100644
--- a/src/boot/includer.boot
+++ b/src/boot/includer.boot
@@ -66,17 +66,13 @@ module includer
--
-- ElseLines ::= )else SimpleLine* | )elseif SimpleLine* ElseLines | empty
--- returns a printable representation of X, when it is a symbol
--- or a character, as string. Otherwise, returns nil.
+++ returns a printable representation of `x', when it is a symbol
+++ or a character, as string. Otherwise, returns nil.
PNAME x ==
- symbol? x => SYMBOL_-NAME x
- CHARACTERP x => STRING x
+ symbol? x => symbolName x
+ char? x => STRING x
nil
--- converts X, a 1-length string, to a character.
-char x ==
- CHAR(PNAME x, 0)
-
-- close STREAM.
shoeCLOSE stream ==
CLOSE stream
diff --git a/src/boot/initial-env.lisp b/src/boot/initial-env.lisp
index 31024006..a4b45b76 100644
--- a/src/boot/initial-env.lisp
+++ b/src/boot/initial-env.lisp
@@ -146,17 +146,6 @@
(defun QENUM (cvec ind)
(char-code (char cvec ind)))
-(defun charmem (a b)
- (member a b :test #'eql))
-
-(defun |shoeIdChar| (x)
- (or (ALPHANUMERICP x)
- (charmem x '(#\' #\? #\%))))
-
-(defun |shoeStartsId| (x)
- (or (alpha-char-p x)
- (charmem x '(#\$ #\? #\%))))
-
(defun strpos (what in start dontcare)
(setq what (string what) in (string in))
(if dontcare
diff --git a/src/boot/strap/includer.clisp b/src/boot/strap/includer.clisp
index 154e1cd4..99c6a5fb 100644
--- a/src/boot/strap/includer.clisp
+++ b/src/boot/strap/includer.clisp
@@ -11,8 +11,6 @@
((CHARACTERP |x|) (STRING |x|))
(T NIL)))
-(DEFUN |char| (|x|) (CHAR (PNAME |x|) 0))
-
(DEFUN |shoeCLOSE| (|stream|) (CLOSE |stream|))
(DEFUN |shoeNotFound| (|fn|)
diff --git a/src/boot/strap/tokens.clisp b/src/boot/strap/tokens.clisp
index a918ca35..101f143d 100644
--- a/src/boot/strap/tokens.clisp
+++ b/src/boot/strap/tokens.clisp
@@ -5,6 +5,16 @@
(PROVIDE "tokens")
+(DEFUN |char| (|x|) (CHAR (SYMBOL-NAME |x|) 0))
+
+(DEFUN |shoeStartsId| (|x|)
+ (OR (ALPHA-CHAR-P |x|)
+ (MEMBER |x| (LIST (|char| '$) (|char| '?) (|char| '%)))))
+
+(DEFUN |shoeIdChar| (|x|)
+ (OR (ALPHANUMERICP |x|)
+ (MEMBER |x| (LIST (|char| '|'|) (|char| '?) (|char| '%)))))
+
(DEFCONSTANT |shoeKeyWords|
(LIST (LIST "and" 'AND) (LIST "by" 'BY) (LIST "case" 'CASE)
(LIST "catch" 'CATCH) (LIST "cross" 'CROSS)
@@ -203,7 +213,9 @@
(EVAL-WHEN (:EXECUTE :LOAD-TOPLEVEL)
(LET ((|bfVar#9|
- (LIST (LIST '|alphabetic?| 'ALPHA-CHAR-P)
+ (LIST (LIST '|abs| 'ABS)
+ (LIST '|alphabetic?| 'ALPHA-CHAR-P)
+ (LIST '|alphanumeric?| 'ALPHANUMERICP)
(LIST '|and| 'AND) (LIST '|append| 'APPEND)
(LIST '|apply| 'APPLY) (LIST '|atom| 'ATOM)
(LIST '|canonicalFilename| 'PROBE-FILE)
diff --git a/src/boot/tokens.boot b/src/boot/tokens.boot
index a9b603ba..bf7cb255 100644
--- a/src/boot/tokens.boot
+++ b/src/boot/tokens.boot
@@ -36,6 +36,16 @@ import initial_-env
namespace BOOTTRAN
module tokens
+++ converts `x', a 1-length symbol, to a character.
+char x ==
+ CHAR(symbolName x, 0)
+
+shoeStartsId x ==
+ alphabetic? x or x in [char "$", char "?", char "%"]
+
+shoeIdChar x ==
+ alphanumeric? x or x in [char "'", char "?", char "%"]
+
++ Table of Boot keywords and their token name.
shoeKeyWords == [ _
['"and","AND"] , _
@@ -245,6 +255,7 @@ for i in [ _
for i in [ _
["abs", "ABS"], _
["alphabetic?", "ALPHA-CHAR-P"], _
+ ["alphanumeric?", "ALPHANUMERICP"], _
["and", "AND"] , _
["append", "APPEND"] , _
["apply", "APPLY"] , _