Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-ide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
clean-ide
Commits
40eb6617
Commit
40eb6617
authored
Feb 21, 2003
by
Diederik van Arkel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typedecl colouring
parent
a849a1f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
24 deletions
+34
-24
Ed/EdLineText.icl
Ed/EdLineText.icl
+5
-3
Ed/syncol.icl
Ed/syncol.icl
+29
-21
No files found.
Ed/EdLineText.icl
View file @
40eb6617
...
...
@@ -8,6 +8,9 @@ from EdPosition import :: LineNr
import
syncol
import
Platform
//import dodebug
trace_n`
_
f
:==
f
//-- stuff we want to parametrise...
/*
class TextAnnot a // b
...
...
@@ -22,7 +25,7 @@ export TextAnnot Void, SyncInf, ConsInf
*/
::
LineAnnot
:==
Info
dummyLineAnnot
:==
(
0
,
False
,
False
)
dummyLineAnnot
:==
(
0
,
False
,
False
,
0
)
annotLine
:==
slMap
(\
s
->(
dummyLineAnnot
,
s
))
annotWhole
:==
firstParse
annotPart
:==
quickParse
...
...
@@ -283,5 +286,4 @@ updateLine lineNr string text=:{ nrLines, blocks }
#
after
=
SCons
(
pl
,
string
)
(
slTail
after
)
#!
lines
=
slAppend
before
after
#
(
st
,
fin
,
lines
)
=
annotPart
lineNr
lineNr
lines
=
(
st
,
fin
,{
blocks
=
group
BlockSize
lines
,
nrLines
=
nrLines
})
=
trace_n`
(
"updateLine"
,
st
,
fin
)
(
st
,
fin
,{
blocks
=
group
BlockSize
lines
,
nrLines
=
nrLines
})
Ed/syncol.icl
View file @
40eb6617
...
...
@@ -44,7 +44,7 @@ where
scanFirst
::
!
Int
!
Int
!
Int
!.
String
->
(!
Int
,!
Int
,!
Int
)
scanFirst
level
index
indent
line
|
index
>=
line_size
=
(
index
,
indent
,
level
)
|
index
>=
line_size
=
(
index
,
-1
,
level
)
#
char
=
line
.[
index
]
|
char
==
' '
=
scanFirst
level
(
inc
index
)
(
inc
indent
)
line
|
char
==
'\t'
=
scanFirst
level
(
inc
index
)
((
inc
(
indent
>>
2
))
<<
2
)
line
...
...
@@ -104,17 +104,20 @@ scanfunny i line_size line
//:: String State -> ((Info,String),State)
parseLine
::
!.
State
!.
String
->
(!
Bool
,!
State
)
parseLine
state
=:(
level
,
typedef
,
typedecl
,
offside
)
line
#
(
index
,
indent
,
level
)
=
scanFirst
level
0
0
line
#
(
typedecl
,
offside
)
=
if
typedecl
(
if
(
index
<
line_size
&&
indent
<=
offside
)
#
!
(
index
,
indent
,
level
)
=
scanFirst
level
0
0
line
#
!
(
typedecl
,
offside
)
=
if
typedecl
(
if
(
index
<
line_size
&&
indent
>=
0
&&
indent
<=
offside
)
(
False
,
indent
)
(
True
,
offside
)
)
(
False
,
indent
)
#
state
=
(
level
,
typedef
,
typedecl
,
offside
)
#
has_content
=
index
<
line_size
#
not_double_colon
=
line
%(
index
,
dec
(
scanfunny
index
line_size
line
))
<>
"::"
=
(
has_content
&&
if
(
index
>
0
)
not_double_colon
True
,
pL
state
index
)
(
False
,
if
(
indent
>=
0
)
indent
offside
)
#!
state
=
(
level
,
typedef
,
typedecl
,
offside
)
#!
has_content
=
indent
>=
0
&&
index
<
line_size
|
index
>
0
#!
not_double_colon
=
line
%(
index
,
dec
(
scanfunny
index
line_size
line
))
<>
"::"
=
(
has_content
&&
not_double_colon
,
pL
state
index
)
=
(
has_content
,
pL
state
index
)
// = (has_content && if (index > 0) not_double_colon True , pL state index)
where
line_size
=
size
line
...
...
@@ -171,7 +174,10 @@ where
no_c`
=
line_size
<
2
c`
=
line
.[
1
]
scanFunny
(
level
,
typedef
,
typedecl
,
offside
)
s
i
|
i
>=
line_size
=
pL
(
level
,
typedef
,
typedecl
,
offside
)
line_size
|
i
>=
line_size
|
level
==
0
&&
line
%(
s
,
dec
i
)
==
"::"
=
pL
(
0
,
typedef
,
True
,
offside
)
i
=
pL
(
level
,
typedef
,
typedecl
,
offside
)
i
#!
c
=
line
.[
i
]
|
funnyChar
c
=
scanFunny
(
level
,
typedef
,
typedecl
,
offside
)
s
(
inc
i
)
|
level
==
0
&&
line
%(
s
,
dec
i
)
==
"::"
...
...
@@ -203,27 +209,29 @@ WhiteSpace c
*/
firstParse
::
!(
StrictList
String
)
->
StrictList
(!
Info
,!
String
)
firstParse
lines
=
slFromList
(
fP
(
0
,
False
,
False
,
0
)
[]
lines
)
// = slFromList (fP (0,False,False,0) [] lines)
=
fP
(
0
,
False
,
False
,
0
)
id
[]
lines
where
fP
i
acc
SNil
=
acc
fP
i
=:(
level
,
typedef
,
typedecl
,
offside
)
acc
(
SCons
h
t
)
fP
::
!(!
Int
,!
Bool
,!
Bool
,!
Int
)
((
StrictList
(!
Info
,!
String
))
->
StrictList
(!
Info
,!
String
))
![(!(!
Int
,!
Bool
,!
Bool
,!
Int
),!
String
)]
!(
StrictList
String
)
->
StrictList
(!
Info
,!
String
)
fP
i
res
acc
SNil
=
res
(
slFromList
acc
)
fP
i
=:(
level
,
typedef
,
typedecl
,
offside
)
res
acc
(
SCons
h
t
)
#!
(
has_contents
,
j
=:(
level`
,
typedef`
,
typedecl`
,
offside`
))
=
parseLine
i
h
i`
=
(
level
,
typedef`
,
typedecl`
)
i`
=
(
level
,
typedef`
,
typedecl`
,
offside`
)
|
typedecl
==
False
&&
typedecl`
&&
offside
<
offside`
|
has_contents
=
acc
++
(
fP
j
[(
i`
,
h
)]
t
)
=
fP
j
(\
r
->
res
(
slFromList`
acc
r
))
[(
i`
,
h
)]
t
// should be identifier in acc...
#
j`
=
(
level
,
typedef
,
typedecl`
,
offside
)
=
[
fun
s
\\
s
<-
acc
]
++
(
fP
j`
[]
(
SCons
h
t
)
)
=
fP
j`
(\
r
->
res
(
slFromList`
[
fun
s
\\
s
<-
acc
]
r
))
[]
(
SCons
h
t
)
with
fun
::
(!
Info
,!
String
)
->
(!
Info
,!
String
)
fun
((
c
,
t
,
d
),
l
)
=
((
c
,
False
,
True
),
l
)
fun
((
c
,
t
,
d
,
o
),
l
)
=
((
c
,
False
,
True
,
o
),
l
)
|
has_contents
|
isEmpty
acc
=
fP
j
[(
i`
,
h
)]
t
=
acc
++
(
fP
j
[(
i`
,
h
)]
t
)
=
fP
j
(
acc
++[(
i`
,
h
)])
t
=
fP
j
res
[(
i`
,
h
)]
t
=
fP
j
(\
r
->
res
(
slFromList`
acc
r
))
[(
i`
,
h
)]
t
=
fP
j
res
(
acc
++[(
i`
,
h
)])
t
/*
quickParse: (first modified line) (last modified line) textlines
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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