Commit 7007d7b0 authored by John van Groningen's avatar John van Groningen

syntax color 'derive', not 'default'

parent 819f37bc
......@@ -11,8 +11,6 @@ import StdArray, StdBool, StdClass, StdEnum, StdList
import StdIOCommon, StdPicture, StdPSt
import EdMonad, syncol
//--
splitAtTabs :: !String -> .[String]
splitAtTabs string
= splitAtTabs` 0 0
......@@ -42,8 +40,6 @@ tabTake n [string:strings]
where
len = size string
//--
alignAtTab` x tabSize charWidth
| tabSize <= 0
= x + charWidth // sensible result for silly value
......@@ -51,8 +47,6 @@ alignAtTab` x tabSize charWidth
where
tabWidth = tabSize * charWidth
//--
tabDrawString :: !Point2 !String !FontInfo !*Picture -> *Picture
tabDrawString point string {thefont, showTabs,tabSize,charWidth} picture
#! strings = splitAtTabs string
......@@ -131,9 +125,7 @@ where
#! picture = optDrawC '~' picture
#! picture = setPenColour textColour picture
= tabDrawString` /*False*/ clevel {point & x = newX} strings picture
drawC :: /*!Bool*/ !CommentLevel !.String !*Picture -> (!CommentLevel,!*Picture)
drawC /*ini*/ c s pic
= drawC c pic
......@@ -162,7 +154,7 @@ where
l = size s
funnyChar i = isStringMember s.[i] (dec funnySize) funnyChars
//isStringMember:: a !.[a] -> .Bool | Eq a
isStringMember :: !Char !Int !{#Char} -> Bool
isStringMember x i s
| i < 0 = False
| s.[i] == x = True
......@@ -319,18 +311,22 @@ where
T l -> l <> 0
D l -> l <> 0
_ -> False
dec_comment cl = case cl of
N l -> N (dec l)
T l -> T (dec l)
D l -> D (dec l)
inc_comment cl = case cl of
N l -> N (inc l)
T l -> T (inc l)
D l -> D (inc l)
non_comment_colour cl = case cl of
N _ -> textColour
T _ -> typedefColour
D _ -> typedeclColour
scankeyword :: !.String !Int -> (!Bool,!Int)
scankeyword s i
# c = s.[i]
......@@ -344,10 +340,10 @@ where
| c == 'g' // generic
| (j == i+7) && (s%(i,i+6)=="generic") = (True,j)
= (False,j)
| c == 'd' // definition
| (j == i+10) && (s%(i,i+9)=="definition") = (True,j)
| (j == i+7) && (s%(i,i+6)=="default") = (True,j) // only in typedef!
| (j == i+7) && (s%(i,i+6)=="dynamic") = (True,j)
| c == 'd' // definition, derive, dynamic
| j == i+10 = (s % (i,i+9)=="definition",j)
| j == i+6 = (s % (i,i+5)=="derive",j)
| j == i+7 = (s % (i,i+6)=="dynamic",j)
= (False,j)
| c == 'i' // implementation, import, if, in, infix, infixl, infixr, instance
| (j == i+14) && (s%(i,i+13)=="implementation") = (True,j)
......@@ -386,17 +382,6 @@ where
| (j == i+4) && (s%(i,i+3)=="with") = (True,j)
| (j == i+5) && (s%(i,i+4)=="where") = (True,j)
= (False,j)
/* | c == 'B' // bool
| (j == i+4) && (s%(i,i+3)=="Bool") = (True,j)
= (False,j)
| c == 'C' // char
| (j == i+4) && (s%(i,i+3)=="Char") = (True,j)
= (False,j)
| c == 'I' // int
| (j == i+3) && (s%(i,i+2)=="Int") = (True,j)
= (False,j)
// True / False; numeric constants??
*/
= (False,j)
scanalpha i
| i >= l = l
......@@ -427,6 +412,7 @@ where
= dS (inc i) pic
# pic = optDrawC s.[i] pic
= dS (inc i) pic
dC :: !Int !*Picture -> (!CommentLevel,!*Picture)
dC i pic
| i >= l
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment