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.boot15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/interp/spad-parser.boot b/src/interp/spad-parser.boot
index 69c8665e..41297bfc 100644
--- a/src/interp/spad-parser.boot
+++ b/src/interp/spad-parser.boot
@@ -109,6 +109,21 @@ skipToEndif x ==
stringPrefix?(line,'")fin") => [n,:%nothing]
skipToEndif x
+++ `n' is the line number of the current line
+++ `oldnums' is the list of line numbers of previous lines
+++ `oldlocs' is the list of previous indentation locations
+++ `ncblock' is the current comment block
+findCommentBlock(n,oldnums,oldlocs,ncblock,lines) ==
+ x :=
+ [nc,:block] := ncblock
+ nc = 0 => [n - 1,:reverse block]
+ if $EchoLineStack then
+ [n,:$EchoLineStack] := $EchoLineStack
+ preparseEcho lines
+ $EchoLineStack := [n]
+ [or/[n for n in oldnums for l in oldlocs | integer? l and l <= nc],
+ :reverse block]
+ $COMBLOCKLIST := [x,:$COMBLOCKLIST]
preparseReadLine x ==
[n,:line] := z := preparseReadLine1 x