From 794a9c0f554aaebe3ee13165efaf07b296b5be9f Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Fri, 21 Jan 2011 15:35:49 +0100 Subject: [PATCH] enum! --- presentation.fs | 10 +++++----- presentation.p.fs | 14 ++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/presentation.fs b/presentation.fs index d7bb42d..ac2dab7 100755 --- a/presentation.fs +++ b/presentation.fs @@ -233,20 +233,20 @@ variable enumerationCount ( -- addr ) : {||} ( addr -- addr ) \ increments enumeration count and prints prefix enumerationCount dup @ 1+ dup rot ! 2 cursor> 0 u.r ." ." space - 5 ptype-curx ! + 5 ptype-curx ! 0 ; -: <||> ( -- , xt-{||} ) [char] e ok- @ <> throw ['] {||} , ; +: <||> ( -- , xt-{||} ) block? <> throw ['] {||} , ; : {/||} ( -- ) cr ; -: ( -- , xt-{/||} ) ['] {/||} , ; \ [char] e ok- @ 2dup emit emit <> throw ; +: ( -- , xt-{/||} ) ['] {/||} , block? ; : {en} ( -- ) cr 5 ptype-indent ! \ 6 Zeichen weit einruecken 0 enumerationCount ! \ resets enumeration count ; -: ( -- , xt-{en} ) [char] e block! ['] {en} , ; +: ( -- , xt-{en} ) block? ['] {en} , ; : {/en} ( -- ) ptype-reset ; -: ( -- , xt-{/en} ) ['] {en} , [char] e !block ; +: ( -- , xt-{/en} ) ['] {en} , block? ; 256 Constant max-line Create line-buffer max-line 2 + allot diff --git a/presentation.p.fs b/presentation.p.fs index 8d85023..ea59eaa 100644 --- a/presentation.p.fs +++ b/presentation.p.fs @@ -174,12 +174,14 @@

farbendemo

!" Beliebige Wörter können Inhalte erzeugen!!" - (

!" So kann man Aufzaehlungen erstellen"

- - <||> !" Das erstellen von Präsentationen und Formatierungen wirkt natürlich" - <||> !" Unsere Sprache erbt die gesamte Funktionalität von Forth persönlich. " - <||> !" Makros generieren Inhalte" - ) +

!" So kann man Aufzaehlungen erstellen"

+

+ + <||> !" Das erstellen von Präsentationen und Formatierungen wirkt natürlich" + <||> !" Unsere Sprache erbt die gesamte Funktionalität von Forth persönlich." + <||> !" Makros generieren Inhalte" + +

s" presentation.p.fs" 112 116

!" Die Operatoren sehen so aus:"

s" presentation.fs" 214 221