aboutsummaryrefslogtreecommitdiff
path: root/src/interp/spad-parser.boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp/spad-parser.boot')
-rw-r--r--src/interp/spad-parser.boot29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/interp/spad-parser.boot b/src/interp/spad-parser.boot
index 3e821cda..2799d88f 100644
--- a/src/interp/spad-parser.boot
+++ b/src/interp/spad-parser.boot
@@ -420,6 +420,10 @@ parseCommand() ==
parseTokenOption() ==
matchAdvanceString '")" and compulsorySyntax PARSE_-TokenList()
+dollarTran(dom,x) ==
+ x is [.,:.] => [['elt,dom,first x],:rest x]
+ ['elt,dom,x]
+
parseQualification() ==
matchAdvanceString '"$" =>
compulsorySyntax parsePrimary1()
@@ -931,6 +935,31 @@ parseSpecialCommand() ==
--%
+translateSpad x ==
+ $Index: local := 0
+ _*PRETTY_-PRINT_*: local := true
+ $MACROASSOC: local := nil
+ $NEWSPAD: local := true
+ $currentFunction: local := nil
+ $topOp: local := nil
+ $semanticErrorStack: local := []
+ $warningStack: local := []
+ $returnMode: local := $EmptyMode
+ $leaveLevelStack: local := []
+ $insideFunctorIfTrue: local := false
+ $insideExpressionIfTrue: local := false
+ $insideCoerceInteractiveHardIfTrue: local := false
+ $insideWhereIfTrue: local := false
+ $insideCategoryIfTrue: local := false
+ $insideCapsuleFunctionIfTrue: local := false
+ $form: local := nil
+ $e: local := $EmptyEnvironment
+ $genSDVar: local := 0
+ $previousTime: local := TEMPUS_-FUGIT()
+ compileParseTree x
+
+--%
+
++ Given a pathname to a source file containing Spad code, returns
++ a list of (old) AST objects representing the toplevel expressions
++ in that file.