Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
0d6d1318
Commit
0d6d1318
authored
Oct 04, 2000
by
Martin Wierich
Browse files
added new function to print function names like "c;102;13" as "comprehesion [line 102]"
parent
d602cd1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/typesupport.dcl
View file @
0d6d1318
...
...
@@ -86,7 +86,9 @@ addAttrEnvInequalities :: ![AttrInequality] !*Coercions !u:AttrVarHeap
->
(!.
Coercions
,
!
u
:
AttrVarHeap
)
// assertion: the attribute variables point to (AVI_Attr (TA_TempVar nr)) where
// nr corresponds to the attribute variable
optBeautifulizeIdent
::
!
String
->
Optional
(!
String
,
!
LineNr
)
// convert something like "c;8;2" to Yes ("comprehension", 8)
//accCoercionTree :: !.(u:CoercionTree -> (.a,u:CoercionTree)) !Int !*{!u:CoercionTree} -> (!.a,!{!u:CoercionTree})
accCoercionTree
f
i
coercion_trees
:==
acc_coercion_tree
i
coercion_trees
...
...
frontend/typesupport.icl
View file @
0d6d1318
...
...
@@ -1492,3 +1492,36 @@ addAttrEnvInequalities st_attr_env coercions th_attrs
#
(
AVI_Attr
(
TA_TempVar
offered
),
th_attrs
)
=
readPtr
ai_offered
.
av_info_ptr
th_attrs
(
AVI_Attr
(
TA_TempVar
demanded
),
th_attrs
)
=
readPtr
ai_demanded
.
av_info_ptr
th_attrs
=
(
newInequality
offered
demanded
coercions
,
th_attrs
)
optBeautifulizeIdent
::
!
String
->
Optional
(!
String
,
!
LineNr
)
optBeautifulizeIdent
id_name
#
fst_semicolon_index
=
searchlArrElt
((==)
';'
)
id_name
0
|
fst_semicolon_index
<
size
id_name
#
snd_semicolon_index
=
searchlArrElt
((==)
';'
)
id_name
(
fst_semicolon_index
+1
)
prefix
=
id_name
%
(
0
,
fst_semicolon_index
-1
)
line
=
toInt
(
id_name
%
(
fst_semicolon_index
+1
,
snd_semicolon_index
-1
))
=
Yes
(
prefix_to_readable_name
prefix
,
line
)
=
No
where
prefix_to_readable_name
"_c"
=
"case"
prefix_to_readable_name
"_g"
=
"guard"
prefix_to_readable_name
"_f"
=
"filter"
prefix_to_readable_name
"
\\
"
=
"lambda"
prefix_to_readable_name
prefix
|
prefix
.[
0
]
==
'c'
=
"comprehension"
|
prefix
.[
0
]
==
'g'
=
"generator"
prefix_to_readable_name
_
=
abort
"fatal error 21 in type.icl"
// search for an element in an array
searchlArrElt
p
s
i
:==
searchl
s
i
where
searchl
s
i
|
i
>=
size
s
=
i
|
p
s
.[
i
]
=
i
=
searchl
s
(
i
+1
)
// ..MW4
Write
Preview
Supports
Markdown
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