aboutsummaryrefslogtreecommitdiff
path: root/frontend/parse.icl
diff options
context:
space:
mode:
authorjohnvg2002-03-27 12:39:27 +0000
committerjohnvg2002-03-27 12:39:27 +0000
commitb186a086f32d620549d3ed86a95bc767c45b38f0 (patch)
tree78caa20d1eaaa5e5d26285b608b81fe4b197ce66 /frontend/parse.icl
parentcompile_with_generics = False (diff)
fix bug in CharList with \010 char
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1066 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/parse.icl')
-rw-r--r--frontend/parse.icl19
1 files changed, 18 insertions, 1 deletions
diff --git a/frontend/parse.icl b/frontend/parse.icl
index 6e484d8..53be8dd 100644
--- a/frontend/parse.icl
+++ b/frontend/parse.icl
@@ -1621,6 +1621,20 @@ where
| annot == AN_None
= (PD_Type td, pState)
= (PD_Type td, parseError "Type synonym" No ("No lhs strictness annotation for the type synonym "+name) pState)
+/*
+ want_type_rhs parseContext td=:{td_attribute} token=:DefinesColonToken annot pState
+ | isIclContext parseContext
+ = (PD_Erroneous, parseError "type RHS" (Yes token) "type definition" pState)
+ # name = td.td_name.id_name
+ (atype, pState) = want pState // Atype
+ # (td_attribute, properties) = determine_properties annot td_attribute
+ td = {td & td_rhs = AbstractTypeSpec properties atype, td_attribute=td_attribute}
+ | annot <> AN_None
+ = (PD_Type td, parseError "Type synonym" No ("No lhs strictness annotation for the type synonym "+name) pState)
+ | td_attribute == TA_Anonymous || td_attribute == TA_Unique || td_attribute == TA_None
+ = (PD_Type td, pState)
+ = (PD_Type td, parseError "abstract type" No ("type attribute "+toString td_attribute+" for abstract type "+name+" is not") (tokenBack pState))
+*/
want_type_rhs parseContext td=:{td_attribute} token annot pState
| isIclContext parseContext
= (PD_Erroneous, parseError "type RHS" (Yes token) "type definition" pState)
@@ -2794,7 +2808,10 @@ wantListExp is_pattern pState
-> want_list (add_chars (fromString chars) acc) pState
with
add_chars [] acc = acc
- add_chars ['\\',c:r] acc = add_chars r [PE_Basic (BVC (toString ['\'','\\',c,'\''])): acc]
+ add_chars ['\\',c1,c2,c3:r] acc
+ | c1>='0' && c1<='7'
+ = add_chars r [PE_Basic (BVC (toString ['\'','\\',c1,c2,c3,'\''])): acc]
+ add_chars ['\\',c:r] acc = add_chars r [PE_Basic (BVC (toString ['\'','\\',c,'\''])): acc]
add_chars [c:r] acc = add_chars r [PE_Basic (BVC (toString ['\'',c,'\''])): acc]
_ # (exp, pState) = (if is_pattern (wantLhsExpressionT token) (wantRhsExpressionT token)) pState
-> want_list [exp: acc] pState