aboutsummaryrefslogtreecommitdiff
path: root/tree.icl
diff options
context:
space:
mode:
authorCamil Staps2016-05-26 17:42:14 +0200
committerCamil Staps2016-05-26 17:42:14 +0200
commit9cd074db4da194630b223a988b25fd015b527d38 (patch)
treebbd5fd135d014e2ec1d4a14d3b735c7ef41dfbc3 /tree.icl
parentOverloading IO functions in step; POC derivation tree generation (diff)
Improved tree toString; reverse.smf
Diffstat (limited to 'tree.icl')
-rw-r--r--tree.icl18
1 files changed, 15 insertions, 3 deletions
diff --git a/tree.icl b/tree.icl
index 82e0ae9..c7cdc77 100644
--- a/tree.icl
+++ b/tree.icl
@@ -10,7 +10,19 @@ import System.CommandLine, System.GetOpt
import Smurf
import SmurfParse
-Start = toString devtree
+Start w
+# (_,f,w) = fopen "reverse.smf" FReadText w
+# (pgm,f) = readFile f
+# (ok,w) = fclose f w
+# (Just pgm) = parse [c \\ c <-: pgm]
+= toString (devtree pgm)
where
- (Just devtree) = tree pgm zero zero listIO
- (Just pgm) = parse ['"abc""123"+o']
+ devtree pgm = fromJust (tree pgm zero {zero & input = ["reverse"]} listIO)
+
+ readFile :: !*File -> *(!String, !*File)
+ readFile f
+ # (end,f) = fend f
+ | end = ("", f)
+ # (s,f) = freadline f
+ # (ss,f) = readFile f
+ = (s +++ ss, f)