Was wenn noch weitere features benoetigt werden hinzugefuegt
This commit is contained in:
parent
165df46ca7
commit
c0dbabcbe0
|
@ -173,7 +173,7 @@
|
|||
<p> s" farbendemo.fs" 0 100 <source> </p>
|
||||
<p> farbendemo </p>
|
||||
<np>
|
||||
<h> !" Beliebige Wörter können Inhalte erzeugen!!" </h>
|
||||
<h> !" Was wenn zusätzliche Formatierungstags benötigt werden?" </h>
|
||||
( <p> <b> !" So kann man Aufzaehlungen erstellen" </b> </p>
|
||||
<p>
|
||||
<en>
|
||||
|
@ -182,9 +182,10 @@
|
|||
<||> !" Makros generieren Inhalte" </||>
|
||||
</en>
|
||||
</p> )
|
||||
<p> s" presentation.p.fs" 112 116 <source> </p>
|
||||
<p> !" Die Operatoren sehen so aus:" </p>
|
||||
<p> s" presentation.fs" 214 221 <source> </p>
|
||||
<p> s" farbendemo.fs" 0 5 <source> </p>
|
||||
<p> s" presentation.p.fs" 185 185 <source> </p>
|
||||
<p> !" Die implementierung des Tags <source>:" </p>
|
||||
<p> s" sourceTag.fs" 0 100 <source> </p>
|
||||
<np>
|
||||
<h> !" Spezielle (verwendete) Features von Forth" </h>
|
||||
<br>
|
||||
|
|
12
sourceTag.fs
Normal file
12
sourceTag.fs
Normal file
|
@ -0,0 +1,12 @@
|
|||
: printCodeHeader ( end start namelen addr 1/0 -- ) \ prints source code header containing line numbers
|
||||
{ showLines }
|
||||
swap 2swap \ addr namelen end start
|
||||
2dup > if swap then \ addr namelen start/end end/start
|
||||
showLines if dup 0 <# #s #> nip else 0 then ptype-reset 1+ ptype-indent !
|
||||
2swap \ start end addr namelen
|
||||
showLines printsource
|
||||
;
|
||||
|
||||
: {source} ( -- ) dup dup dup dup @ swap cell + @ 2swap cell 2 * +
|
||||
@ swap cell 3 * + @ 1 printCodeHeader 4 cells + ptype-reset ;
|
||||
: <source> ( addr len from to -- , xt-{source} ) ['] {source} , , , , , ;
|
Loading…
Reference in a new issue