721 |
721 |
722 fun ml_program_of_program ctxt module_name reserved identifiers = |
722 fun ml_program_of_program ctxt module_name reserved identifiers = |
723 let |
723 let |
724 fun namify_const upper base (nsp_const, nsp_type) = |
724 fun namify_const upper base (nsp_const, nsp_type) = |
725 let |
725 let |
726 val (base', nsp_const') = |
726 val (base', nsp_const') = Name.variant (Name.enforce_case upper base) nsp_const |
727 Name.variant (if upper then Name.enforce_case true base else base) nsp_const |
|
728 in (base', (nsp_const', nsp_type)) end; |
727 in (base', (nsp_const', nsp_type)) end; |
729 fun namify_type base (nsp_const, nsp_type) = |
728 fun namify_type base (nsp_const, nsp_type) = |
730 let |
729 let |
731 val (base', nsp_type') = Name.variant base nsp_type |
730 val (base', nsp_type') = Name.variant (Name.enforce_case false base) nsp_type |
732 in (base', (nsp_const, nsp_type')) end; |
731 in (base', (nsp_const, nsp_type')) end; |
733 fun namify_stmt (Code_Thingol.Fun _) = namify_const false |
732 fun namify_stmt (Code_Thingol.Fun _) = namify_const false |
734 | namify_stmt (Code_Thingol.Datatype _) = namify_type |
733 | namify_stmt (Code_Thingol.Datatype _) = namify_type |
735 | namify_stmt (Code_Thingol.Datatypecons _) = namify_const true |
734 | namify_stmt (Code_Thingol.Datatypecons _) = namify_const true |
736 | namify_stmt (Code_Thingol.Class _) = namify_type |
735 | namify_stmt (Code_Thingol.Class _) = namify_type |