Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-ide
Commits
f9e401c1
Commit
f9e401c1
authored
Mar 03, 2005
by
John van Groningen
Browse files
use a record instead of a tuple for type Info
parent
df221f6c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Ed/EdLineText.icl
View file @
f9e401c1
...
...
@@ -25,7 +25,7 @@ export TextAnnot Void, SyncInf, ConsInf
*/
::
LineAnnot
:==
Info
dummyLineAnnot
:==
(
0
,
False
,
False
,
0
,
False
)
dummyLineAnnot
:==
{
comment_level
=
0
,
is_typedef
=
False
,
is_typedecl
=
False
,
offside_level
=
0
,
flush
=
False
}
annotLine
:==
slMap
(\
s
->(
dummyLineAnnot
,
s
))
annotWhole
:==
firstParse
annotPart
:==
quickParse
...
...
Ed/EdTab.icl
View file @
f9e401c1
...
...
@@ -94,7 +94,7 @@ optDrawS :== pictdrawstring // use non-optimised versions
optDrawC
:==
pictdrawchar
// "
tabDrawStringC
::
!
Point2
!(!
Info
,!
String
)
!
FontInfo
!*
Picture
->
*
Picture
tabDrawStringC
point
(
(
clevel
,
typedef
,
typedecl
,_,_)
,
string
)
tabDrawStringC
point
(
{
comment_level
=
clevel
,
is_typedef
=
typedef
,
is_
typedecl
=
typedecl
}
,
string
)
{
tabSize
,
charWidth
,
thefont
,
showTabs
,
syntaxColours
={
textColour
,
backgroundColour
,
tabColour
,
commentColour
,
stringColour
,
charColour
,
keywordColour
,
typedefColour
,
typedeclColour
}}
picture
#!
strings
=
splitAtTabs
string
...
...
Ed/syncol.dcl
View file @
f9e401c1
...
...
@@ -5,15 +5,15 @@ definition module syncol
import
StdString
import
StrictList
::
Info
:==
(
!
Int
// comment nesting level at start of line
// ,!Bool // in typedef at start of line
,!
Bool
// is typedef line
// ,!Bool // in typedecl at start of line
,!
Bool
// is typedecl line
,!
Int
// context offside level
,!
Bool
// flush accu
)
::
Info
=
{
comment_level
::
!
Int
// comment nesting level at start of line
// ,!Bool
// in typedef at start of line
,
is_typedef
::
!
Bool
// is typedef line
// ,!Bool
// in typedecl at start of line
,
is_typedecl
::
!
Bool
// is typedecl line
,
offside_level
::
!
Int
// context offside level
,
flush
::
!
Bool
// flush accu
}
// pack bools into bitfield?
firstParse
::
!(
StrictList
String
)
->
StrictList
(!
Info
,!
String
)
...
...
Ed/syncol.icl
View file @
f9e401c1
...
...
@@ -56,12 +56,17 @@ where
=
res
acc
backpatch
state
res
acc
old
=:[(
state`
,
line
):
lines
]
#
flush
=
state`
.
has_content
||
(
not
(
state
.
typedecl
)
&&
state`
.
typedecl
)
#
info
=
((
state
.
level
,
state`
.
typedef
,
state`
.
typedecl
,
state`
.
offside
,
flush
),
line
)
#!
info
=
{
comment_level
=
state
.
level
,
is_typedef
=
state`
.
typedef
,
is_typedecl
=
state`
.
typedecl
,
offside_level
=
state`
.
offside
,
flush
=
flush
}
#
info_and_line
=
(
info
,
line
)
|
state`
.
has_content
=
backpatch
state`
(
copy
res
acc
)
[
info
]
lines
=
backpatch
state`
(
copy
res
acc
)
[
info
_and_line
]
lines
|
not
(
state
.
typedecl
)
&&
state`
.
typedecl
=
backpatch
state`
(
patch
res
acc
)
[
info
]
lines
=
backpatch
state`
res
(
accum
acc
info
)
lines
=
backpatch
state`
(
patch
res
acc
)
[
info
_and_line
]
lines
=
backpatch
state`
res
(
accum
acc
info
_and_line
)
lines
/*
quickParse: (first modified line) (last modified line) textlines
...
...
@@ -76,7 +81,7 @@ quickParse beg end lines
where
before
idx
res
state
reversed_acc
SNil
=
(
0
,
0
,
res
(
reverse
reversed_acc
))
before
idx
res
state
reversed_acc
old
=:(
SCons
(
info
=:
(
level
,
def
,
dec
,
off
,
flush
)
,
line
)
lines
)
before
idx
res
state
reversed_acc
old
=:(
SCons
(
info
=:
{
comment_level
=
level
,
is_typedef
=
def
,
is_typedecl
=
dec
,
offside_level
=
off
,
flush
=
flush
}
,
line
)
lines
)
|
idx
<
beg
|
flush
=
before
(
inc
idx
)
res
state
[(
info
,
line
):
reversed_acc
]
lines
...
...
@@ -91,12 +96,16 @@ where
=
after
beg
idx
state
res
acc
old
#
state`
=
parseLine
state
line
#
flush
=
state`
.
has_content
||
(
not
(
state
.
typedecl
)
&&
state`
.
typedecl
)
#
info
=
((
state
.
level
,
state`
.
typedef
,
state`
.
typedecl
,
state`
.
offside
,
state`
.
has_content
),
line
)
#
info_and_line
=
({
comment_level
=
state
.
level
,
is_typedef
=
state`
.
typedef
,
is_typedecl
=
state`
.
typedecl
,
offside_level
=
state`
.
offside
,
flush
=
state`
.
has_content
},
line
)
|
state`
.
has_content
=
during
beg
(
inc
idx
)
state`
(
copy
res
acc
)
[
info
]
lines
=
during
beg
(
inc
idx
)
state`
(
copy
res
acc
)
[
info
_and_line
]
lines
|
not
(
state
.
typedecl
)
&&
state`
.
typedecl
=
during
beg
idx
{
state
&
typedecl
=
True
}
(
patch
res
acc
)
[]
old
=
during
beg
(
inc
idx
)
state`
res
(
acc
++[
info
])
lines
=
during
beg
(
inc
idx
)
state`
res
(
acc
++[
info
_and_line
])
lines
after
beg
idx
state
res
acc
SNil
=
(
beg
,
dec
idx
,
res
acc
)
...
...
@@ -104,7 +113,11 @@ where
// kan stoppen als na flush info's gelijk zijn...
#
state`
=
parseLine
state
line
#
flush`
=
state`
.
has_content
||
(
not
(
state
.
typedecl
)
&&
state`
.
typedecl
)
#
info`
=
(
state
.
level
,
state`
.
typedef
,
state`
.
typedecl
,
state`
.
offside
,
flush`
)
#
info`
=
{
comment_level
=
state
.
level
,
is_typedef
=
state`
.
typedef
,
is_typedecl
=
state`
.
typedecl
,
offside_level
=
state`
.
offside
,
flush
=
flush`
}
|
state`
.
has_content
|
eqInfo
info
info`
=
(
beg
,
idx
,
res
(
acc
++
(
slToList
old
)))
...
...
@@ -117,13 +130,14 @@ copy res acc rest
=
res
(
acc
++
rest
)
patch
res
acc
rest
=
res
((
map
(\
((
c
,
t
,
d
,
o
,
h
),
l
)->((
c
,
False
,
True
,
o
,
h
)
,
l
))
acc
)
++
rest
)
=
res
((
map
(\
(
info
,
l
)
=
({
info
&
is_typedef
=
False
,
is_typedecl
=
True
}
,
l
))
acc
)
++
rest
)
accum
acc
info
=
acc
++
[
info
]
eqInfo
::
!
Info
!
Info
->
Bool
eqInfo
(
a
,
b
,
c
,
d
,
e
)
(
a`
,
b`
,
c`
,
d`
,
e`
)
=
a
==
a`
&&
b
==
b`
&&
c
==
c`
&&
d
==
d`
&&
e
==
e`
eqInfo
{
comment_level
=
a
,
is_typedef
=
b
,
is_typedecl
=
c
,
offside_level
=
d
,
flush
=
e
}
{
comment_level
=
a`
,
is_typedef
=
b`
,
is_typedecl
=
c`
,
offside_level
=
d`
,
flush
=
e`
}
=
a
==
a`
&&
b
==
b`
&&
c
==
c`
&&
d
==
d`
&&
e
==
e`
instance
==
ParseState
where
(==)
StartOfBlock
StartOfBlock
=
True
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment