EdTab.dcl 886 Bytes
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1
2
3
4
5
6
/*
 * EdTab.dcl: functions that deal with those annoying tab characters
 */

definition module EdTab

7
8
9
from StdIOCommon   import :: Point2
from StdPicture	   import :: Picture
from EdMonad       import :: FontInfo
Diederik van Arkel's avatar
Diederik van Arkel committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

splitAtTabs	   :: !String -> .[String]
// splitAtTabs:	   splits a string into several strings that were
//				   separated by tabs in the orginal string.
//				   e.g. "monkey\tcow\t" --> ["monkey","cow",""]

tabTake		   :: !Int [String] -> [String]
// tabTake:		   takes a number of characters of a string that
//				   is split at tabs. e.g. tabTake 4 ["abc","def"] =
//				   ["abc",""]

tabDrawString  :: !Point2 !String !FontInfo !*Picture -> *Picture
tabDrawStringC :: !Point2 !(!Int,!String) !FontInfo !*Picture -> *Picture
// tabDrawString:	draws a string containing tabs properly.
// tabDrawStringC:	draws a string containing tabs properly with syntax colours.