more name changing

This commit is contained in:
2021-07-24 14:40:55 -06:00
parent f5a5cdfb40
commit d3f0c33061
5 changed files with 18 additions and 18 deletions

View File

@@ -493,7 +493,7 @@ class Macros {
macros["undefreadermacro"] = (wholeExp:ReaderExp, exps:Array<ReaderExp>, k:KissState) -> { macros["undefreadermacro"] = (wholeExp:ReaderExp, exps:Array<ReaderExp>, k:KissState) -> {
wholeExp.checkNumArgs(1, 1, '(undefReaderMacro [optional &start] ["[startingString]" or [startingStrings...]])'); wholeExp.checkNumArgs(1, 1, '(undefReaderMacro [optional &start] ["[startingString]" or [startingStrings...]])');
// reader macros undeclared in the form (undefreadermacro &start ...) will be removed from the table // reader macros undeclared in the form (undefReaderMacro &start ...) will be removed from the table
// for reader macros that must be at the beginning of lines // for reader macros that must be at the beginning of lines
// at the beginning of lines // at the beginning of lines
var table = k.readTable; var table = k.readTable;
@@ -503,9 +503,9 @@ class Macros {
var strings = switch (exps[0].def) { var strings = switch (exps[0].def) {
case MetaExp("start", stringsExp): case MetaExp("start", stringsExp):
table = k.startOfLineReadTable; table = k.startOfLineReadTable;
stringsThatMatch(stringsExp, "undefreadermacro"); stringsThatMatch(stringsExp, "undefReaderMacro");
default: default:
stringsThatMatch(exps[0], "undefreadermacro"); stringsThatMatch(exps[0], "undefReaderMacro");
}; };
for (s in strings) { for (s in strings) {
table.remove(s); table.remove(s);

View File

@@ -1,6 +1,6 @@
(load "BootCodeCommon.kiss") (load "BootCodeCommon.kiss")
(defreadermacro "" [stream] (defReaderMacro "" [stream]
`(,(ReaderExp.Symbol `(,(ReaderExp.Symbol
(begin (stream.dropWhitespace) (nextToken stream))) (begin (stream.dropWhitespace) (nextToken stream)))
(,(ReaderExp.Symbol (,(ReaderExp.Symbol

View File

@@ -4,7 +4,7 @@
(prop &mut forked false) (prop &mut forked false)
(prop &mut forkedAt -1) (prop &mut forkedAt -1)
(defreadermacro ["jmp" "nop"] [stream] (defReaderMacro ["jmp" "nop"] [stream]
(let [inst (let [inst
(nextToken stream) (nextToken stream)
instSymbol instSymbol

View File

@@ -9,19 +9,19 @@
(function fixFacing [f] (function fixFacing [f]
(Math.floor (% (if (> 0 f) (+ 4 f) f) 4))) (Math.floor (% (if (> 0 f) (+ 4 f) f) 4)))
(classMethod N [num] (method N [num]
(set y (+ y num))) (set y (+ y num)))
(classMethod S [num] (method S [num]
(set y (- y num))) (set y (- y num)))
(classMethod E [num] (method E [num]
(set x (+ x num))) (set x (+ x num)))
(classMethod W [num] (method W [num]
(set x (- x num))) (set x (- x num)))
(classMethod R [angle] (method R [angle]
(set facing (fixFacing (+ facing (/ angle 90))))) (set facing (fixFacing (+ facing (/ angle 90)))))
(classMethod L [angle] (method L [angle]
(set facing (fixFacing (- facing (/ angle 90))))) (set facing (fixFacing (- facing (/ angle 90)))))
(classMethod F [num] (method F [num]
(case facing (case facing
(0 (E num)) (0 (E num))
(1 (S num)) (1 (S num))
@@ -29,7 +29,7 @@
(3 (N num)) (3 (N num))
(otherwise (throw (+ "Bad facing" facing))))) (otherwise (throw (+ "Bad facing" facing)))))
(defreadermacro "" [stream] (defReaderMacro "" [stream]
(stream.dropWhitespace) (stream.dropWhitespace)
(if (stream.isEmpty) (if (stream.isEmpty)
null null

View File

@@ -45,10 +45,10 @@
(for :FerrySquare seat row (for :FerrySquare seat row
(if #|seat == fullSeat|# 1 0)))))) (if #|seat == fullSeat|# 1 0))))))
(defreadermacro "L" [stream] `emptySeat) (defReaderMacro "L" [stream] `emptySeat)
(defreadermacro "#" [stream] `fullSeat) (defReaderMacro "#" [stream] `fullSeat)
(defreadermacro "." [stream] `floor) (defReaderMacro "." [stream] `floor)
(undefreadermacro "...") (undefReaderMacro "...")
(defreadermacro &start "" [stream] (defReaderMacro &start "" [stream]
`(state.push ,(ReaderExp.ListExp (readExpArray stream #|"\n"|#)))) `(state.push ,(ReaderExp.ListExp (readExpArray stream #|"\n"|#))))