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
89f41bfd
Commit
89f41bfd
authored
Feb 06, 2003
by
Diederik van Arkel
Browse files
remove old version from syncol
parent
da333393
Changes
1
Hide whitespace changes
Inline
Side-by-side
Ed/syncol.icl
View file @
89f41bfd
...
@@ -229,141 +229,8 @@ where
...
@@ -229,141 +229,8 @@ where
quickParse: (first modified line) (last modified line) textlines
quickParse: (first modified line) (last modified line) textlines
-> last changed line with different comment nesting & textlines
-> last changed line with different comment nesting & textlines
*/
*/
import
dodebug
quickParse
::
!
Int
!
Int
!(
StrictList
(!
Info
,!
String
))
->
(
Int
,
Int
,
StrictList
(!
Info
,!
String
))
quickParse
::
!
Int
!
Int
!(
StrictList
(!
Info
,!
String
))
->
(
Int
,
Int
,
StrictList
(!
Info
,!
String
))
quickParse
fln
lln
text
quickParse
fln
lln
text
=
(
0
,
slLength
text
-
1
,
firstParse
(
slMap
(\(_,
s
)->
s
)
text
))
=
(
0
,
slLength
text
-
1
,
firstParse
(
slMap
(\(_,
s
)->
s
)
text
))
/*
= qP 0 0 [] 64000 text id
where
// parse before modified
qP :: !Int !Int [(!Info,!String)] !Int !.(StrictList (!Info,!String)) !((StrictList (!Info,!String)) -> (StrictList (!Info,!String))) -> (!Int,!Int, !(StrictList (!Info,!String)))
qP fst cln acc off SNil c
= trace_n` ("qP",cln,0) (fst,cln,c (addAcc acc SNil))
qP fst cln acc off (SCons h=:((level,typedef,typedecl),l) t) c
| cln < fln
# line_size = size l
# (index,indent,_) = scanFirst level 0 0 l
# off = if typedecl (min off indent) 64000
# non_empty = index < line_size
# not_double_colon = l%(index,dec (scanfunny index line_size l)) <> "::"
# has_content = non_empty && if (index > 0) not_double_colon True
| has_content
| isEmpty acc
= trace_n` ("qP",cln,1,l) qP cln (inc cln) [h] off t c
= trace_n` ("qP",cln,2,l) qP cln (inc cln) [h] off t (SC` c acc)
= trace_n` ("qP",cln,3,l) qP fst (inc cln) (acc ++ [h]) off t c //(SC c h)
= trace_n` ("qP",cln,4,l) qS (if (isEmpty acc) cln fst) (level,typedef,typedecl,if (off == 64000) 0 off) cln acc (SCons h t) c
// parse modified section
qS :: !Int !(Int,Bool,Bool,Int) !Int ![(Info,String)] !(StrictList (!Info,!String)) !((StrictList (!Info,!String)) -> (StrictList (!Info,!String))) -> (!Int,!Int, !(StrictList (!Info,!String)))
qS fst i cln acc SNil c
= trace_n` ("qS",cln,0) (fst,cln,c (addAcc acc SNil))
///*
qS fst i=:(level,typedef,typedecl,offside) cln acc (SCons h=:(s,l) t) c
| cln >= lln && eqState i s
= trace_n` ("qS",cln,1) (fst,cln, c (addAcc acc SNil))
# (has_contents,k=:(level`,typedef`,typedecl`,offside`)) = parseLine i l
i` = (level,typedef`,typedecl`)
| typedecl == False && typedecl` && offside < offside` // introduce typedecl where there wasn't one before...
| has_contents
= trace_n` ("qS",cln,2,l) qS fst k (inc cln) [(i`,l)] t (SC` c acc)
// should be identifier in acc...
# j` = (level,typedef,typedecl`,offside)
= trace_n` ("qS",cln,3,l) qS fst j` cln [] (SCons h t) (SC` c (map fun acc))
with
fun :: (!Info,!String) -> (!Info,!String)
fun ((c,t,d),l) = ((c,False,True),l)
| diffState i` s
= case acc of
[((lev,def,dec),_):_] -> trace_n` ("qR",cln,4,l) qF fst cln acc (SCons ((level`,typedef``,typedecl``),l) t) c
[] -> trace_n` ("qR",cln,5,l) qR fst k (inc cln) [(i`,l)] t c
| has_contents
| isEmpty acc
= trace_n` ("qS",cln,4,l) qS fst k (inc cln) [(i`,l)] t c
= trace_n` ("qS",cln,5,l) qS fst k (inc cln) [(i`,l)] t (SC` c acc)
= trace_n` ("qS",cln,6,l) qS fst k (inc cln) (acc ++ [(i`,l)]) t c
// parse after modified
qR :: !Int !(Int,Bool,Bool,Int) !Int ![(Info,String)] !(StrictList (!Info,!String)) !((StrictList (!Info,!String)) -> (StrictList (!Info,!String))) -> (!Int,!Int,!(StrictList (!Info,!String)))
qR fst _ cln acc SNil c
= trace_n` ("qR",cln,0) (fst,cln, c (addAcc acc SNil))
qR fst (level,typedef,typedecl,offside) cln acc r=:(SCons (h=:(level`,typedef`,typedecl`),l) t) c
| level == level` && typedef == typedef` && typedecl == typedecl` && typedef == False && typedecl == False
= trace_n` ("qR",cln,1,l) (fst,dec cln,(SC` c acc) r)
# (has_contents,k=:(level``,typedef``,typedecl``,offside``)) = parseLine (level,typedef,typedecl,offside) l
// = qR k (inc cln) acc t (SC c ((level,typedef,typedecl),l))
i` = (level,typedef``,typedecl``)
| typedecl == False && typedecl`` && offside < offside``
| has_contents
= trace_n` ("qR",cln,2,l) qR fst k (inc cln) [(i`,l)] t (SC` c acc)
// should be identifier in acc...
# j` = (level,False,typedecl``,offside)
= trace_n` ("qR",cln,3,l,listToString acc) qR fst j` cln [] (SCons (h,l) t) (SC` c (map fun acc))
with
fun :: (!Info,!String) -> (!Info,!String)
fun ((c,t,d),l) = ((c,False,True),l)
| typedecl` && not typedecl``
= case acc of
// [((lev,def,dec),_):_] -> qF fst (lev,False,False,0) cln [] acc r c
[((lev,def,dec),_):_] -> trace_n` ("qR",cln,4,l) qF fst cln acc (SCons ((level`,typedef``,typedecl``),l) t) c
[] -> trace_n` ("qR",cln,5,l) qR fst k (inc cln) [(i`,l)] t c
| has_contents
| isEmpty acc
= trace_n` ("qR",cln,6,l) qR fst k (inc cln) [(i`,l)] t c
= trace_n` ("qR",cln,7,l) qR fst k (inc cln) [(i`,l)] t (SC` c acc)
= trace_n` ("qR",cln,8,l) qR fst k (inc cln) (acc ++ [(i`,l)]) t c
// reparse before modified
qF fst cln [(h=:(level,typedef,typedecl),l):t] r c
# (has_contents,k=:(level`,typedef`,typedecl`,offside`)) = parseLine (level,False,False,0) l
i` = (level,typedef`,typedecl`)
= trace_n` ("qF",5,l) qG fst k cln [(i`,l)] t r c
// qG :: !Int !(Int,Bool,Bool,Int) !Int ![(Info,String)] ![(Info,String)] !(StrictList (!Info,!String)) !((StrictList (!Info,!String)) -> (StrictList (!Info,!String))) -> (!Int,!Int, !(StrictList (!Info,!String)))
qG fst (level,typedef,typedecl,offside) cln acc [] SNil c
= trace_n` ("qG",cln,0) (fst,cln, c (addAcc acc SNil))
qG fst (level,typedef,typedecl,offside) cln acc [] r=:(SCons (h=:(level`,typedef`,typedecl`),l) t) c
| level == level` && typedef == typedef` && typedecl == typedecl` && typedef == False && typedecl == False
= trace_n` ("qG",cln,1,l) (fst,dec cln,(SC` c acc) r)
# (has_contents,k=:(level``,typedef``,typedecl``,offside``)) = parseLine (level,typedef,typedecl,offside) l
i` = (level,typedef``,typedecl``)
| typedecl == False && typedecl`` && offside < offside``
| has_contents
= trace_n` ("qG",cln,2,l) qG fst k (inc cln) [(i`,l)] [] t (SC` c acc)
// should be identifier in acc...
# j` = (level,False,typedecl``,offside)
= trace_n` ("qG",cln,3,l,listToString acc) qG fst j` cln [] [] (SCons (h,l) t) (SC` c (map fun acc))
with
fun :: (!Info,!String) -> (!Info,!String)
fun ((c,t,d),l) = ((c,False,True),l)
| has_contents
| isEmpty acc
= trace_n` ("qG",cln,6,l) qG fst k (inc cln) [(i`,l)] [] t c
= trace_n` ("qG",cln,7,l) qG fst k (inc cln) [(i`,l)] [] t (SC` c acc)
= trace_n` ("qG",cln,8,l) qG fst k (inc cln) (acc ++ [(i`,l)]) [] t c
qG fst (level,typedef,typedecl,offside) cln acc [(h=:(level`,typedef`,typedecl`),l):t] r c
# (has_contents,k=:(level`,typedef`,typedecl`,offside`)) = parseLine (level,typedef,typedecl,offside) l
i` = (level,typedef`,typedecl`)
| typedecl == False && typedecl` && offside < offside`
| has_contents
= trace_n` ("qG",1,l) qG fst k cln [(i`,l)] t r (SC` c acc)
// should be identifier in acc...
# j` = (level,typedef,typedecl`,offside)
= trace_n` ("qG",2,l) qG fst j` cln [] [(h,l):t] r (SC` c (map fun acc))
with
fun :: (!Info,!String) -> (!Info,!String)
fun ((c,t,d),l) = ((c,False,True),l)
| has_contents
| isEmpty acc
= trace_n` ("qG",3,l) qG fst k cln [(i`,l)] t r c
= trace_n` ("qG",4,l) qG fst k cln [(i`,l)] t r (SC` c acc)
= trace_n` ("qG",5,l) qG fst k cln (acc ++[(i`,l)]) t r c
*/
SC
c
h
=
\
t
->
c
(
SCons
h
t
)
SC`
c
[]
=
c
SC`
c
[
h
:
t
]
=
SC`
(
SC
c
h
)
t
addAcc
[]
r
=
r
addAcc
[
h
:
t
]
r
=
SCons
h
(
addAcc
t
r
)
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