Traveller, there is no path. You make the path as you walk. Traveller, there is no path. Your tracks are the path, and when you look behind, you will see the road that never again you will traverse. Traveller, there is no path, just the wake that is left in the sea. Antonio Machado
Mark the current tape cell with the given name.
The mark command adds a text “tag” to the current tape-cell.
This allows the tape cell to be accessed later in the script with
the go command. The mark and go commands should allow “offside
” or indent parsing (such as for the
python language)
The mark command has 2 formats, one with a parameter and one without:
mark; mark "here";
When the mark command has no explicit text tag, then the text in the workspace will be used as the mark to label the current cell with.
See the go command for an example.
fix: modify tocfoot.tohtml.pss for the new implicit mark command
behaviour.
See the script /eg/tocfoot.tohtml.pss for an example of using
the “mark” and “go” commands to create a table of contents for
a document from markdown-style underline headings.
It has occurred to me that it would be convenient to introduce
a new version of the get command that would take a text tag
as an argument, as below:
mark 'here'; go 'tag'; get; go 'here';
As can be seen above the get "<mark>"; command could be implemented as a macro that just goes to a particular mark, gets the text at that tapecell (appends it to the workspace buffer) and then return to the original tape cell.
The technique of using mark and go for creating footers and headers seems to work well. But I haven't yet used it to do type-checking in nom.
begin {
mark "header"; ++; mark "footer"; ++;
}
# script.
begin { mark "top"; ++; }
while [:space:]; clear;
whilenot [:space:]; !"" {
put;
"fluffy","fofo","flop" {
mark "here"; go "top";
# ... create a reference here
go "here";
}
clear; add "word*"; push; .reparse
}
parse>
pop;pop;
"word*word*","text*word*" {
# reduce here
}
(eof) { quit; }
push;push;